FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-08-2010, 10:10 PM
Nikos Chantziaras
 
Default How does Gentoo deal with GCC's header fixes?

When building GCC, it will scan all headers in /usr/include and apply
fixes to them, and then copy them and use the modified versions. Now a
binary distro (AFAIK) will ship the GCC modified headers, so there's no
problem.


Gentoo on the other hand will work as intended by GCC only if the user
re-emerges GCC after every time a package is emerged that installs
headers. Obviously, no user does that.


So the question is simple; does Gentoo deal with this problem in any way?
 
Old 09-09-2010, 03:00 PM
walt
 
Default How does Gentoo deal with GCC's header fixes?

On 09/08/2010 03:10 PM, Nikos Chantziaras wrote:

When building GCC, it will scan all headers in /usr/include and apply fixes to them, and then copy them and use the modified versions. Now a binary distro (AFAIK) will ship the GCC modified headers, so there's no problem.

Gentoo on the other hand will work as intended by GCC only if the user re-emerges GCC after every time a package is emerged that installs headers. Obviously, no user does that.

So the question is simple; does Gentoo deal with this problem in any way?


Maybe I misunderstand your question, but AFAIK the only reason to re-compile any
package is if the libraries it links to have changed, no?

AFAICS gcc links only to libraries installed by glibc. therefore in the case of
recompiling gcc itself, it should need/use only the headers installed by glibc.

(And the only reason to re-compile an existing glibc is if the linux kernel headers
change. I always re-compile glibc when the linux kernel headers change, but I
never thought about re-compiling gcc as well. Maybe I should.)

Corrections are requested if I'm wrong about all of this.
 
Old 09-09-2010, 03:18 PM
Nikos Chantziaras
 
Default How does Gentoo deal with GCC's header fixes?

On 09/09/2010 06:00 PM, walt wrote:

On 09/08/2010 03:10 PM, Nikos Chantziaras wrote:

When building GCC, it will scan all headers in /usr/include and apply
fixes to them, and then copy them and use the modified versions. Now a
binary distro (AFAIK) will ship the GCC modified headers, so there's
no problem.

Gentoo on the other hand will work as intended by GCC only if the user
re-emerges GCC after every time a package is emerged that installs
headers. Obviously, no user does that.

So the question is simple; does Gentoo deal with this problem in any way?


Maybe I misunderstand your question, but AFAIK the only reason to
re-compile any
package is if the libraries it links to have changed, no?


No, mostly the main reason is when updates are available. And in Gentoo
this always means building from source.




AFAICS gcc links only to libraries installed by glibc. therefore in the
case of
recompiling gcc itself, it should need/use only the headers installed by
glibc.


Yeah, you misunderstood the question ;-) GCC applies changes to header
files in /usr/include. Lets say to ncurses.h. When you then update
ncurses, a new header is installed in /usr/include, but GCC only has the
modified version of it from the previous version:


http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Fixed-Headers.html

Of course it could be me who doesn't really understand what's going on
here though.
 
Old 09-09-2010, 04:26 PM
Volker Armin Hemmann
 
Default How does Gentoo deal with GCC's header fixes?

On Thursday 09 September 2010, walt wrote:
> On 09/08/2010 03:10 PM, Nikos Chantziaras wrote:
> > When building GCC, it will scan all headers in /usr/include and apply
> > fixes to them, and then copy them and use the modified versions. Now a
> > binary distro (AFAIK) will ship the GCC modified headers, so there's no
> > problem.
> >
> > Gentoo on the other hand will work as intended by GCC only if the user
> > re-emerges GCC after every time a package is emerged that installs
> > headers. Obviously, no user does that.
> >
> > So the question is simple; does Gentoo deal with this problem in any way?
>
> Maybe I misunderstand your question, but AFAIK the only reason to
> re-compile any package is if the libraries it links to have changed, no?
>
> AFAICS gcc links only to libraries installed by glibc. therefore in the
> case of recompiling gcc itself, it should need/use only the headers
> installed by glibc.
>
> (And the only reason to re-compile an existing glibc is if the linux kernel
> headers change. I always re-compile glibc when the linux kernel headers
> change, but I never thought about re-compiling gcc as well. Maybe I
> should.)
>
> Corrections are requested if I'm wrong about all of this.

hm, I never recompile glibc after a header update.... or anything else....
 
Old 09-09-2010, 07:17 PM
Alan McKinnon
 
Default How does Gentoo deal with GCC's header fixes?

Apparently, though unproven, at 18:26 on Thursday 09 September 2010, Volker
Armin Hemmann did opine thusly:

> On Thursday 09 September 2010, walt wrote:
> > On 09/08/2010 03:10 PM, Nikos Chantziaras wrote:
> > > When building GCC, it will scan all headers in /usr/include and apply
> > > fixes to them, and then copy them and use the modified versions. Now a
> > > binary distro (AFAIK) will ship the GCC modified headers, so there's no
> > > problem.
> > >
> > > Gentoo on the other hand will work as intended by GCC only if the user
> > > re-emerges GCC after every time a package is emerged that installs
> > > headers. Obviously, no user does that.
> > >
> > > So the question is simple; does Gentoo deal with this problem in any
> > > way?
> >
> > Maybe I misunderstand your question, but AFAIK the only reason to
> > re-compile any package is if the libraries it links to have changed, no?
> >
> > AFAICS gcc links only to libraries installed by glibc. therefore in the
> > case of recompiling gcc itself, it should need/use only the headers
> > installed by glibc.
> >
> > (And the only reason to re-compile an existing glibc is if the linux
> > kernel headers change. I always re-compile glibc when the linux kernel
> > headers change, but I never thought about re-compiling gcc as well.
> > Maybe I should.)
> >
> > Corrections are requested if I'm wrong about all of this.
>
> hm, I never recompile glibc after a header update.... or anything else....


Me neither :-)

I know I should, and why. But don't.

I think the glibc and toolchain devs think the same way and go to
extraordinary lengths to make sure stuff still works no matter hwo you go
about it.



--
alan dot mckinnon at gmail dot com
 
Old 09-09-2010, 08:05 PM
walt
 
Default How does Gentoo deal with GCC's header fixes?

On 09/09/2010 09:26 AM, Volker Armin Hemmann wrote:

On Thursday 09 September 2010, walt wrote:



And the only reason to re-compile an existing glibc is if the linux kernel
headers change. I always re-compile glibc when the linux kernel headers
change...


hm, I never recompile glibc after a header update.... or anything else....


I never did either until recently, when I started playing with vbox from
its svn repository in addition to tracking the latest from Linus.git.

Until then I had no idea how often the kernel devs break things by changing
kernel data structures and system calls without notice.

That's significant for projects like vbox because they (apparently) use
kernel services directly without going through libc like everybody else.

I'm assuming that's true because the vbox code insists on using the kernel
headers from the kernel that is actually running at the time. (Hence, the
vbox code breaks every time Linus changes something important.)

User space programs aren't supposed to poke at the kernel directly (unlike
the vbox kernel module) but go through libc to use kernel services.

So, how to avoid breaking glibc with every new kernel update?

The solution, for better or worse, has been to maintain an independent set
of kernel headers that change only when new kernel user-space features are
added or obsolete ones deleted -- not very often -- and those are provided
to user-space programs through libc.

So, I'm *assuming* that gentoo devs release an update for the kernel-headers
package when some user-space kernel service has been added or deleted.
(Device drivers and other kernel modules get broken much more often than
that.)

If my assumption is correct, then programs linked against libc (lots) won't
actually see the changes until libc is re-compiled against the new headers.

And, most of the time it doesn't matter because existing programs aren't
using any brand-new kernel services (yet).

Corrections are welcome, as always.
 
Old 09-09-2010, 09:29 PM
Neil Bothwick
 
Default How does Gentoo deal with GCC's header fixes?

On Thu, 9 Sep 2010 21:17:52 +0200, Alan McKinnon wrote:

> > hm, I never recompile glibc after a header update.... or anything
> > else....
>
>
> Me neither :-)
>
> I know I should, and why. But don't.
>
> I think the glibc and toolchain devs think the same way and go to
> extraordinary lengths to make sure stuff still works no matter hwo you
> go about it.

The elog message says nothing about anything stopping working.

Kernel headers are usually only used when recompiling your system libc, as
such, following the installation of newer headers, it is advised that you
re-merge your system libc.
Failure to do so will cause your system libc to not make use of newer
features present in the updated kernel headers.

So your system may not be quite as good as it could be if you don't
recompile glibc. My view is that it does no harm to recompile it and, all
else being equal, I prefer to follow the advice from the devs.


--
Neil Bothwick

Sleep is an excellent way of listening to an opera. - James Stephens
 
Old 09-09-2010, 11:48 PM
Nikos Chantziaras
 
Default How does Gentoo deal with GCC's header fixes?

On 09/09/2010 10:17 PM, Alan McKinnon wrote:

Apparently, though unproven, at 18:26 on Thursday 09 September 2010, Volker
Armin Hemmann did opine thusly:


On Thursday 09 September 2010, walt wrote:

On 09/08/2010 03:10 PM, Nikos Chantziaras wrote:

When building GCC, it will scan all headers in /usr/include and apply
fixes to them, and then copy them and use the modified versions. Now a
binary distro (AFAIK) will ship the GCC modified headers, so there's no
problem.

Gentoo on the other hand will work as intended by GCC only if the user
re-emerges GCC after every time a package is emerged that installs
headers. Obviously, no user does that.

So the question is simple; does Gentoo deal with this problem in any
way?


Maybe I misunderstand your question, but AFAIK the only reason to
re-compile any package is if the libraries it links to have changed, no?

AFAICS gcc links only to libraries installed by glibc. therefore in the
case of recompiling gcc itself, it should need/use only the headers
installed by glibc.

(And the only reason to re-compile an existing glibc is if the linux
kernel headers change. I always re-compile glibc when the linux kernel
headers change, but I never thought about re-compiling gcc as well.
Maybe I should.)

Corrections are requested if I'm wrong about all of this.


hm, I never recompile glibc after a header update.... or anything else....



Me neither :-)

I know I should, and why. But don't.


Just want to point out that this was about GCC's fixed headers, not
glibc, which makes it off-topic and completely unrelated to the original
topic
 
Old 09-10-2010, 12:56 AM
walt
 
Default How does Gentoo deal with GCC's header fixes?

On 09/09/2010 04:48 PM, Nikos Chantziaras wrote:


Just want to point out that this was about GCC's fixed headers, not glibc, which makes it off-topic and completely unrelated to the original topic


Huh? Who are you? Oh, wait, this was your thread. Sorry, I forgot about you

The first sentence from the link you posted:

GCC needs to install corrected versions of some system header files.

I'm supposing (being the exspurt I am) that 'system header files' refers to
the linux-kernel-header files. I say that because the long-standing *ix
tradition is to equate the word 'system' (or 'sys') with the kernel or its
source code.

Come to think of it, I'm really speaking of the BSD world, where /usr/src/sys
is where the kernel code lives, unlike /usr/src/linux.

In other words, I'm just guessing.

Next expert..?
 
Old 09-10-2010, 04:47 AM
Volker Armin Hemmann
 
Default How does Gentoo deal with GCC's header fixes?

On Thursday 09 September 2010, walt wrote:
> On 09/09/2010 09:26 AM, Volker Armin Hemmann wrote:
> > On Thursday 09 September 2010, walt wrote:
> >> And the only reason to re-compile an existing glibc is if the linux
> >> kernel headers change. I always re-compile glibc when the linux kernel
> >> headers change...
> >
> > hm, I never recompile glibc after a header update.... or anything
> > else....
>
> I never did either until recently, when I started playing with vbox from
> its svn repository in addition to tracking the latest from Linus.git.
>
> Until then I had no idea how often the kernel devs break things by changing
> kernel data structures and system calls without notice.

system calls are never changed.
And kernel structures are irrelevant for userspace.

So if you don't use any modules, you don't have to recompile anything.
In fact, glibc's own header set are derived from some very acient kernel
headers.
 

Thread Tools




All times are GMT. The time now is 09:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org