public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* native compiler linked to another glibc
@ 2021-12-25  2:20 Bill Cunningham
  2021-12-27 22:36 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Cunningham @ 2021-12-25  2:20 UTC (permalink / raw)
  To: gcc-help

I have a different binutils and gcc that works fine and is connected to 
the system libc. Whew, that's the important thing.

     I compile a newer glibc and save it in a a path in /mnt. The 
problems I seem to be running into I believe are addressed in that FAQs, 
at least in a similar form. I compile, or try to, a native compiler that 
will be attached to the new glibc (not the system glibc).

/source/gcc/configure --prefix=/mnt --disable-bootsrap 
--disable-multilib --disable-nls --enable-languages=c,c++ \

--with-build-time-tools=/mnt/bin CC=/mnt/old-gcc/bin/gcc 
CXX=/mnt/old-gcc/bin/g++

The binutils are in the /mnt/bin. I set '--with-build-time-tools' for 
the binutils. Compilation goes for some time and the compilation wants 
the newer includes from the new glibc. Now the path the compiler seems 
to want to look at is '/usr'bin'. For the linker. '/usr/bin/ld'. I don't 
want it to look there. And there is a complaint that /mnt/lib does not 
contain libc.a not lib_nonshared.a and another statically created 
library. I have not used the '--disable-shared' switch nor it opposite. 
Those libraries are also there. IDK why the compiler can't find 
libraries that are there unless there are links that are not set right. 
And why is it running the system ld and not the test compiler's 'ld'. Hum.

Also' /lib/cpp isn't found', it is in /bin/cpp. It needs to also be in 
/lib, so I will set a link next time. But why is the system linker in 
'/usr/bin/ld' being used and not '/mnt/bin/ld'?

B



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

* Re: native compiler linked to another glibc
  2021-12-25  2:20 native compiler linked to another glibc Bill Cunningham
@ 2021-12-27 22:36 ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2021-12-27 22:36 UTC (permalink / raw)
  To: Bill Cunningham; +Cc: gcc-help

On Fri, Dec 24, 2021 at 6:20 PM Bill Cunningham via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

>      I compile a newer glibc and save it in a a path in /mnt. The
> problems I seem to be running into I believe are addressed in that FAQs,
> at least in a similar form. I compile, or try to, a native compiler that
> will be attached to the new glibc (not the system glibc).
>

Adding a -v option to a gcc command will show what is happening inside the
gcc driver, and might give a clue as to what is going on.

Using your own glibc which is not installed in the normal location is
complicated.  I would suggest looking at
    https://sourceware.org/glibc/wiki/Testing/Builds#Testing_a_glibc_build

Note that some glibc libraries are actually linker scripts, and may have
references to /usr embedded in them.  This is why the glibc wiki recommends
using sysroot to point at the new glibc.

Jim

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

end of thread, other threads:[~2021-12-27 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-25  2:20 native compiler linked to another glibc Bill Cunningham
2021-12-27 22:36 ` Jim Wilson

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