Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1091 - libiconv-full undefined reference compile-time linking error for x86/_64 using GCC7 Musl #6019

Open
openwrt-bot opened this issue Oct 20, 2017 · 4 comments
Labels
flyspray packages

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Oct 20, 2017

staehle:

LEDE Trunk using latest commit fbde9ac
Feeds all using latest trunk sources, though that shouldn't affect this
Target is "x86" Generic (also tried x86_64)
Selected GCC 7 for compiler options
.config is attached

Problem discovered when enabling the 'minidlna' package, which has a dependency on 'libiconv-full' - a core LEDE package.

Compilation fails on 'libiconv-full' with undefined reference errors (linking errors) for objects 'aliases_lookup' and 'aliases2_lookup' in "libiconv.so":

make[5]: Entering directory '/home/jstaehle/prem2/depot/lede/build_dir/target-i386_pentium4_musl/libiconv-1.11.1/src'
/bin/sh ../libtool --mode=link i486-openwrt-linux-musl-gcc -L/home/jstaehle/prem2/depot/lede/staging_dir/target-i386_pentium4_musl/usr/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/target-i386_pentium4_musl/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/toolchain-i386_pentium4_gcc-7.2.0_musl/usr/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/toolchain-i386_pentium4_gcc-7.2.0_musl/lib -znow -zrelro iconv_no_i18n.o ../srclib/libicrt.a ../lib/libiconv.la -o iconv_no_i18n
i486-openwrt-linux-musl-gcc -znow -zrelro iconv_no_i18n.o -o iconv_no_i18n -L/home/jstaehle/prem2/depot/lede/staging_dir/target-i386_pentium4_musl/usr/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/target-i386_pentium4_musl/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/toolchain-i386_pentium4_gcc-7.2.0_musl/usr/lib -L/home/jstaehle/prem2/depot/lede/staging_dir/toolchain-i386_pentium4_gcc-7.2.0_musl/lib ../srclib/libicrt.a ../lib/.libs/libiconv.so -Wl,--rpath -Wl,/home/jstaehle/prem2/depot/lede/build_dir/target-i386_pentium4_musl/libiconv-1.11.1/lib/.libs
../lib/.libs/libiconv.so: undefined reference to aliases_lookup' ../lib/.libs/libiconv.so: undefined reference to aliases2_lookup'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'iconv_no_i18n' failed
make[5]: *** [iconv_no_i18n] Error 1

Full build log is also attached

Tested with a full default configuration and only options enabled being GCC 7 and a modular option for the libiconv-full package, so that should rule out any external influence.

I did find one other reference to this issue on the LEDE forums a few months ago here: [[https://forum.lede-project.org/t/compilation-fails-on-libiconv-full/4504|LEDE Forums: compilation fails on libiconv-full]]

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Oct 20, 2017

staehle:

Uh oh, compile log didn't get attached. Here you go.
Thanks!

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Oct 21, 2017

harrylwc:

add -std=gnu89 to package/libs/libiconv-full/Makefile

TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Oct 23, 2017

staehle:

Adding '-std=gnu89' to the LEDE package Makefile TARGET_CFLAGS results in a successful compilation.
Great answer, harrylwc!

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Nov 6, 2017

staehle:

As a note, I submitted a pull request on the LEDE GitHub with this fix:
lede-project/source#1455

@aparcar aparcar added the packages label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray packages
Projects
None yet
Development

No branches or pull requests

2 participants