public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Aw: Re: How to compile gcc toolchain with special sysroot correctly?
@ 2013-11-27 15:17 Johannes Lorenz
  2013-11-27 19:10 ` Andrew Haley
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Lorenz @ 2013-11-27 15:17 UTC (permalink / raw)
  To: gcc-help; +Cc: Andrew Haley, Kai Ruottu

@Andrew:

I copied these crt*.o libraries, but now, it complains that it is missing stdio.h. I really guess it would be better to link to the whole old glibc. Is there any good trick to tell gcc: Search in your sysroot, but if you can not find it, try in "/usr/include" ? (somehow the opposite of "-I")

@Kai:

> Are you trying to build the target Linux system from scratch?  The 
> produced glibc runtime parts (shared
> libs) being installed onto the originally unexisting target system? If 
> not then your goal is "conceptually
> wrong"

I don't know what you mean, but I am trying to install glibc to another "root" on the same target system. I have gcc 4.4, but want to have 4.7 (on the same target), so I tried to compile a new toolchain in ~/local, using my gcc 4.4.

> In a simple Ubuntu 12.04 to OpenSuSE 12.2 cross compiler case using a 
> sysroot'ed glibc for the target system
> one of course would produce only the target binutils and the target GCC 
> for the $host (that usually being a
> totally different arch, different CPU, and system, for instance 
> Solaris2.10).

Ok, I don't want to compile to a different target. I only mentioned openSuSE to say that the versions of binutils, gcc and glibc work on "some system". But I just want to compile on $host for $host ;) Both are Ubuntu.

> If this isn't clear then one should ask : "Do people REALLY 
> replace the target C library in native
> binutils and GCC builds?"  It would sound "sane" to rebuild the system 
> glibc with the updated binutils and
> GCC afterwards, they are newer and should produce a better and quicker C 
> library, or how?  But please
> believe me, the native binutils and GCC builders don't try to replace 
> the target C library in '/lib*', '/usr/lib*',
> '/usr/include' etc. Neither all the X11 libraries in the system!  So why 
> on earth any cross GCC builder would
> do that if all the target libraries are already there, prebuilt and tested?

So you'd say, unlike Andrew, that I should not compile a new glibc. I need a new libstdc++, I hope this will be compatible with the old glibc. But if I really want to compile a new glibc, you think this is impossible/very difficult?

Thanks and regards,
Johannes
-- 
Diese E-Mail wurde aus dem Sicherheitsverbund E-Mail made in
Germany versendet: http://www.gmx.net/e-mail-made-in-germany

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

* Re: Aw: Re: How to compile gcc toolchain with special sysroot correctly?
  2013-11-27 15:17 Aw: Re: How to compile gcc toolchain with special sysroot correctly? Johannes Lorenz
@ 2013-11-27 19:10 ` Andrew Haley
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2013-11-27 19:10 UTC (permalink / raw)
  To: Johannes Lorenz; +Cc: gcc-help, Kai Ruottu

On 11/27/2013 01:57 PM, Johannes Lorenz wrote:

> So you'd say, unlike Andrew, that I should not compile a new
> glibc. I need a new libstdc++, I hope this will be compatible with
> the old glibc.

I expect so.

> But if I really want to compile a new glibc, you think this is
> impossible/very difficult?

I didn't say that you should compile a new glibc.  I assumed that was
your goal.  It is an eccentric thing to be doing.

Andrew.


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

* Re: Aw: Re: How to compile gcc toolchain with special sysroot correctly?
@ 2013-12-01  8:27 Johannes Lorenz
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Lorenz @ 2013-12-01  8:27 UTC (permalink / raw)
  To: gcc-help; +Cc: Andrew Haley

> Just configure, build, and install
> GCC, and programs will use its libraries.  You might need to use
> ldconfig to configure the system to use the new libaries, but this
> needs to be done with great care.  It's better to set a default
> LD_LIBRARY_PATH.

It indeed work to just use a new gcc. When compiling, it took the new libraries instead of the old ones. Compiler flags were indeed not necessary. It was sufficient to just set the LD_LIBRARY_PATH on every execution.

Thanks for the good and fast support.
-- 
Diese E-Mail wurde aus dem Sicherheitsverbund E-Mail made in
Germany versendet: http://www.gmx.net/e-mail-made-in-germany

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

* Re: Aw: Re: How to compile gcc toolchain with special sysroot correctly?
@ 2013-11-28  9:36 Johannes Lorenz
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Lorenz @ 2013-11-28  9:36 UTC (permalink / raw)
  To: gcc-help; +Cc: Andrew Haley

> I didn't say that you should compile a new glibc.  I assumed that was
> your goal.  It is an eccentric thing to be doing.

Ok, so one possibility would be to use a new gcc + ld on an old glibc, correct?

What would be the correct way to do that? If a library is found in the local installation, it was from our gcc (e.g.: ~/local/lib/gcc...), so we use it, but if it was not found, get it from the system, i.e. /usr/lib. The same for the headers. How to tell gcc to behave like that? A combination of "--sysroot" and "-L" does not seem to do the job, I think.

Many thanks on advance.

-- 
Diese E-Mail wurde aus dem Sicherheitsverbund E-Mail made in
Germany versendet: http://www.gmx.net/e-mail-made-in-germany

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

* Re: Aw: Re: How to compile gcc toolchain with special sysroot correctly?
  2013-11-27 10:02   ` Aw: " Johannes Lorenz
@ 2013-11-27 11:35     ` Andrew Haley
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2013-11-27 11:35 UTC (permalink / raw)
  To: Johannes Lorenz; +Cc: gcc-help

On 11/27/2013 09:10 AM, Johannes Lorenz wrote:
>>> However, this displays no files:
>>>
>>>     find ~/local -name crti.o
>>
>> So you have to populate your sysroot with with some files and headers.
>> crti.o is part of glibc.
> 
> Ok, but the problem occured when I tried to compile glibc (it was missing it when I configured it). Do you mean I require an old glibc to compile a new one?

Yes, you do, because the configure tests are trying to link a program.
That isn't going to work unless there is a C library.

Some circularity can't be avoided.

Andrew.


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

* Aw: Re: How to compile gcc toolchain with special sysroot correctly?
  2013-11-27  9:11 ` Andrew Haley
@ 2013-11-27 10:02   ` Johannes Lorenz
  2013-11-27 11:35     ` Andrew Haley
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Lorenz @ 2013-11-27 10:02 UTC (permalink / raw)
  To: gcc-help; +Cc: Andrew Haley

> > However, this displays no files:
> > 
> >     find ~/local -name crti.o
> 
> So you have to populate your sysroot with with some files and headers.
> crti.o is part of glibc.

Ok, but the problem occured when I tried to compile glibc (it was missing it when I configured it). Do you mean I require an old glibc to compile a new one?

-- 
Diese E-Mail wurde aus dem Sicherheitsverbund E-Mail made in
Germany versendet: http://www.gmx.net/e-mail-made-in-germany

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

end of thread, other threads:[~2013-12-01  8:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-27 15:17 Aw: Re: How to compile gcc toolchain with special sysroot correctly? Johannes Lorenz
2013-11-27 19:10 ` Andrew Haley
  -- strict thread matches above, loose matches on Subject: below --
2013-12-01  8:27 Johannes Lorenz
2013-11-28  9:36 Johannes Lorenz
2013-11-27  9:07 Johannes Lorenz
2013-11-27  9:11 ` Andrew Haley
2013-11-27 10:02   ` Aw: " Johannes Lorenz
2013-11-27 11:35     ` Andrew Haley

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