public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/111084] New: Support configurable dynamic linker path
@ 2023-08-20 21:09 hdante at gmail dot com
  2023-08-20 21:13 ` [Bug driver/111084] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hdante at gmail dot com @ 2023-08-20 21:09 UTC (permalink / raw)
  To: gcc-bugs

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,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
@ 2023-08-20 21:13 ` pinskia at gcc dot gnu.org
  2023-08-20 21:15 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-20 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2023-08-20

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Why do you want to modify the location of the dynamic loader since it is fixed
by the ABI?

If you have a different ABI, you should just have a new config target instead
or use sysroots/chroots to run the new programs.

The way Linux from scratch is handling this is most likely just broken.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
  2023-08-20 21:13 ` [Bug driver/111084] " pinskia at gcc dot gnu.org
@ 2023-08-20 21:15 ` pinskia at gcc dot gnu.org
  2023-08-20 21:36 ` hdante at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-20 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 52556 anyways.

*** This bug has been marked as a duplicate of bug 52556 ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
  2023-08-20 21:13 ` [Bug driver/111084] " pinskia at gcc dot gnu.org
  2023-08-20 21:15 ` pinskia at gcc dot gnu.org
@ 2023-08-20 21:36 ` hdante at gmail dot com
  2023-08-21  2:15 ` xry111 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hdante at gmail dot com @ 2023-08-20 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Henrique <hdante at gmail dot com> ---
Hello, the reason is that linux from scratch bootstraps an initial toolchain
decoupled from the host toolchain before installing the final system. The final
installation will use the correct paths. The initial toolchain, however, uses a
separate directory. The procedure is not broken, it's actually pretty clean and
not specific to linux from scratch, other toolchain builders will do the same
thing (IIRC buildroot).

Is it possible to have a configure flag for changing the dynamic linker root ?

Thanks,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
                   ` (2 preceding siblings ...)
  2023-08-20 21:36 ` hdante at gmail dot com
@ 2023-08-21  2:15 ` xry111 at gcc dot gnu.org
  2023-08-21  2:17 ` pinskia at gcc dot gnu.org
  2023-08-21  2:22 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-08-21  2:15 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Henrique from comment #3)
> Hello, the reason is that linux from scratch bootstraps an initial toolchain
> decoupled from the host toolchain before installing the final system. The
> final installation will use the correct paths. The initial toolchain,
> however, uses a separate directory. The procedure is not broken, it's
> actually pretty clean and not specific to linux from scratch, other
> toolchain builders will do the same thing (IIRC buildroot).

It's not clean and it had caused a lot of troubles.  Linux From Scratch has
switched away from this approach years ago.

If you must stay with this bad approach then fine, but do not refer it as Linux
From Scratch because doing so will mislead people.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
                   ` (3 preceding siblings ...)
  2023-08-21  2:15 ` xry111 at gcc dot gnu.org
@ 2023-08-21  2:17 ` pinskia at gcc dot gnu.org
  2023-08-21  2:22 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-21  2:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also buildroot uses sysroots and chroot/containers instead.

Containers/chroot is the better approach anyways.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug driver/111084] Support configurable dynamic linker path
  2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
                   ` (4 preceding siblings ...)
  2023-08-21  2:17 ` pinskia at gcc dot gnu.org
@ 2023-08-21  2:22 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-08-21  2:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> Also buildroot uses sysroots and chroot/containers instead.
> 
> Containers/chroot is the better approach anyways.

We use sysroot and chroot since Linux From Scratch 10.0 (released Sept 2020).

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-21  2:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-20 21:09 [Bug driver/111084] New: Support configurable dynamic linker path hdante at gmail dot com
2023-08-20 21:13 ` [Bug driver/111084] " pinskia at gcc dot gnu.org
2023-08-20 21:15 ` pinskia at gcc dot gnu.org
2023-08-20 21:36 ` hdante at gmail dot com
2023-08-21  2:15 ` xry111 at gcc dot gnu.org
2023-08-21  2:17 ` pinskia at gcc dot gnu.org
2023-08-21  2:22 ` xry111 at gcc dot gnu.org

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).