OpenWRT Cross Compiling

Wiki.TerraBase.info
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


...quitting for now because the instructions at https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#selecting_a_specific_major_revision are a pathetic joke. Go ahead, try them, see if it works. Nope....

Additional notes from other failed attempts;

http://transit.iut2.upmf-grenoble.fr/cgi-bin/man/man2html?Crypt::SSLeay+3

https://github.com/Entware/Entware-ng/wiki/Using-gcc-%28native-compilation%29

perl Makefile.PL --incpath /usr/src/lib

perl Makefile.PL -- $openssl_path=/usr/src/lib/openssl

echo | gcc -v -E -


perl -V


/usr/src/net/Net_SSLeay.pm-1.23/MYMETA.yml


env


opkg install perl-dev


opkg install openssl-


https://github.com/Entware/Entware-ng/wiki/Self-installation-of-perl-modules


https://github.com/Entware/Entware-ng/issues/430

https://github.com/Entware/Entware/wiki/Using-GCC-for-native-compilation


/usr/bin/ld: cannot find -lssl

/usr/bin/ld: cannot find -lcrypto

/usr/bin/ld: cannot find -ldl

ln -s

ld -lcrypto --verbose

find /


https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary

For the /usr/bin/ld Issue: https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary


/usr/bin/opensslOpenSSL 1.1.1g  21 Apr 2020

built on: Thu Jul 30 19:43:27 2020 UTC

platform: linux-arm-openwrt

options:  bn(64,32) rc4(char) des(long) blowfish(ptr)

compiler: arm-openwrt-linux-muslgnueabi-gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -ffunction-sections -fdata-sections -znow -zrelro -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -DOPENSSL_PREFER_CHACHA_OVER_GCM -DOPENSSL_SMALL_FOOTPRINT

OPENSSLDIR: "/etc/ssl"

ENGINESDIR: "/usr/lib/engines-1.1"

Seeding source: os-specific

OpenSSL>version -a


https://www.cpan.org/modules/by-module/Net/Net-SSLeay-1.73.readme


https://stackoverflow.com/questions/60521205/how-can-i-install-netssleay-with-perlbrew-in-macos-catalina




perl Makefile.PL -- INC=-I/usr/src/lib/ -- OPENSSL_PREFIX=/usr/src/openssl_compiled/usr/local


SSLeay.c: In function 'XS_Net__SSLeay_CTX_sessions':

SSLeay.c:3608:2: error: unknown type name 'LHASH'; did you mean '_LHASH'?

  LHASH * RETVAL;

  ^~~~~

 

  SSLeay.c line 3608, change LHASH to _LHASH

OpenSSL

remove -ldl and all -pthread references near EX_LIBS (from https://github.com/openssl/openssl/issues/3106)

Change destination directory for GCC Make: https://stackoverflow.com/questions/3239343/make-install-but-not-to-default-directories

...sure enough, in Makefile;

# DESTDIR is for package builders so that they can configure for, say,

# /usr/ and yet have everything installed to /tmp/somedir/usr/.

# Normally it is left empty.

DESTDIR=

Add the paths in Make File that include the new SSL stuff

DDLFLAGS = -shared -L/usr/src/openssl_compiled/usr/local/ -L/usr/src/openssl_compiled/usr/local/lib -L/usr -L/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/lib -znow -zrelro

LDFLAGS = -L/usr/src/openssl_compiled/usr/local/ -L/usr/src/openssl_compiled/usr/local/lib -L/usr -L/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/lib -znow -zrelro