Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 30701 - GCC's "fixed" headers break compilation of many packages when they are used instead of other updated headers
Summary: GCC's "fixed" headers break compilation of many packages when they are used i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: Highest critical (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
: 31338 32565 36020 38748 38829 38935 38985 39840 39866 40338 (view as bug list)
Depends on:
Blocks: 13795 26255 28263 30336
  Show dependency tree
 
Reported: 2003-10-08 15:41 UTC by Robin Johnson
Modified: 2007-05-18 19:28 UTC (History)
19 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-10-08 15:41:17 UTC
During GCC's install process, it builds "fixed" headers and places them into 
/usr/lib/gcc-lib/${CHOST}/${PV}/include/.

One example is the net-snmp headers.
Say net-snmp is 5.0.8 when you build gcc, then it will copy those headers and place them into that folder.
now you upgrade net-snmp and the old headers still exist and over-ride the new headers, which breaks anything that depends on the new version of the headers as the "fixed" old version is pulled in instead.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-10-10 22:53:17 UTC
This also occurs with the openssl headers when upgrading 0.9.6 to 0.9.7.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-10-10 22:54:48 UTC
see bug 13795 for the openssl breakage.

as a suggested fix, could we please have GCC not install it's "fixed" headers
if possible?
Comment 3 Daniel Mettler 2003-10-14 14:29:29 UTC
i don't know whether my problem is related, but i'm using gcc-3.2.3-r1 and
it fails to compile almost any ebuild (reproducible, tested with kernel 2.4.22
and 2.6.0-test7). it also fails to compile gcc-3.2.3-r2, so i'm stuck now!
what can i do? any work-around/quickfix? help greatly appreciated.

for me, this bug is definitely a *blocker*.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-10-15 22:29:46 UTC
daniel: i seriously doubt your problem is related to this. I suggest getting
a suitable livecd copying over the gcc+binutils tbz2 packages and then installing
those to your system.
Comment 5 James Harlow (RETIRED) gentoo-dev 2003-10-15 22:33:38 UTC
Daniel: unzip a stage 3 tarball in a directory, chroot, build a gcc package,
copy it over and emerge -K it.
Comment 6 Daniel Mettler 2003-10-16 05:51:04 UTC
the reason for my problem: kernel 2.6.0-test7 was broken (see thread http://www.ussg.iu.edu/hypermail/linux/kernel/0310.1/1748.html)

currently i'm emerging gcc with 2.4.22 again and so far it works (must have
been bad luck when i tested it with 2.4.22 and it didn't work)

sorry for bothering.
Comment 7 Alastair Tse (RETIRED) gentoo-dev 2003-10-18 03:40:41 UTC
this occured with slang too. i had to put something in the slang ebuild to
remove those "fixed" headers to prevent breaking other slang apps (linking
the wrong version headers with libraries)
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-26 13:36:15 UTC
I know about this issue.  It have bitten us with ncurses, slang, openssl
and possibly others I have forgotten.  I am not however sure if just
removing them is the sane thing to do though.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-10-26 13:55:42 UTC
Definely not removing the entire directory is required, as GCC puts some
of it's own headers there.
I think we should just disable the fixincludes stage that builds the header
files for the moment, experimentally, and see if it causes breakages with
anything.

From what i've read, we are quite unlikely to hit breakages by not running
it on 32-bit linux platforms. 64 bit linux platforms require some more care,
so possibly leave it enabled for them still.
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-03 14:18:58 UTC
I have this in my local tree, and will commit in ~ if it checks out ok:

--
--- gcc-3.3.2-r2.ebuild 2003-11-02 15:28:03.000000000 +0200
+++ gcc-3.3.2-r2.ebuild 2003-11-02 14:02:15.000000000 +0200
@@ -357,13 +357,26 @@
 }
  
 src_install() {
+       local x=
+       local tmp=
+
        # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include
as
        # this can break the build.
-       for x in cd ${WORKDIR}/build/gcc/include/*
+       for x in ${WORKDIR}/build/gcc/include/*
        do
                if [ -L ${x} ]
                then
                        rm -f ${x}
+                       continue
+               fi
+       done
+       # Remove generated headers, as they can cause things to break
+       # (ncurses, openssl, etc).
+       for x in `find ${WORKDIR}/build/gcc/include/ -name '*.h'`
+       do
+               if grep -q 'It has been auto-edited by fixincludes from'
${x}
+               then
+                       rm -f ${x}
                fi
        done
  
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-03 18:58:14 UTC
no arguments with that patch.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-14 18:12:15 UTC
azarah: is there a timeline for that patch going in?
Comment 13 SpanKY gentoo-dev 2003-11-16 14:14:41 UTC
*** Bug 33630 has been marked as a duplicate of this bug. ***
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-02 21:24:43 UTC
bump
azarah: please apply this asap.

Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-18 00:11:57 UTC
*** Bug 36020 has been marked as a duplicate of this bug. ***
Comment 16 Heitzso 2003-12-18 06:16:40 UTC
Would it make sense to just 'emerge gcc' to
fix on a broken system?  Assuming of course that
the 'emerge gcc' doesn't fail.  I ack that 
'emerge gcc' would take quite awhile to run,
but it would regenerate headers based on current
setup. ??
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-01-04 16:38:48 UTC
great, i see this is in gcc-3.3.2-r4 and r5 now.
marking as fixed.

my virtual/snmp will move along when one of the gcc ebuilds hits stable.
Comment 18 SpanKY gentoo-dev 2004-01-21 16:44:46 UTC
*** Bug 38935 has been marked as a duplicate of this bug. ***
Comment 19 SpanKY gentoo-dev 2004-01-21 22:25:59 UTC
*** Bug 38985 has been marked as a duplicate of this bug. ***
Comment 20 SpanKY gentoo-dev 2004-01-24 18:44:03 UTC
*** Bug 38748 has been marked as a duplicate of this bug. ***
Comment 21 SpanKY gentoo-dev 2004-01-24 18:45:04 UTC
*** Bug 39140 has been marked as a duplicate of this bug. ***
Comment 22 SpanKY gentoo-dev 2004-01-24 18:46:22 UTC
*** Bug 31338 has been marked as a duplicate of this bug. ***
Comment 23 SpanKY gentoo-dev 2004-01-24 18:47:15 UTC
*** Bug 32565 has been marked as a duplicate of this bug. ***
Comment 24 SpanKY gentoo-dev 2004-01-24 18:47:29 UTC
*** Bug 38829 has been marked as a duplicate of this bug. ***
Comment 25 SpanKY gentoo-dev 2004-01-30 03:21:35 UTC
*** Bug 39840 has been marked as a duplicate of this bug. ***
Comment 26 Donnie Berkholz (RETIRED) gentoo-dev 2004-01-30 07:30:02 UTC
*** Bug 39866 has been marked as a duplicate of this bug. ***
Comment 27 Tom Fredrik Blenning Klaussen 2004-02-02 00:32:23 UTC
How would the pathces applied work for people running stable?

I'm running stable, and the entire install process blocks on 'ttmkfdir'. That is to say, the base system is installed, but it's impossible to install Xfree.

FYI the stable version og gcc is now gcc-3.2.3-r3.
Comment 28 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-02-02 00:49:32 UTC
bfg: try to tag gcc-3.2.3-r4 as x86 and check that it works for you. the only change over 3.2.3-r3 is this patch.
Comment 29 Mr. Bones. (RETIRED) gentoo-dev 2004-02-03 20:11:36 UTC
*** Bug 40338 has been marked as a duplicate of this bug. ***
Comment 30 Mr. Bones. (RETIRED) gentoo-dev 2004-03-29 10:34:56 UTC
*** Bug 46119 has been marked as a duplicate of this bug. ***
Comment 31 Haluk Ozaktas 2005-04-05 10:39:50 UTC
i have nearly the same problem as Daniel. i have gcc-3.3.5-r1, i have changed USE flag yesterday to add 'nls' to have a utf-8 compatible system. Since than, i have problems compiling some packages (I didn't know what to do after changing a USE flag so i didn't (couldn't) do anything  at first). then i've learned that i should run 'emerge --update --deep --newuse world'. i've tried it, it compiled some packages but when it came to gcc-3.3.5-r1, there was an error. I'm not sure if this is a bug or not and I don't know what to do now. any help appreciated.