Can not build openssl for luci - I just do not know what to do


d5_enc'
d5_enc'
/home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op enwrt-linux-musl/bin/ld.bfd: cipher_rc4_hmac_md5_hw.c:(.text.cipher_hw_rc4_hmac_md5_cipher+0x44a): undefined reference to `RC4' /home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op enwrt-linux-musl/bin/ld.bfd: cipher_rc4_hmac_md5_hw.c:(.text.cipher_hw_rc4_hmac_md5_cipher+0x48e): undefined reference to rc4_m /home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op enwrt-linux-musl/bin/ld.bfd: cipher_rc4_hmac_md5_hw.c:(.text.cipher_hw_rc4_hmac_md5_cipher+0x537): undefined reference to /home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op enwrt-linux-musl/bin/ld.bfd: providers/liblegacy.a(liblegacy-lib-cipher_rc4_hmac_md5_hw.o): in function `cipher_hw_rc4_hmac_md5_ cipher_rc4_hmac_md5_hw.c:(.text.cipher_hw_rc4_hmac_md5_init key+0x16): undefined reference to RC4_set_key' /home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op
initkey':
enwrt-linux-musl/bin/ld.bfd: providers/liblegacy.a(liblegacy-lib-cipher_rc4_hw.0): in function `cipher_hw_rc4_cipher cipher_rc4_hw.c:(.text.cipher_hw_rc4_cipher+0x16): undefined reference to `RC4'
RC4
/home/ladmin/openwrt/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-mus1/13.3.0/../../../../x86_64-op
enwrt-linux-musl/bin/ld.bfd: providers/liblegacy.a(liblegacy-lib-cipher_rc4_hw.o): in function `cipher_hw_rc4_initkey': cipher_rc4_hw.c:(.text.cipher_hw_rc4_initkey+0x15): undefined reference to RC4_set_key'
collect2: error: ld returned 1 exit status
make [5]: *** [Makefile: 19067: providers/legacy.so] Error 1
make [5]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/openssl-3.0.18' make [4]: *** [Makefile: 1594: build_sw] Error 2
make [4]: Leaving directory
'/home/ladmin/openwrt/build_dir/target-x86_64_musl/openssl-3.0.18'
make[3]: *** [Makefile: 434: /home/ladmin/openwrt/build_dir/target-x86_64_musl/openssl-3.0.18/.built] Error 2 make[3]: Leaving directory '/home/ladmin/openwrt/package/libs/openssl'
time: package/libs/openssl/compile#202.90#34.57#265.50
ERROR: package/libs/openssl failed to build.
make[2]: *** [package/Makefile:176: package/libs/openssl/compile] Error 1
make[2]: Leaving directory '/home/ladmin/openwrt'
make[1]: *** [package/Makefile: 170: /home/ladmin/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/ladmin/openwrt' make: *** [/home/ladmin/openwrt/include/top level.mk:233: world] Error 2 

I guess I missed some dependencies?

try updating your feeds perhaps

scripts/feeds update -a
scripts/feeds install -a

make menuconfig
...
1 Like

I did it after make dirclean and also removed all ssl packages from build using make menuconfig both luci-ssl and luci-openssl. Hope it will help and later I can build ssl-support separately.

well I guess it don't hurt if you've got the time. Just make sure you only select one or the other. I can say for certain, luci-ssl works fine .. i just built it to confirm

Just select the luci-ssl from LuCi-->collections in menuconfig, save and make

I choose only luci-ssl, yet error persists:

Configuring comgt-ncm. Configuring kmod-forcedeth. Configuring umbim.
Configuring kmod-amd-xgbe. Configuring kmod-ssb.
Configuring kmod-b44.
Configuring kmod-stmmac-core. Configuring kmod-dwmac-intel. Configuring luci.
Configuring kmod-netem. Configuring fdisk.
Configuring kmod-usb-uhci.
Configuring libstdcpp6.
Configuring kmod-at11.
Configuring kmod-at 12.
Configuring adblock-fast.
Configuring kmod-i2c-algo-bit.
Configuring kmod-drm-1915.
Configuring luci-app-adblock-fast.
Configuring ffmpeg.
Configuring kmod-video-fwnode.
Configuring kmod-e1000e.
Configuring blkid.
Configuring kmod-usb-net-sr9700.
Configuring kmod-button-hotplug.
Configuring kmod-usb-storage-extras.
Configuring kmod-ifb.
Configuring kmod-igb.
Configuring kmod-igc.
Configuring kmod-video-cpia2.
Configuring kmod-bnx2.
Configuring urngd.
Configuring ppp-mod-pppoe.
Configuring kmod-ipt-nat.
Collected errors:

  • check_data_file_clashes: Package libustream-openss 120201210 wants to install file /home/ladmin/openwrt/build_dir/target-x86_6 4_musl/root-x86/lib/libustream-ssl.so
    But that file is already provided by package libustream-mbedt 1s20201210
  • opkg_install_cmd: Cannot install package libustream-openss120201210.
  • resolve_conf files: Existing conffile /home/ladmin/openwrt/build_dir/target-x86_64_musl/root-x86/etc/ppp/chap-secrets is diffe rent from the conffile in the new package. The new conffile will be placed at /home/ladmin/openwrt/build_dir/target-x86_64_musl/ root-x86/etc/ppp/chap-secrets-opkg.
    make[2]: *** [package/Makefile:99: package/install] Error 255
    make[2]: Leaving directory '/home/ladmin/openwrt'
    make[1]: *** [package/Makefile: 171: /home/ladmin/openwrt/staging_dir/target-x86_64_musl/stamp/.package_install] Error 2 make[1]: Leaving directory '/home/ladmin/openwrt'
    make: *** [/home/ladmin/openwrt/include/top level.mk:233: world] Error 2
    ladmin@jopa-slona: "/openwrt$

I do not understand why openssl wants to be installed, while I uncheck it in config.

as i mentioned .. one OR the other not both. Start by removing libustream-openssl. Or save you current config using menuconfig, via save --> change to old.config and save

then exit and clear current config by

echo "" > .config

then make menuconfig and start fresh

to reload old.config (if desired), in menuconfig load it via load --> change it to old.config and load. then save via save --> don't change(leave as .config) and save

1 Like

Check Libraries - libustream

1 Like

OMG! It is Libraries → SSL and as dependency selected by sstp-client. So my only variant is to use OpenSSL instead of mbedtls, but even if I uncheck mbedtls in Luci → Applications it still persists somehow even after distclean. Ah I see - it is (mbedtls) sellected by default -*- as dependency of some packages among which are libcurl and px5g_mbedtls it is also a default option of some package. Classic dll hell…I remember that somewhere im menuconfig was an option to use either simple curl or curl with ssl. may be curl-ssl is selected, but I can not find in now, omg.

try just building the luci-ssl package independently.

make package/luci-ssl/compile V=s

or

make package/luci-ssl-openssl/compile V=s

Both commands raised no errors. Luci-ssl write “Nothing to compile” in the end, and openssl output looks normal

so now try to add it post build via

apk add luci-ssl-openssl

I can not do this I am building OpenWRT on Ubuntu virtual machine

you can't install packages from a running system via cmd line ? or you can't use apk ..?

Ah, you mean install ssl on Ubuntu host machine? I will try that, but I am not sure that ubuntu repository knows about luci-ssl from openwrt repository. (I use 24.10 and it use opkg still). I am afraid to switch to apk, cause of unresanoble fear of something bad happen.

P.S. I found px5g-mbedtls in Utilities → Encription and uncheck it. It seems not obligatory.

I guess core of problem is adblock-fast-webui in Luci → Applications. It pulls curl → curl pulls → mbedtls → mbedtls conflicts with openssl

UPD: But no. this mbedtls is still obligatory… Network → Adblock-fast and adblock also need to be removed. And now I can uncheck curl !

UPD2: OMG, I am so stupid. curl is configurable! And I can chose SSL I need now. By default curl was configured to use mbedtls, now I change for OpenSSL and hope all will be ok. I return Luci → Applications → Adblock and Adblock UI. Aldo return curl (it would be a problem to live without curl). I also uncheck px5g-mbedtls and use px5g-standalone instead and I hope all gonna be ok.

no, from your/a working openwrt station ... open shell or use luci to install the luci-ssl-openssl package. It will take care of dependencies and build what it needs. With any luck it will install without complaint

2 Likes

I wish I could, but I need image with pre-installed ssl. I configured libcurl to use openssl and hope it will be ok now.

UPD:

Nah, now curl is missing some libs:

make [10]: Entering directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/include" make [10] Nothing to be done for 'install-exec-am'.
make [10]
Nothing to be done for 'install-data-am'. make [10]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/include' make [9]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/include' make [8]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/include' make [7]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1' make [6]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1' make [5]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1 make [4]: Leaving directory '/home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1'
touch /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/.built
rm -rf /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/.pkgdir/libcurl.installed /home/ladmin/openwrt/build_dir/ta
rget-x86_64_musl/curl-8.12.1/.pkgdir/libcurl
mkdir -p /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/.pkgdir/libcurl
install -d -m0755 /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/.pkgdir/libcurl/usr/lib
cp -fpR /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-install/usr/lib/libcurl.so.* /home/ladmin/openwrt/bui
ld_dir/target-x86_64_musl/curl-8.12.1/.pkgdir/libcurl/usr/lib/
touch /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/.pkgdir/libcurl.installed
mkdir -p /home/ladmin/openwrt/staging_dir/target-x86_64_musl/root-x86/stamp
echo '4 cmp -s - /home/ladmin/openwrt/staging_dir/target-x86_64_musl/pkginfo/libcurl.version || { echo '4'> /home/ladmin/ope
nwrt/staging_dir/target-x86_64_musl/pkginfo/libcurl.version;
SHELL= flock /home/ladmin/openwrt/tmp/.root-copy. flock -c 'cp -fpR /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1 /.pkgdir/libcurl/. /home/ladmin/openwrt/staging_dir/target-x86_64_musl/root-x86/
touch /home/ladmin/openwrt/staging_dir/target-x86_64_musl/root-x86/stamp/.libcurl_installed
rm -rf /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-x86_64/libcurl
/home/ladmin/openwrt/scripts/ipkg-remove libcurl /home/ladmin/openwrt/bin/packages/x86_64/packages/libcur14_8.12.1-r1_x86_64.ipk removed '/home/ladmin/openwrt/bin/packages/x86_64/packages/libcur14_8.12.1-r1_x86_64.ipk'
mkdir -p /home/ladmin/openwrt/bin/targets/x86/64/packages /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-x86 _64/libcurl /home/ladmin/openwrt/staging_dir/target-x86_64_musl/pkginfo install -d -m0755 /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-x86_64/libcurl/usr/lib
cp -fpR /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-install/usr/lib/libcurl.so.* /home/ladmin/openwrt/bui
ld_dir/target-x86_64_musl/curl-8.12.1/ipkg-x86_64/libcurl/usr/lib/
find /home/ladmin/openwrt/build_dir/target-x86_64_musl/curl-8.12.1/ipkg-x86_64/libcurl -name 'CVS' -o -name '.svn -o -name #* -o-name | xargs -r rm -rf Package libcurl is missing dependencies for the following libraries:
libmbedcrypto.so.16
libmbedtls.so.21
libmbedx509.so.7
make[3]: *** [Makefile:199: /home/ladmin/openwrt/bin/packages/x86_64/packages/libcur14_8.12.1-r1_x86_64.ipk] Error 1 make[3]: Leaving directory '/home/ladmin/openwrt/feeds/packages/net/curl'
time: package/feeds/packages/curl/compile#73.57#8.12#90.92
ERROR: package/feeds/packages/curl failed to build.
make[2]: *** [package/Makefile:176: package/feeds/packages/curl/compile] Error 1
make[2]: Leaving directory '/home/ladmin/openwrt'
make[1]: *** [package/Makefile: 170: /home/ladmin/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/ladmin/openwrt'
make: *** [/home/ladmin/openwrt/include/top level.mk:233: world] Error 2
ladmin@jopa-slona: "/openwrt$

I guess I could may be try to locate them in Libraries and check, but it seems to be far easy. There must be something else…

Problem is seems to be in Librarires → libustream-mbedtls which is selected as module for the reason i do not know. I unchek it. And it did not change anything.

UPD: I can see that dependency of libcurl on mbedtls defined not only by selected library, but also by some variable which is LIBCURL_MBEDTLS. May be this is the problem? But I do not know how to find it and where.

yes it did ...

now it cannot find the libs.

As a general rule, only select the package you require
ie luci-ssl-openssl ..
do not select any ssl libs ie openssl as the dependencies will be selected by luci-ssl-openssl package.

I recommend you start fresh, revert back to where you were before you started trying to install luci-ssl .. Then once you are up and running, try using apk to install luci-ssl-openssl, you can do it from luci via System-->Software, update the list and the do a search for luci-ssl, pick the one you want and hit install

1 Like

OMG, After numerours “make clean”, “make dirclean”, checking and doublechecking of menuconfig, it seems that all build with no error. At least I see no warning in console output and /bin directory has freshly made image. I will try new image soon and hope it is ok. Many thanks for your help, friend!

1 Like