[LEDE-DEV] Issues building libunwind for x86_32
Philip Prindeville
philipp_subx at redfish-solutions.com
Sun Nov 5 15:44:14 PST 2017
> On Nov 5, 2017, at 3:28 PM, Philip Prindeville <philipp_subx at redfish-solutions.com> wrote:
>
> I’m seeing the following when trying to build a Geode image:
>
>
> make[6]: Entering directory '/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1/src'
> /bin/bash ../libtool --tag=CC --mode=link i486-openwrt-linux-musl-gcc -Os -pipe -march=pentium-mmx -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1:libunwind-1.2.1 -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fexceptions -Wall -Wsign-compare -XCClinker -nostartfiles -XCClinker -nostdlib -version-info 8:1:0 -L/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/usr/lib -L/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/lib -L/home/philipp/bertram/lede3/staging_dir/toolchain-i386_pentium_gcc-5.5.0_musl/usr/lib -L/home/philipp/bertram/lede3/staging_dir/toolchain-i386_pentium_gcc-5.5.0_musl/lib -znow -zrelro -o libunwind.la -rpath /usr/lib os-linux.lo mi/init.lo mi/flush_cache.lo mi/mempool.lo mi/strerror.lo x86/is_fpreg.lo x86/regname.lo x86/Los-linux.lo mi/backtrace.lo mi/dyn-cancel.lo mi/dyn-info-list.lo mi/dyn-register.lo mi/Ldyn-extract.lo mi/Lfind_dynamic_proc_info.lo mi/Lget_accessors.lo mi/Lget_proc_info_by_ip.lo mi/Lget_proc_name.lo mi/Lput_dynamic_unwind_info.lo mi/Ldestroy_addr_space.lo mi/Lget_reg.lo mi/Lset_reg.lo mi/Lget_fpreg.lo mi/Lset_fpreg.lo mi/Lset_caching_policy.lo x86/Lcreate_addr_space.lo x86/Lget_save_loc.lo x86/Lglobal.lo x86/Linit.lo x86/Linit_local.lo x86/Linit_remote.lo x86/Lget_proc_info.lo x86/Lregs.lo x86/Lresume.lo x86/Lstep.lo x86/getcontext-linux.lo libunwind-dwarf-local.la libunwind-elf32.la -lc -lgcc_s
> OpenWrt-libtool: link: i486-openwrt-linux-musl-gcc -shared -fPIC -DPIC .libs/os-linux.o mi/.libs/init.o mi/.libs/flush_cache.o mi/.libs/mempool.o mi/.libs/strerror.o x86/.libs/is_fpreg.o x86/.libs/regname.o x86/.libs/Los-linux.o mi/.libs/backtrace.o mi/.libs/dyn-cancel.o mi/.libs/dyn-info-list.o mi/.libs/dyn-register.o mi/.libs/Ldyn-extract.o mi/.libs/Lfind_dynamic_proc_info.o mi/.libs/Lget_accessors.o mi/.libs/Lget_proc_info_by_ip.o mi/.libs/Lget_proc_name.o mi/.libs/Lput_dynamic_unwind_info.o mi/.libs/Ldestroy_addr_space.o mi/.libs/Lget_reg.o mi/.libs/Lset_reg.o mi/.libs/Lget_fpreg.o mi/.libs/Lset_fpreg.o mi/.libs/Lset_caching_policy.o x86/.libs/Lcreate_addr_space.o x86/.libs/Lget_save_loc.o x86/.libs/Lglobal.o x86/.libs/Linit.o x86/.libs/Linit_local.o x86/.libs/Linit_remote.o x86/.libs/Lget_proc_info.o x86/.libs/Lregs.o x86/.libs/Lresume.o x86/.libs/Lstep.o x86/.libs/getcontext-linux.o -Wl,--whole-archive ./.libs/libunwind-dwarf-local.a ./.libs/libunwind-elf32.a -Wl,--no-whole-archive -L/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/usr/lib -L/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/lib -L/home/philipp/bertram/lede3/staging_dir/toolchain-i386_pentium_gcc-5.5.0_musl/usr/lib -L/home/philipp/bertram/lede3/staging_dir/toolchain-i386_pentium_gcc-5.5.0_musl/lib -lc -lgcc_s -Os -march=pentium-mmx -fstack-protector -Wl,-z -Wl,now -Wl,-z -Wl,relro -nostartfiles -nostdlib -Wl,-soname -Wl,libunwind.so.8 -o .libs/libunwind.so.8.0.1
> .libs/os-linux.o: In function `_Ux86_get_elf_image':
> os-linux.c:(.text+0x58a): undefined reference to `__stack_chk_fail_local'
> x86/.libs/Lregs.o: In function `_ULx86_access_fpreg':
> Lregs.c:(.text+0x25b): undefined reference to `__stack_chk_fail_local'
> x86/.libs/Lresume.o: In function `_ULx86_resume':
> Lresume.c:(.text+0xdc): undefined reference to `__stack_chk_fail_local'
> collect2: error: ld returned 1 exit status
> Makefile:2582: recipe for target 'libunwind.la' failed
> make[6]: *** [libunwind.la] Error 1
> make[6]: Leaving directory '/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1/src'
> Makefile:1646: recipe for target 'all' failed
> make[5]: *** [all] Error 2
> make[5]: Leaving directory '/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1/src'
> Makefile:594: recipe for target 'all-recursive' failed
> make[4]: *** [all-recursive] Error 1
> make[4]: Leaving directory '/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1'
> Makefile:57: recipe for target '/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1/.built' failed
> make[3]: *** [/home/philipp/bertram/lede3/build_dir/target-i386_pentium_musl/libunwind-1.2.1/.built] Error 2
> make[3]: Leaving directory '/home/philipp/bertram/lede3/package/libs/libunwind'
> package/Makefile:109: recipe for target 'package/libs/libunwind/compile' failed
> make[2]: *** [package/libs/libunwind/compile] Error 2
> make[2]: Leaving directory '/home/philipp/bertram/lede3'
> package/Makefile:105: recipe for target '/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/stamp/.package_compile' failed
> make[1]: *** [/home/philipp/bertram/lede3/staging_dir/target-i386_pentium_musl/stamp/.package_compile] Error 2
> make[1]: Leaving directory '/home/philipp/bertram/lede3'
> /home/philipp/bertram/lede3/include/toplevel.mk:207: recipe for target 'world' failed
> make: *** [world] Error 2
>
>
> I have to admit I’ve not built an x86_32 in years, which is probably why I’ve not seen this sooner.
>
> Anyone know what’s going on?
>
> Thanks,
>
> -Philip
A Google search says that it can be fixed by linking with
CONFIGURE_VARGS += LIBS=-lssp
but looking in our configurations (toolchain/gcc/Config.in), I see:
config SSP_SUPPORT
bool
prompt "Enable Stack-Smashing Protection support" if TOOLCHAINOPTS
depends on !USE_MUSL
default y if !USE_MUSL
help
Enable Stack-Smashing Protection support
And package/libs/toolchain/Makefile shows me that libssp can’t be built without @SSP_SUPPORT.
Is there a reason that MUSL and libssp don’t work together?
Anyone else building x86 (not x86_64) images?
Thanks,
-Philip
More information about the Lede-dev
mailing list