This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Extending --with-advance-toolchain to aarch64


Steve Ellcey <sellcey@marvell.com> writes:

> I have a question about building a toolchain that uses (at run time) a
> dynamic linker and system libraries and headers that are in a non-standard
> place.
>
> I just noticed the IBM --with-advance-toolchain option and I would
> like to replicate it for aarch64.
>
> Let me first describe what I do now:
>
> configure/build BINUTILS with --prefix=${X} --with-sysroot=${X}
> configure/build an initial GCC (all-gcc all-target-libgcc) with
> 	--prefix=${X} --with-sysroot=${X}
> configure/build GLIBC, using that GCC, with --prefix=/usr,
> 	followed by install with DESTDIR=${X}

Can you use --prefix=${X}?

> configure/build final GCC with --prefix=${X} --with-sysroot=${X}
>
> This all works, but if I want my executables to find the shared libraries and
> dynamic linker from ${X} when they are running, I need to compile things with:
>
>    -Wl,--rpath=${X}/lib64 -Wl,--dynamic-linker=${X}/lib/ld-linux-aarch64.so.1

If you set glibc's --prefix to ${X}, I don't think you need to set --rpath too.
I have plans to work on a patch for the Advance Toolchain in order to avoid
this.

> I would like these used by default so I took some ideas from
> --with-advance-toolchain and used that to automatically add these options
> to LINK_SPEC (see attached patch).  I can compile and link a program with
> this setup, but when I run the program I get:
>
> % ./x
> Inconsistency detected by ld.so: get-dynamic-info.h: 147: elf_get_dynamic_info: 
> Assertion `info[DT_RPATH] == NULL' failed!

Florian already explained why glibc has this test.
But the Advance Toolchain carries the following patch:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=9ca2648e2aa7094e022d5150281b2575f866259f

-- 
Tulio Magno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]