https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111084

            Bug ID: 111084
           Summary: Support configurable dynamic linker path
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hdante at gmail dot com
  Target Milestone: ---

Hello, it's not possible, currently, to set the dynamic linker root path when
building gcc. The current workaround is to modify the source code and/or spec
file, as shown, for example, by the "linux from scratch" scripts, when
compiling a toolchain rooted at /tools:

    ## Change the location of GCC's default dynamic linker to use the one
installed in /tools
    #
    # For i686/x86_64:
    for file in gcc/config/{linux,i386/linux{,64}}.h
    do
      cp -uv $file{,.orig}
      sed -e 's/\/lib\(64\)\?\(32\)\?\/ld/\/tools&/g' \
          -e 's/\/usr/\/tools/g' ${file}.orig > ${file}
      echo '
    #undef STANDARD_STARTFILE_PREFIX_1
    #undef STANDARD_STARTFILE_PREFIX_2
    #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
    #define STANDARD_STARTFILE_PREFIX_2 ""' >> ${file}
      touch ${file}.orig
    done

(...)

    case $(uname -m) in
       i686)   # for i386
               sed -i
's/\/lib\/ld-musl-i386.so.1/\/tools\/lib\/ld-musl-i386.so.1/g' tempspecfile
               # check with sed
               grep "/tools/lib/ld-musl-i386.so.1" tempspecfile  --color=auto
               ;;

(etc.)

Can you add a configuration parameter to support changing the dynamic linker
root path ?

Thanks,

Reply via email to