I would love to be able to change GLIBC_DYNAMIC_LINKER to something other than default without changing the source code. This is useful if you want to create a completly standalone toolchain with binutils, gcc and some kind of libc.
I see now that the google gcc branch is having this kind of ability. Any plans of integrating them?
Just use -Wl,-dynamic-linker=/whatever/ld.so or you could use --with-specs configure option.
I could, but is not a sexy(*) as --with-runtime-root-prefix :-) *) http://patchwork.ozlabs.org/patch/80538/
(In reply to Jakub Jelinek from comment #2) > Just use -Wl,-dynamic-linker=/whatever/ld.so -Wl,-dynamic-linker=/whatever/ld.so cannot be set permanently. It requires a wrapper to inject such argument all the time, which is ugly. > or you could use --with-specs configure option. Builtin specs of GCC is already very complicated (output from gcc-4.7.3 -dumpspecs on amd64): ... *link: %{!static:--eh-frame-hdr} %{m32|mx32:;:-m elf_x86_64} %{m32:-m elf_i386} %{mx32:-m elf32_x86_64} %{shared:-shared} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{m32:-dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:/lib/ld-linux.so.2}}} %{m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/lib64/ld-linux-x86-64.so.2}}} %{mx32:-dynamic-linker %{muclibc:/lib/ldx32-uClibc.so.0;:%{mbionic:/system/bin/linkerx32;:/libx32/ld-linux-x32.so.2}}}} %{static:-static}} ... writing an equivalent specs with prefixed dynamic linker is horrible. Please consider sopport dynamic linker prefix by an extra configure option.
Dear Jakub, I find your comment misleading for the --with-specs option. It sets CONFIGURE_SPECS macro, which is used in gcc.c as static const char *const driver_self_specs[] = { "%{fdump-final-insns:-fdump-final-insns=.} %<fdump-final-insns", DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS }; so it is a list of specs for the driver *itself*, should not be used to specify link spec. If you mean passing --with-specs="-Wl,-dynamic-linker=/whatever/ld.so" to configure, it is broken in multilib cases. Therefore we lack of a convenient way to specify a default alternative location of the dynamic linker. Benda
Richard Biener mentioned that Red Hat has "a local patch that allows amending link_spec from an external file, which would sound more flexible" here: http://patchwork.ozlabs.org/patch/80538/ It's not completely clear whether it applies to this case, however; he mentioned that it could be used to produce the equivalent of a -Wl,-rpath=... option. The Google-branch change that Christer mentions adds a -dynamic-linker=... option to the link spec rather than an -rpath option -- I would guess that the patch Richard mentions could cover that as well, but I'm not sure.
*** Bug 111084 has been marked as a duplicate of this bug. ***