* bug#20102: Problem with ld.so RUNPATH on armhf @ 2015-03-13 18:56 Mark H Weaver 2015-04-04 21:58 ` Ludovic Courtès 2015-06-13 15:12 ` Mark H Weaver 0 siblings, 2 replies; 18+ messages in thread From: Mark H Weaver @ 2015-03-13 18:56 UTC (permalink / raw) To: 20102 I recently tried rebuilding Guix on armhf, specifically master since the recent core-updates merge, and have run into a snag. I'm able to build a lot of stuff, including our full 'emacs' package (with Gtk+), but I'm unable to build 'glibc-utf8-locales', which means I can't build any profiles at all, because the ca-certificates-bundle uses glibc-utf8-locales. Here's what happens when I try to build 'glibc-utf8-locales' manually: --8<---------------cut here---------------start------------->8--- mhw@novena:~$ guix build -K glibc-utf8-locales The following derivation will be built: /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv warning: failed to install locale: Invalid argument @ build-started /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv - armhf-linux /var/log/guix/drvs/14//kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv.bz2 Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! note: keeping build directory `/tmp/nix-build-glibc-utf8-locales-2.21.drv-0' builder for `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed with exit code 1 @ build-failed /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv - 1 builder for `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed with exit code 1 killing process 1498 guix build: error: build failed: build of `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed --8<---------------cut here---------------end--------------->8--- The key line being: Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! Here's the relevant bit of code from glibc-2.21/elf/get-dynamic-info.h: --8<---------------cut here---------------start------------->8--- #ifdef RTLD_BOOTSTRAP /* Only the bind now flags are allowed. */ assert (info[VERSYMIDX (DT_FLAGS_1)] == NULL || (info[VERSYMIDX (DT_FLAGS_1)]->d_un.d_val & ~DF_1_NOW) == 0); assert (info[DT_FLAGS] == NULL || (info[DT_FLAGS]->d_un.d_val & ~DF_BIND_NOW) == 0); /* Flags must not be set for ld.so. */ assert (info[DT_RUNPATH] == NULL); assert (info[DT_RPATH] == NULL); --8<---------------cut here---------------end--------------->8--- "assert (info[DT_RUNPATH] == NULL)" is the assertion that fails here. This happens while trying to run 'localedef' from the 'glibc' that's an input to 'glibc-utf8-locales'. Interestingly, 'bash' works from the same store item: --8<---------------cut here---------------start------------->8--- mhw@novena:/gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/bin$ ./bash I have no name!@novena:/gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/bin$ exit mhw@novena:/gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/bin$ ./localedef Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! --8<---------------cut here---------------end--------------->8--- readelf reveals that indeed, the ld.so used by localedef, /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/lib/ld-linux-armhf.so.3 does have RUNPATH set: (excerpt of "readelf -a" output) --8<---------------cut here---------------start------------->8--- Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align EXIDX 0x01681c 0x0001681c 0x0001681c 0x00098 0x00098 R 0x4 LOAD 0x000000 0x00000000 0x00000000 0x168b4 0x168b4 R E 0x10000 LOAD 0x016c80 0x00026c80 0x00026c80 0x00c00 0x00cc8 RW 0x10000 DYNAMIC 0x016f3c 0x00026f3c 0x00026f3c 0x000c0 0x000c0 RW 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 GNU_RELRO 0x016c80 0x00026c80 0x00026c80 0x00380 0x00380 R 0x1 Section to Segment mapping: Segment Sections... 00 .ARM.exidx 01 .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_d .rel.dyn .rel.plt .plt .text .rodata .ARM.extab .ARM.exidx 02 .data.rel.ro .dynamic .got .data .bss 03 .dynamic 04 05 .data.rel.ro .dynamic Dynamic section at offset 0x16f3c contains 20 entries: Tag Type Name/Value 0x0000000e (SONAME) Library soname: [ld-linux-armhf.so.3] 0x0000001d (RUNPATH) Library runpath: [/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib] --8<---------------cut here---------------end--------------->8--- Any ideas what went wrong here? Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-03-13 18:56 bug#20102: Problem with ld.so RUNPATH on armhf Mark H Weaver @ 2015-04-04 21:58 ` Ludovic Courtès 2015-04-05 4:42 ` Mark H Weaver 2015-06-13 15:12 ` Mark H Weaver 1 sibling, 1 reply; 18+ messages in thread From: Ludovic Courtès @ 2015-04-04 21:58 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 Mark H Weaver <mhw@netris.org> skribis: > readelf reveals that indeed, the ld.so used by localedef, > > /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/lib/ld-linux-armhf.so.3 > > does have RUNPATH set: (excerpt of "readelf -a" output) Could you post the libc build log? Use: guix build --log-file /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21 Thanks, Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-04 21:58 ` Ludovic Courtès @ 2015-04-05 4:42 ` Mark H Weaver 2015-04-06 20:24 ` Ludovic Courtès 0 siblings, 1 reply; 18+ messages in thread From: Mark H Weaver @ 2015-04-05 4:42 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 [-- Attachment #1: Type: text/plain, Size: 378 bytes --] ludo@gnu.org (Ludovic Courtès) writes: > Mark H Weaver <mhw@netris.org> skribis: > >> readelf reveals that indeed, the ld.so used by localedef, >> >> /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/lib/ld-linux-armhf.so.3 >> >> does have RUNPATH set: (excerpt of "readelf -a" output) > > Could you post the libc build log? See attached. Mark [-- Attachment #2: Build log for /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21 --] [-- Type: application/x-bzip2, Size: 228675 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-05 4:42 ` Mark H Weaver @ 2015-04-06 20:24 ` Ludovic Courtès 2015-04-06 21:02 ` Mark H Weaver 0 siblings, 1 reply; 18+ messages in thread From: Ludovic Courtès @ 2015-04-06 20:24 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 Mark H Weaver <mhw@netris.org> skribis: > ludo@gnu.org (Ludovic Courtès) writes: > >> Mark H Weaver <mhw@netris.org> skribis: >> >>> readelf reveals that indeed, the ld.so used by localedef, >>> >>> /gnu/store/l2bkyclkm0lph48mfs6jbndj9p0y41g8-glibc-2.21/lib/ld-linux-armhf.so.3 >>> >>> does have RUNPATH set: (excerpt of "readelf -a" output) >> >> Could you post the libc build log? > > See attached. Thanks. Could you send the output of: $(guix build -e '(@ (gnu packages commencement) gcc-final)' | grep -ve -lib)/bin/gcc -dumpspecs It could be that the patching of config/gnu-user*.h ends up adding -rpath in the wrong place. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-06 20:24 ` Ludovic Courtès @ 2015-04-06 21:02 ` Mark H Weaver 2015-04-08 9:52 ` Ludovic Courtès 0 siblings, 1 reply; 18+ messages in thread From: Mark H Weaver @ 2015-04-06 21:02 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 ludo@gnu.org (Ludovic Courtès) writes: > Could you send the output of: > > $(guix build -e '(@ (gnu packages commencement) gcc-final)' | grep -ve -lib)/bin/gcc -dumpspecs > > It could be that the patching of config/gnu-user*.h ends up adding > -rpath in the wrong place. Here it is: --8<---------------cut here---------------start------------->8--- mhw@novena:~$ $(guix build -e '(@ (gnu packages commencement) gcc-final)' | grep -ve -lib)/bin/gcc -dumpspecs *asm: %{mbig-endian:-EB} %{mlittle-endian:-EL} %(asm_cpu_spec) %{mapcs-*:-mapcs-%*} %(subtarget_asm_float_spec) %{mthumb-interwork:-mthumb-interwork} %{mfloat-abi=*} %{mfpu=*} %(subtarget_extra_asm_spec) *asm_debug: %{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*} *asm_final: %{gsplit-dwarf: objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo} objcopy --strip-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} } *asm_options: %{-target-help:%:print-asm-header()} %{v} %{w:-W} %{I*} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} *invoke_as: %{!fwpa: %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()} %{!S:-o %|.s | as %(asm_options) %m.s %A } } *cpp: %(subtarget_cpp_spec) %{mfloat-abi=soft:%{mfloat-abi=hard: %e-mfloat-abi=soft and -mfloat-abi=hard may not be used together}} %{mbig-endian:%{mlittle-endian: %e-mbig-endian and -mlittle-endian may not be used together}} *cpp_options: %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess} *cpp_debug_options: %{d*} *cpp_unique_options: %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}} %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}} *trad_capable_cpp: cc1 -E %{traditional|traditional-cpp:-traditional-cpp} *cc1: %{!mandroid|tno-android-cc:%{profile:-p};:%{profile:-p} %{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}} *cc1_options: %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{aux-info*} %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{Qy:} %{-help:--help} %{-target-help:--target-help} %{-version:--version} %{-help=*:--help=%*} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} %{coverage:-fprofile-arcs -ftest-coverage} *cc1plus: %{!mandroid|tno-android-cc:;:%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} %{!frtti:%{!fno-rtti: -fno-rtti}}} *link_gcc_c_sequence: %{static:--start-group} %G %L %{static:--end-group}%{!static:%G} *link_ssp: %{fstack-protector:} *endfile: %{!mandroid|tno-android-ld:%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s;:%{shared: crtend_so%O%s;: crtend_android%O%s}} *link: %{!static:--eh-frame-hdr} %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 |mcpu=cortex-a7 |mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 |mcpu=marvell-pj4 |mcpu=generic-armv7-a |march=armv7-m|mcpu=cortex-m3 |march=armv7e-m|mcpu=cortex-m4 |march=armv6-m|mcpu=cortex-m0 |march=armv8-a :%{!r:--be8}}}%{!mandroid|tno-android-ld:%{h*} %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} %{!static: %{rdynamic:-export-dynamic} -dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3}}} -X %{mbig-endian:-EB} %{mlittle-endian:-EL} -m armelf_linux_eabi;:%{h*} %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} %{!static: %{rdynamic:-export-dynamic} -dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3}}} -X %{mbig-endian:-EB} %{mlittle-endian:-EL} -m armelf_linux_eabi %{shared: -Bsymbolic}} *lib: %{!mandroid|tno-android-ld:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}} *mfwrap: %{static: %{fmudflap|fmudflapth: --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=mmap64 --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main} *mflib: %{fmudflap|fmudflapth: -export-dynamic} *link_gomp: *libgcc: %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}} *startfile: %{!mandroid|tno-android-ld:%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s};:%{shared: crtbegin_so%O%s;: %{static: crtbegin_static%O%s;: crtbegin_dynamic%O%s}}} *cross_compile: 0 *version: 4.8.4 *multilib: . ; *multilib_defaults: marm mlittle-endian mfloat-abi=hard mno-thumb-interwork *multilib_extra: *multilib_matches: *multilib_exclusions: *multilib_options: *multilib_reuse: *linker: collect2 *linker_plugin_file: *lto_wrapper: *lto_gcc: *link_libgcc: %D *md_exec_prefix: *md_startfile_prefix: *md_startfile_prefix_1: *startfile_prefix_spec: *sysroot_spec: --sysroot=%R *sysroot_suffix_spec: *sysroot_hdrs_suffix_spec: *self_spec: *subtarget_cpp_spec: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} *asm_cpu_spec: %{mcpu=generic-*:-march=%*; :%{mcpu=*:-mcpu=%*} %{march=*:-march=%*}} *subtarget_extra_asm_spec: %{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5} %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx} *subtarget_asm_float_spec: %{mapcs-float:-mfloat} *link_command: %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %{!fno-use-linker-plugin:%{flto|flto=*|fuse-linker-plugin: -plugin %(linker_plugin_file) -plugin-opt=%(lto_wrapper) -plugin-opt=-fresolution=%u.res %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}} }}%{flto|flto=*:%<fcompare-debug*} %{flto} %{flto=*} %l %{pie:-pie} %{fuse-ld=*:-fuse-ld=%*} %X %{o*} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} %{static:} %{L*} %(mfwrap) %(link_libgcc) %{!nostdlib:%{!nodefaultlibs:%{fsanitize=address:%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}} %{fsanitize=thread:%{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}}}} %o %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %{fgnu-tm:%:include(libitm.spec)%(link_itm)} %(mflib) %{fsplit-stack: --wrap=pthread_create} %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%{fsanitize=address: %{static-libasan:-ldl -lpthread} %{static:%ecannot specify -static with -fsanitize=address} %{fsanitize=thread:%e-fsanitize=address is incompatible with -fsanitize=thread}} %{fsanitize=thread: %{static-libtsan:-ldl -lpthread} %{!pie:%{!shared:%e-fsanitize=thread linking must be done with -pie or -shared}}}}} %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}} %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}} mhw@novena:~$ --8<---------------cut here---------------end--------------->8--- ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-06 21:02 ` Mark H Weaver @ 2015-04-08 9:52 ` Ludovic Courtès 2015-04-08 15:21 ` Mark H Weaver 0 siblings, 1 reply; 18+ messages in thread From: Ludovic Courtès @ 2015-04-08 9:52 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 Mark H Weaver <mhw@netris.org> skribis: > *lib: > %{!mandroid|tno-android-ld:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static:-rpath=/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}} On x86_64 I have pretty much the same: --8<---------------cut here---------------start------------->8--- *lib: %{!mandroid|tno-android-ld:-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static:-rpath=/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}};:-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static:-rpath=/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib %{!static-libgcc:-rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib64 -rpath=/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc} %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}} --8<---------------cut here---------------end--------------->8--- ‘link_command’ is also identical. The difference between ‘glibc-final’ and (@ (gnu packages base) glibc) (used to build glibc-utf8-locales) is that the latter is built with ‘gcc-final’, and ‘gcc-final’ always passes “-rpath $libc/lib” when linking a shared object, as seen above. However, when linking ld.so, -nostdlib is used, so IIUC the “lib” spec is ignored, so the -rpath flag isn’t passed. At least that’s what happens on x86_64: I interrupted the (@ (gnu packages base) glibc) build on x86_64 and ran the command manually: --8<---------------cut here---------------start------------->8--- ludo@pluto /tmp/nix-build-glibc-2.21.drv-0/build/elf$ strace -s 345 -f -o ,,s gcc --verbose -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map \ -Wl,-soname=ld-linux-x86-64.so.2 \ -Wl,-defsym=_begin=0 > > > > Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix gcc version 4.8.4 (GCC) COMPILER_PATH=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/ LIBRARY_PATH=/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib/:/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib/:/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib/:/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib/:/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib/:/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib/:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib/:/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../../:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-mtune=generic' '-march=x86-64' /gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/collect2 --eh-frame-hdr -m elf_x86_64 -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib -L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib -L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib -L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib -L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib -L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4 -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../.. -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-x86-64.so.2 -defsym=_begin=0 --8<---------------cut here---------------end--------------->8--- The strace log shows that ld is not passed the -rpath flags that appear in the “lib” spec: --8<---------------cut here---------------start------------->8--- 13261 execve("/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", ["/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-m", "elf_x86_64", "-shared", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib", "-L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib", "-L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib", "-L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib", "-L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib", "-L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-x86-64.so.2", "-defsym=_begin=0"], [/* 73 vars */] --8<---------------cut here---------------end--------------->8--- Could you try the same on armhf? TIA, Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 9:52 ` Ludovic Courtès @ 2015-04-08 15:21 ` Mark H Weaver 2015-04-08 15:26 ` Mark H Weaver ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Mark H Weaver @ 2015-04-08 15:21 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 ludo@gnu.org (Ludovic Courtès) writes: > Mark H Weaver <mhw@netris.org> skribis: > > The difference between ‘glibc-final’ and (@ (gnu packages base) glibc) > (used to build glibc-utf8-locales) is that the latter is built with > ‘gcc-final’, and ‘gcc-final’ always passes “-rpath $libc/lib” when > linking a shared object, as seen above. > > However, when linking ld.so, -nostdlib is used, so IIUC the “lib” spec > is ignored, so the -rpath flag isn’t passed. > > At least that’s what happens on x86_64: I interrupted the (@ (gnu > packages base) glibc) build on x86_64 and ran the command manually: > > ludo@pluto /tmp/nix-build-glibc-2.21.drv-0/build/elf$ strace -s 345 -f -o ,,s gcc --verbose -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new \ > -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ > /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map \ > -Wl,-soname=ld-linux-x86-64.so.2 \ > -Wl,-defsym=_begin=0 > >> > > > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/lto-wrapper > Target: x86_64-unknown-linux-gnu > Configured with: > Thread model: posix > gcc version 4.8.4 (GCC) > COMPILER_PATH=/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/ > LIBRARY_PATH=/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib/:/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib/:/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib/:/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib/:/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib/:/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib/:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib/:/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/:/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../../:/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib > COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-mtune=generic' '-march=x86-64' > /gnu/store/4sqgnc9bc1kmn058yp4xnj4vpydmfzpq-gcc-4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/collect2 --eh-frame-hdr -m elf_x86_64 -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib -L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib -L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib -L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib -L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib -L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4 -L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../.. -L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-x86-64.so.2 -defsym=_begin=0 > > The strace log shows that ld is not passed the -rpath flags that appear > in the “lib” spec: > > 13261 execve("/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", ["/gnu/store/crfqrvj1g3ldyhfqq8wpwqx3sd6qn4k7-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-m", "elf_x86_64", "-shared", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib", "-L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib", "-L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib", "-L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib", "-L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib", "-L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4", "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../..", "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-x86-64.so.2", "-defsym=_begin=0"], [/* 73 vars */] > > Could you try the same on armhf? I've done so. Here's the transcript: --8<---------------cut here---------------start------------->8--- mhw@novena:/tmp/nix-build-glibc-2.21.drv-0$ source environment-variables mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build$ cd /tmp/nix-build-glibc-2.21.drv-0/build/elf/ mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ /usr/bin/strace -s 345 -f -o ,,s gcc --verbose -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map \ -Wl,-soname=ld-linux-armhf.so.3 \ -Wl,-defsym=_begin=0 > > > > Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/lto-wrapper Target: armv7l-unknown-linux-gnueabihf Configured with: Thread model: posix gcc version 4.8.4 (GCC) COMPILER_PATH=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/ LIBRARY_PATH=/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib/:/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib/:/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib/:/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib/:/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib/:/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib/:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/:/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../../:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' /gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/collect2 --eh-frame-hdr -shared -dynamic-linker /gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib -L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib -L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib -L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib -L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib -L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4 -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.. -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-armhf.so.3 -defsym=_begin=0 mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ --8<---------------cut here---------------end--------------->8--- and here's the corresponding line in the strace log: --8<---------------cut here---------------start------------->8--- 13440 execve("/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", ["/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-shared", "-dynamic-linker", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3", "-X", "-m", "armelf_linux_eabi", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib", "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib", "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib", "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib", "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib", "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../..", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-armhf.so.3", "-defsym=_begin=0"], [/* 55 vars */] <unfinished ...> --8<---------------cut here---------------end--------------->8--- Thanks! Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 15:21 ` Mark H Weaver @ 2015-04-08 15:26 ` Mark H Weaver 2015-04-08 15:48 ` Ludovic Courtès 2015-04-08 15:50 ` Mark H Weaver 2015-04-08 18:39 ` Ludovic Courtès 2 siblings, 1 reply; 18+ messages in thread From: Mark H Weaver @ 2015-04-08 15:26 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 Mark H Weaver <mhw@netris.org> writes: > ludo@gnu.org (Ludovic Courtès) writes: > >> Could you try the same on armhf? > > I've done so. Here's the transcript: > > mhw@novena:/tmp/nix-build-glibc-2.21.drv-0$ source environment-variables > mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build$ cd /tmp/nix-build-glibc-2.21.drv-0/build/elf/ > mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ /usr/bin/strace -s 345 -f -o ,,s gcc --verbose -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new \ > -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ > /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map \ > -Wl,-soname=ld-linux-armhf.so.3 \ > -Wl,-defsym=_begin=0 >> > > > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/lto-wrapper > Target: armv7l-unknown-linux-gnueabihf > Configured with: > Thread model: posix > gcc version 4.8.4 (GCC) > COMPILER_PATH=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/ > LIBRARY_PATH=/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib/:/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib/:/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib/:/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib/:/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib/:/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib/:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/:/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../../:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib > COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' > /gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/collect2 --eh-frame-hdr -shared -dynamic-linker /gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib -L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib -L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib -L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib -L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib -L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4 -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.. -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-armhf.so.3 -defsym=_begin=0 > mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ and I should add this sanity check: --8<---------------cut here---------------start------------->8--- mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ readelf -a ld.so.new | grep RUNPATH 0x0000001d (RUNPATH) Library runpath: [/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib] --8<---------------cut here---------------end--------------->8--- Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 15:26 ` Mark H Weaver @ 2015-04-08 15:48 ` Ludovic Courtès 0 siblings, 0 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-04-08 15:48 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 Mark H Weaver <mhw@netris.org> skribis: > Mark H Weaver <mhw@netris.org> writes: > >> ludo@gnu.org (Ludovic Courtès) writes: >> >>> Could you try the same on armhf? >> >> I've done so. Here's the transcript: >> >> mhw@novena:/tmp/nix-build-glibc-2.21.drv-0$ source environment-variables >> mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build$ cd /tmp/nix-build-glibc-2.21.drv-0/build/elf/ >> mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ /usr/bin/strace -s 345 -f -o ,,s gcc --verbose -nostdlib -nostartfiles -shared -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new \ >> -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ >> /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os -Wl,--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map \ >> -Wl,-soname=ld-linux-armhf.so.3 \ >> -Wl,-defsym=_begin=0 >>> > > > Using built-in specs. >> COLLECT_GCC=gcc >> COLLECT_LTO_WRAPPER=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/lto-wrapper >> Target: armv7l-unknown-linux-gnueabihf >> Configured with: >> Thread model: posix >> gcc version 4.8.4 (GCC) >> COMPILER_PATH=/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/ >> LIBRARY_PATH=/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib/:/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib/:/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib/:/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib/:/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib/:/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib/:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/:/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/:/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../../:/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib >> COLLECT_GCC_OPTIONS='-v' '-nostdlib' '-nostartfiles' '-shared' '-o' '/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' >> /gnu/store/qchkhdj4nn4aqs8rrbbyybrj2sarjs3j-gcc-4.8.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/collect2 --eh-frame-hdr -shared -dynamic-linker /gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o /tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new -L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib -L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib -L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib -L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib -L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib -L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4 -L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.. -L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib -z combreloc -z relro --hash-style=both -z defs /tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os --version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map -soname=ld-linux-armhf.so.3 -defsym=_begin=0 >> mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ > > and I should add this sanity check: > > mhw@novena:/tmp/nix-build-glibc-2.21.drv-0/build/elf$ readelf -a ld.so.new | grep RUNPATH > 0x0000001d (RUNPATH) Library runpath: [/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib] So there’s no explicit -rpath, yet it slips through. In that build directory, can you rm elf/ld*so* and then restart the build, but this time with: export GUIX_LD_WRAPPER_DEBUG=yes TIA! Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 15:21 ` Mark H Weaver 2015-04-08 15:26 ` Mark H Weaver @ 2015-04-08 15:50 ` Mark H Weaver 2015-04-08 18:39 ` Ludovic Courtès 2 siblings, 0 replies; 18+ messages in thread From: Mark H Weaver @ 2015-04-08 15:50 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 Mark H Weaver <mhw@netris.org> writes: > and here's the corresponding line in the strace log: > > 13440 execve("/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", ["/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-shared", "-dynamic-linker", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3", "-X", "-m", "armelf_linux_eabi", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib", "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib", "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib", "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib", "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib", "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../..", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-armhf.so.3", "-defsym=_begin=0"], [/* 55 vars */] <unfinished ...> So, -rpath is not passed to ld-wrapper's ld, but it _is_ passed to the binutils ld: --8<---------------cut here---------------start------------->8--- 13440 execve("/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/bin/ld", ["ld", "--eh-frame-hdr", "-shared", "-dynamic-linker", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3", "-X", "-m", "armelf_linux_eabi", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib", "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib", "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib", "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib", "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib", "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../..", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-armhf.so.3", "-defsym=_begin=0", "-rpath", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib"], [/* 53 vars */]) = 0 --8<---------------cut here---------------end--------------->8--- Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 15:21 ` Mark H Weaver 2015-04-08 15:26 ` Mark H Weaver 2015-04-08 15:50 ` Mark H Weaver @ 2015-04-08 18:39 ` Ludovic Courtès 2015-04-08 22:33 ` Ludovic Courtès 2015-04-09 6:04 ` Mark H Weaver 2 siblings, 2 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-04-08 18:39 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 [-- Attachment #1: Type: text/plain, Size: 7605 bytes --] Mark H Weaver <mhw@netris.org> skribis: > 13440 execve("/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", ["/gnu/store/p70wvylq6xdrlxblnk76k3ljgkrmvpnq-ld-wrapper-0/bin/ld", "--eh-frame-hdr", "-shared", "-dynamic-linker", "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3", "-X", "-m", "armelf_linux_eabi", "-o", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new", "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib", "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib", "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib", "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib", "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib", "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4", "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../..", "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib", "-z", "combreloc", "-z", "relro", "--hash-style=both", "-z", "defs", "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os", "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map", "-soname=ld-linux-armhf.so.3", "-defsym=_begin=0"], [/* 55 vars */] <unfinished ...> Indeed, here’s what happens when passing it through ld-wrapper: --8<---------------cut here---------------start------------->8--- $ GUIX_LD_WRAPPER_DEBUG=yes ld "--eh-frame-hdr" "-shared" "-dynamic-linker" "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3" "-X" "-m" "armelf_linux_eabi" "-o" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new" "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib" "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib" "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib" "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib" "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib" "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib" "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib" "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib" "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4" "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.." "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib" "-z" "combreloc" "-z" "relro" "--hash-style=both" "-z" "defs" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os" "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map" "-soname=ld-linux-armhf.so.3" "-defsym=_begin=0" ld-wrapper: invoking `/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/bin/ld' with ("--eh-frame-hdr" "-shared" "-dynamic-linker" "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3" "-X" "-m" "armelf_linux_eabi" "-o" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new" "-L/gnu/store/84bsc47g2052allrmh4ph6xaqvp6f4cm-perl-5.16.1/lib" "-L/gnu/store/lakz7x2m4vqvvfdasn5x95a91rkqqs3c-bzip2-1.0.6/lib" "-L/gnu/store/mrb163wwjc45hgrcjwmb6nxp8fgab3lk-xz-5.0.4/lib" "-L/gnu/store/f1fnh2sp1j32jysdr2nw9z296iba6b5d-file-5.22/lib" "-L/gnu/store/l9ji7gc640j2r8c1c561iwcnqpcd585m-gawk-4.1.1/lib" "-L/gnu/store/w7gjnx5rz64mssxndnryazlwlhflfd2j-binutils-2.25/lib" "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib" "-L/gnu/store/psmxs9gcr9l4arz7agmp94vm8fjwninv-glibc-utf8-locales-2.21/lib" "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4" "-L/gnu/store/fc8kqk3dazn6mcgcjxd931752b2pf3wj-gcc-4.8.4-lib/lib/gcc/armv7l-unknown-linux-gnueabihf/4.8.4/../../.." "-L/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib" "-z" "combreloc" "-z" "relro" "--hash-style=both" "-z" "defs" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os" "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map" "-soname=ld-linux-armhf.so.3" "-defsym=_begin=0" "-rpath" "/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib") ld: unrecognised emulation mode: armelf_linux_eabi --8<---------------cut here---------------end--------------->8--- Conversely, when “replaying” the command that’s used on x86_64, -rpath is not added: --8<---------------cut here---------------start------------->8--- $ GUIX_LD_WRAPPER_DEBUG=yes ld "--eh-frame-hdr" "-m" "elf_x86_64" "-shared" "-o" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new" "-L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib" "-L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib" "-L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib" "-L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib" "-L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib" "-L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib" "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "-L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib" "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4" "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../.." "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "-z" "combreloc" "-z" "relro" "--hash-style=both" "-z" "defs" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os" "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map" "-soname=ld-linux-x86-64.so.2" "-defsym=_begin=0" ld-wrapper: invoking `/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/bin/ld' with ("--eh-frame-hdr" "-m" "elf_x86_64" "-shared" "-o" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/ld.so.new" "-L/gnu/store/xxjla3x9lv9djgszi9g2i7sp3zdh2fhz-perl-5.16.1/lib" "-L/gnu/store/zf0lrd865zxwkx30zmmv2s9pm3cbnyq9-bzip2-1.0.6/lib" "-L/gnu/store/yc75pismby9n46pimi7l9ifjwmj2ybix-xz-5.0.4/lib" "-L/gnu/store/ip9ydlmc7kwb1q472rh8539rkplx8xgl-file-5.22/lib" "-L/gnu/store/vmlwh55kmsjk7mmrw5qi8n71f02l4w0p-gawk-4.1.1/lib" "-L/gnu/store/z9d24s2wkri1z0ix5r7qqyp7zy3dklb4-binutils-2.25/lib" "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "-L/gnu/store/43mpxdd1qwmlsfgnl79jy1zkkx25nz6r-glibc-utf8-locales-2.21/lib" "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4" "-L/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../.." "-L/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glibc-2.21/lib" "-z" "combreloc" "-z" "relro" "--hash-style=both" "-z" "defs" "/tmp/nix-build-glibc-2.21.drv-0/build/elf/librtld.os" "--version-script=/tmp/nix-build-glibc-2.21.drv-0/build/ld.map" "-soname=ld-linux-x86-64.so.2" "-defsym=_begin=0") --8<---------------cut here---------------end--------------->8--- With a bit of additional debug, I can print the value of ‘libs’ in the ‘ld-wrapper’ procedure: --8<---------------cut here---------------start------------->8--- ;;; (libs ("/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3")) --8<---------------cut here---------------end--------------->8--- This one comes from the -dynamic-linker flag, which is not passed on x86_64. I believe this extra -dynamic-linker flag comes from a bogus ‘link’ spec on ARM, solved by this: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 463 bytes --] --- gcc-4.8.4/gcc/config/arm/linux-elf.h.orig 2015-04-08 20:31:20.376900478 +0200 +++ gcc-4.8.4/gcc/config/arm/linux-elf.h 2015-04-08 20:31:36.437014437 +0200 @@ -65,7 +65,7 @@ %{symbolic:-Bsymbolic} \ %{!static: \ %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ -X \ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC [-- Attachment #3: Type: text/plain, Size: 636 bytes --] That way it would match GNU_USER_TARGET_LINK_SPEC in i386/gnu-user.h, where -dynamic-linker appears within %{!static ... %{!shared ...}}. So, could you do: (define patched-gcc (package (inherit gcc-4.8) (sources (origin (inherit (package-source gcc-4.8)) (patches ...))))) build it, and then use it in the failed glibc build tree to rebuild ld.so? There are ways we could have worked around it, for instance by adding: (setenv "GUIX_LD_WRAPPER_DISABLE_RPATH" "yes") in the glibc recipe. But I think it’s better to understand what’s going on. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 18:39 ` Ludovic Courtès @ 2015-04-08 22:33 ` Ludovic Courtès 2015-04-09 6:04 ` Mark H Weaver 1 sibling, 0 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-04-08 22:33 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 [-- Attachment #1: Type: text/plain, Size: 815 bytes --] ludo@gnu.org (Ludovic Courtès) skribis: > That way it would match GNU_USER_TARGET_LINK_SPEC in i386/gnu-user.h, > where -dynamic-linker appears within %{!static ... %{!shared ...}}. > > So, could you do: > > (define patched-gcc > (package > (inherit gcc-4.8) > (sources (origin (inherit (package-source gcc-4.8)) > (patches ...))))) > > build it, and then use it in the failed glibc build tree to rebuild > ld.so? > > > There are ways we could have worked around it, for instance by adding: > > (setenv "GUIX_LD_WRAPPER_DISABLE_RPATH" "yes") > > in the glibc recipe. I’m forgetting another possibility: fix ld-wrapper so that it doesn’t add “-rpath $(dirname ld.so)” when it encounters “-dynamic-linker ld.so”. This patch does that: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 3360 bytes --] diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in index 094018d..125edee 100644 --- a/gnu/packages/ld-wrapper.in +++ b/gnu/packages/ld-wrapper.in @@ -142,34 +142,45 @@ exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)) (define (library-files-linked args) ;; Return the file names of shared libraries explicitly linked against via ;; `-l' or with an absolute file name in ARGS. - (define path+files + (define path+files+args (fold (lambda (argument result) (match result - ((library-path . library-files) + ((library-path library-files ("-dynamic-linker" . rest)) + ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'. + ;; See <http://bugs.gnu.org/20102>. + (list library-path + library-files + (cons* argument "-dynamic-linker" rest))) + ((library-path library-files previous-args) (cond ((string-prefix? "-L" argument) ;augment the search path - (cons (append library-path + (list (append library-path (list (string-drop argument 2))) - library-files)) + library-files + (cons argument previous-args))) ((string-prefix? "-l" argument) ;add library (let* ((lib (string-append "lib" (string-drop argument 2) ".so")) (full (search-path library-path lib))) + (list library-path (if full - (cons library-path - (cons full library-files)) - result))) + (cons full library-files) + library-files) + (cons argument previous-args)))) ((and (string-prefix? %store-directory argument) (shared-library? argument)) ;add library - (cons library-path - (cons argument library-files))) + (list library-path + (cons argument library-files) + (cons argument previous-args))) (else - result))))) - (cons '() '()) + (list library-path + library-files + (cons argument previous-args))))))) + (list '() '() '()) args)) - (match path+files - ((path . files) + (match path+files+args + ((path files arguments) (reverse files)))) (define (rpath-arguments library-files) @@ -202,6 +213,8 @@ impure library ~s~%" (args (append args (rpath-arguments libs)))) (when %debug? (format (current-error-port) + "ld-wrapper: libraries linked: ~s~%" libs) + (format (current-error-port) "ld-wrapper: invoking `~a' with ~s~%" %real-ld args)) (apply execl %real-ld (basename %real-ld) args))) [-- Attachment #3: Type: text/plain, Size: 108 bytes --] Could you check whether it solves the problem? (Tested on x86_64, no regressions AFAICS.) Ludo’. ^ permalink raw reply related [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-08 18:39 ` Ludovic Courtès 2015-04-08 22:33 ` Ludovic Courtès @ 2015-04-09 6:04 ` Mark H Weaver 2015-04-09 6:57 ` Ludovic Courtès 2015-04-09 8:18 ` Ludovic Courtès 1 sibling, 2 replies; 18+ messages in thread From: Mark H Weaver @ 2015-04-09 6:04 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 20102 ludo@gnu.org (Ludovic Courtès) writes: > With a bit of additional debug, I can print the value of ‘libs’ in the > ‘ld-wrapper’ procedure: > > ;;; (libs ("/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3")) > > This one comes from the -dynamic-linker flag, which is not passed on > x86_64. > > I believe this extra -dynamic-linker flag comes from a bogus ‘link’ spec > on ARM, solved by this: > > --- gcc-4.8.4/gcc/config/arm/linux-elf.h.orig 2015-04-08 20:31:20.376900478 +0200 > +++ gcc-4.8.4/gcc/config/arm/linux-elf.h 2015-04-08 20:31:36.437014437 +0200 > @@ -65,7 +65,7 @@ > %{symbolic:-Bsymbolic} \ > %{!static: \ > %{rdynamic:-export-dynamic} \ > - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ > + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ > -X \ > %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ > SUBTARGET_EXTRA_LINK_SPEC > > That way it would match GNU_USER_TARGET_LINK_SPEC in i386/gnu-user.h, > where -dynamic-linker appears within %{!static ... %{!shared ...}}. > > So, could you do: > > (define patched-gcc > (package > (inherit gcc-4.8) > (sources (origin (inherit (package-source gcc-4.8)) > (patches ...))))) > > build it, and then use it in the failed glibc build tree to rebuild > ld.so? Yes, this fixed the problem. I went ahead and pushed 1421afa94a to core-updates to apply this patch to gcc-4.8, gcc-4.9, and cross-gcc. I started both Hydra and my Novena building the new core-updates. Thanks! Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-09 6:04 ` Mark H Weaver @ 2015-04-09 6:57 ` Ludovic Courtès 2015-04-09 8:18 ` Ludovic Courtès 1 sibling, 0 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-04-09 6:57 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102-done Mark H Weaver <mhw@netris.org> skribis: > ludo@gnu.org (Ludovic Courtès) writes: > >> With a bit of additional debug, I can print the value of ‘libs’ in the >> ‘ld-wrapper’ procedure: >> >> ;;; (libs ("/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3")) >> >> This one comes from the -dynamic-linker flag, which is not passed on >> x86_64. >> >> I believe this extra -dynamic-linker flag comes from a bogus ‘link’ spec >> on ARM, solved by this: >> >> --- gcc-4.8.4/gcc/config/arm/linux-elf.h.orig 2015-04-08 20:31:20.376900478 +0200 >> +++ gcc-4.8.4/gcc/config/arm/linux-elf.h 2015-04-08 20:31:36.437014437 +0200 >> @@ -65,7 +65,7 @@ >> %{symbolic:-Bsymbolic} \ >> %{!static: \ >> %{rdynamic:-export-dynamic} \ >> - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ >> + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ >> -X \ >> %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ >> SUBTARGET_EXTRA_LINK_SPEC >> >> That way it would match GNU_USER_TARGET_LINK_SPEC in i386/gnu-user.h, >> where -dynamic-linker appears within %{!static ... %{!shared ...}}. >> >> So, could you do: >> >> (define patched-gcc >> (package >> (inherit gcc-4.8) >> (sources (origin (inherit (package-source gcc-4.8)) >> (patches ...))))) >> >> build it, and then use it in the failed glibc build tree to rebuild >> ld.so? > > Yes, this fixed the problem. I went ahead and pushed 1421afa94a to > core-updates to apply this patch to gcc-4.8, gcc-4.9, and cross-gcc. > > I started both Hydra and my Novena building the new core-updates. Cool, thanks! (There’s a small typo in the comment in the patch: it should be “Don’t pass -dynamic-linker when shared.”) I will push the ld-wrapper fix in the next core-updates cycle then. Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-04-09 6:04 ` Mark H Weaver 2015-04-09 6:57 ` Ludovic Courtès @ 2015-04-09 8:18 ` Ludovic Courtès 1 sibling, 0 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-04-09 8:18 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 Mark H Weaver <mhw@netris.org> skribis: > ludo@gnu.org (Ludovic Courtès) writes: > >> With a bit of additional debug, I can print the value of ‘libs’ in the >> ‘ld-wrapper’ procedure: >> >> ;;; (libs ("/gnu/store/fbdjazgwy3zyx8qc5z4ag0j78k2d7raw-glibc-2.21/lib/ld-linux-armhf.so.3")) >> >> This one comes from the -dynamic-linker flag, which is not passed on >> x86_64. >> >> I believe this extra -dynamic-linker flag comes from a bogus ‘link’ spec >> on ARM, solved by this: >> >> --- gcc-4.8.4/gcc/config/arm/linux-elf.h.orig 2015-04-08 20:31:20.376900478 +0200 >> +++ gcc-4.8.4/gcc/config/arm/linux-elf.h 2015-04-08 20:31:36.437014437 +0200 >> @@ -65,7 +65,7 @@ >> %{symbolic:-Bsymbolic} \ >> %{!static: \ >> %{rdynamic:-export-dynamic} \ >> - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ >> + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ >> -X \ >> %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ >> SUBTARGET_EXTRA_LINK_SPEC >> >> That way it would match GNU_USER_TARGET_LINK_SPEC in i386/gnu-user.h, >> where -dynamic-linker appears within %{!static ... %{!shared ...}}. >> >> So, could you do: >> >> (define patched-gcc >> (package >> (inherit gcc-4.8) >> (sources (origin (inherit (package-source gcc-4.8)) >> (patches ...))))) >> >> build it, and then use it in the failed glibc build tree to rebuild >> ld.so? > > Yes, this fixed the problem. I went ahead and pushed 1421afa94a to > core-updates to apply this patch to gcc-4.8, gcc-4.9, and cross-gcc. I’ve reported the problem at <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65711>. Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-03-13 18:56 bug#20102: Problem with ld.so RUNPATH on armhf Mark H Weaver 2015-04-04 21:58 ` Ludovic Courtès @ 2015-06-13 15:12 ` Mark H Weaver 2015-06-13 23:36 ` Ludovic Courtès 1 sibling, 1 reply; 18+ messages in thread From: Mark H Weaver @ 2015-06-13 15:12 UTC (permalink / raw) To: 20102 In March 2015, Mark H Weaver <mhw@netris.org> wrote: > I recently tried rebuilding Guix on armhf, specifically master since the > recent core-updates merge, and have run into a snag. I'm able to build > a lot of stuff, including our full 'emacs' package (with Gtk+), but I'm > unable to build 'glibc-utf8-locales', which means I can't build any > profiles at all, because the ca-certificates-bundle uses > glibc-utf8-locales. > > Here's what happens when I try to build 'glibc-utf8-locales' manually: > > mhw@novena:~$ guix build -K glibc-utf8-locales > The following derivation will be built: > /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv > warning: failed to install locale: Invalid argument > @ build-started /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv - armhf-linux /var/log/guix/drvs/14//kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv.bz2 > Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! > note: keeping build directory `/tmp/nix-build-glibc-utf8-locales-2.21.drv-0' > builder for `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed with exit code 1 > @ build-failed /gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv - 1 builder for `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed with exit code 1 > killing process 1498 > guix build: error: build failed: build of `/gnu/store/14kf28i9qkzrdjn5m150zk6dxijssk2k-glibc-utf8-locales-2.21.drv' failed > > The key line being: > > Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! The same problem has resurfaced on armhf on the current core-updates branch. More precisely, this is a merge of core-updates (16cae79), master (1e44cf8), and openssl-update (0515580). There's one difference: I can successfully run "guix build -K glibc-utf8-locales", but if I try to build any profile, it fails while building another package named "glibc-utf8-locales", with precisely the same error message above. Otherwise, I managed to build every package in my profile, which includes some substantial software. I'm surprised because I thought we already fixed this in two redundant ways: by improving 'ld-wrapper' to avoid adding an '-rpath' for ld.so, and by patching gcc. I would have expected at least one of those fixes to take care of this. Should I open a new ticket for this, or should we reuse this ticket? For now, I unarchived and reopened this bug. Thanks, Mark ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-06-13 15:12 ` Mark H Weaver @ 2015-06-13 23:36 ` Ludovic Courtès 2015-07-14 13:32 ` Ludovic Courtès 0 siblings, 1 reply; 18+ messages in thread From: Ludovic Courtès @ 2015-06-13 23:36 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102 [-- Attachment #1: Type: text/plain, Size: 2016 bytes --] Mark H Weaver <mhw@netris.org> skribis: > In March 2015, Mark H Weaver <mhw@netris.org> wrote: [...] >> Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! > > The same problem has resurfaced on armhf on the current core-updates > branch. More precisely, this is a merge of core-updates (16cae79), > master (1e44cf8), and openssl-update (0515580). > > There's one difference: I can successfully run "guix build -K > glibc-utf8-locales", but if I try to build any profile, it fails while > building another package named "glibc-utf8-locales", with precisely the > same error message above. Otherwise, I managed to build every package > in my profile, which includes some substantial software. It happens on x86_64 as well. Namely, the glibc that is built with glibc-final and gcc-final has extra RUNPATH entries: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build -e '(@ (gnu packages base) glibc)' -K [...] /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21 /gnu/store/m3qidd4gx7ry3wxagsrd9cwlykq90yi7-glibc-2.21-debug $ /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gencat Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! $ objdump -x /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gencat |grep PATH RUNPATH /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2 --8<---------------cut here---------------end--------------->8--- After a bit of investigation, I found that the problem came from: -plugin /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/liblto_plugin.so.0 which led ld-wrapper to add a -rpath flag for that directory. I’m testing the patch below and will commit tomorrow if everything goes well. Thanks, Ludo’. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 1236 bytes --] --- a/gnu/packages/ld-wrapper.in +++ b/gnu/packages/ld-wrapper.in @@ -143,12 +143,16 @@ exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)) (define path+files+args (fold (lambda (argument result) (match result - ((library-path library-files ("-dynamic-linker" . rest)) - ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'. - ;; See <http://bugs.gnu.org/20102>. + ((library-path library-files + ((and flag + (or "-dynamic-linker" "-plugin")) + . rest)) + ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'; when + ;; passed '-plugin liblto_plugin.so', ignore + ;; 'liblto_plugin.so'. See <http://bugs.gnu.org/20102>. (list library-path library-files - (cons* argument "-dynamic-linker" rest))) + (cons* argument flag rest))) ((library-path library-files previous-args) (cond ((string-prefix? "-L" argument) ;augment the search path (list (append library-path ^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#20102: Problem with ld.so RUNPATH on armhf 2015-06-13 23:36 ` Ludovic Courtès @ 2015-07-14 13:32 ` Ludovic Courtès 0 siblings, 0 replies; 18+ messages in thread From: Ludovic Courtès @ 2015-07-14 13:32 UTC (permalink / raw) To: Mark H Weaver; +Cc: 20102-done ludo@gnu.org (Ludovic Courtès) skribis: > It happens on x86_64 as well. Namely, the glibc that is built with > glibc-final and gcc-final has extra RUNPATH entries: > > $ ./pre-inst-env guix build -e '(@ (gnu packages base) glibc)' -K > [...] > /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21 > /gnu/store/m3qidd4gx7ry3wxagsrd9cwlykq90yi7-glibc-2.21-debug > $ /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gencat > Inconsistency detected by ld.so: get-dynamic-info.h: 142: elf_get_dynamic_info: Assertion `info[29] == ((void *)0)' failed! > $ objdump -x /gnu/store/pxi61vv6qj325y3zs5qpcy2shykgxdar-glibc-2.21/bin/gencat |grep PATH > RUNPATH /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2 > > After a bit of investigation, I found that the problem came from: > > -plugin /gnu/store/2bq2qaaajar2f3dbxrrwssxfrfi0k9zr-gcc-4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/liblto_plugin.so.0 > > which led ld-wrapper to add a -rpath flag for that directory. > > I’m testing the patch below and will commit tomorrow if everything goes > well. The patch was applied as b5616bc a while back, so I’m closing this bug. Ludo’. ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2015-07-14 13:33 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-13 18:56 bug#20102: Problem with ld.so RUNPATH on armhf Mark H Weaver 2015-04-04 21:58 ` Ludovic Courtès 2015-04-05 4:42 ` Mark H Weaver 2015-04-06 20:24 ` Ludovic Courtès 2015-04-06 21:02 ` Mark H Weaver 2015-04-08 9:52 ` Ludovic Courtès 2015-04-08 15:21 ` Mark H Weaver 2015-04-08 15:26 ` Mark H Weaver 2015-04-08 15:48 ` Ludovic Courtès 2015-04-08 15:50 ` Mark H Weaver 2015-04-08 18:39 ` Ludovic Courtès 2015-04-08 22:33 ` Ludovic Courtès 2015-04-09 6:04 ` Mark H Weaver 2015-04-09 6:57 ` Ludovic Courtès 2015-04-09 8:18 ` Ludovic Courtès 2015-06-13 15:12 ` Mark H Weaver 2015-06-13 23:36 ` Ludovic Courtès 2015-07-14 13:32 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/guix.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).