Bug 35619 - [4.4 Regression] fixed includes not being found if building in src dir
Summary: [4.4 Regression] fixed includes not being found if building in src dir
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.3.0
: P4 normal
Target Milestone: 4.5.0
Assignee: Ralf Wildenhues
URL:
Keywords: build
: 36946 37564 37925 40212 40555 41362 41363 42560 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-17 21:56 UTC by bill broadley
Modified: 2018-06-11 05:35 UTC (History)
11 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail: 4.3.4 4.4.1
Last reconfirmed: 2009-09-19 08:33:14


Attachments
Wrong file, please delete. (5.68 KB, text/plain)
2008-03-17 22:05 UTC, bill broadley
Details
bits/stdio.h (1.54 KB, text/plain)
2008-03-17 22:13 UTC, bill broadley
Details
Ubuntu 7.10 (fully patched) glibc-2.6.1 features.h (3.80 KB, text/plain)
2008-03-22 21:58 UTC, bill broadley
Details
Centos-5.1, glibc-2.5, features.h (3.89 KB, text/plain)
2008-03-22 22:00 UTC, bill broadley
Details
centos-4.6, glibc-2.3.4, features.h (3.89 KB, text/plain)
2008-03-22 22:02 UTC, bill broadley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bill broadley 2008-03-17 21:56:58 UTC
Attempting to build gcc-4.3.0 with a centos-4.6 (fully patched) using the centos
compiler:


Exact version of gcc used to build gcc-4.3.0:
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

Options when GCC was configured/built:
export CC=gcc4
 ./configure --prefix=/opt/pkg/gcc-4.3.0 --with-gmp=/opt/pkg/gmp-4.2.2 --with
-mpfr=/opt/pkg/mpfr-2.3.1

Options when building gmp-4.2.2:
export CC=gcc4
./configure --prefix=/opt/pkg/gmp-4.2.2

Options when building mpfr-2.3.1:
export CC=gcc4
./configure --prefix=/opt/pkg/mpfr-2.3.1 --with-gmp=/opt/pkg/gmp-4.2.2/ --with-gmp-build=/opt/src/gmp-4.2.2/

result from make (after an hour or so on a dual opteron):
make[3]: Entering directory `/opt/src/gcc-4.3.0/x86_64-unknown-linux-gnu/libgfortran'
/bin/sh ./libtool --tag=CC --mode=link /opt/src/gcc-4.3.0/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/opt/src/gcc-4.3.0/host-x86_64-unknow
n-linux-gnu/gcc/ -B/opt/pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/bin/ -B/opt/pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/lib/ -isystem /opt/pkg
/gcc-4.3.0/x86_64-unknown-linux-gnu/include -isystem /opt/pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/sys-include -std=gnu99 -Wall -Wstrict-p
rototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -O2 -g -g -O2     -o libgfortran.la -rpath /opt/pkg/gcc-4.
3.0/lib/../lib64 -version-info `grep -v '^#' ../.././libgfortran/libtool-version` -lm  -Wl,--version-script=../.././libgfortran/gfortran
.map backtrace.lo compile_options.lo environ.lo error.lo fpu.lo main.lo memory.lo pause.lo stop.lo string.lo select.lo all_l1.lo ......
libtool: link: /opt/src/gcc-4.3.0/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/opt/src/gcc-4.3.0/host-x86_64-unknown-linux-gnu/gcc/ -B/opt/
pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/bin/ -B/opt/pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/lib/ -isystem /opt/pkg/gcc-4.3.0/x86_64-unknow
n-linux-gnu/include -isystem /opt/pkg/gcc-4.3.0/x86_64-unknown-linux-gnu/sys-include -shared  .libs/backtrace.o .libs/compile_options.o 
.libs/environ.o .libs/error.o .libs/fpu.o .libs/main.o . ....
s/_dim_r4.o .libs/_dim_r8.o .libs/_dim_r10.o .libs/_dim_r16.o .libs/_atan2_r4.o .libs/_atan2_r8.o .libs/_atan2_r10.o .libs/_atan2_r16.o 
.libs/_mod_i4.o .libs/_mod_i8.o .libs/_mod_i16.o .libs/_mod_r4.o .libs/_mod_r8.o .libs/_mod_r10.o .libs/_mod_r16.o .libs/misc_specifics.
o .libs/dprod_r8.o .libs/f2c_specifics.o   -lm  -Wl,--version-script=../.././libgfortran/gfortran.map -Wl,-soname -Wl,libgfortran.so.3 -
o .libs/libgfortran.so.3.0.0
.libs/compile_options.o(.text+0x0): In function `feof_unlocked':
/usr/include/bits/stdio.h:113: multiple definition of `feof_unlocked'
.libs/backtrace.o(.text+0x0):/usr/include/bits/stdio.h:113: first defined here
Comment 1 Andrew Pinski 2008-03-17 22:00:22 UTC
This is a bug in the glibc headers.  We should fixincludes them though.

Can you attach /usr/include/bits/stdio.h ?  And also mention which glibc version you are using.
Comment 2 bill broadley 2008-03-17 22:05:14 UTC
Created attachment 15339 [details]
Wrong file, please delete.
Comment 3 bill broadley 2008-03-17 22:06:47 UTC
rpm claims:
glibc-2.3.4-2.39
glibc-headers-2.3.4-2.39
glibc-devel-2.3.4-2.39
compat-glibc-headers-2.3.2-95.30

ls -al  /lib/libc-2.3.4.so 
-rwxr-xr-x  1 root root 1516768 Nov 16 08:37 /lib/libc-2.3.4.so
Comment 4 Andrew Pinski 2008-03-17 22:08:54 UTC
(In reply to comment #2)
> Created an attachment (id=15339) [edit]
> stdio.h as requested.

That is /usr/include/stdio.h, not the one I requested /usr/include/bits/stdio.h :).
Comment 5 bill broadley 2008-03-17 22:13:18 UTC
Created attachment 15340 [details]
bits/stdio.h

This is the correct file as requested, I'll attempt to delete the previous wrong version.
Comment 6 Andrew Pinski 2008-03-17 22:58:44 UTC
Looks like the reason why it was not being fixed because of:
__NTH (feof_unlocked (FILE *__stream))



Comment 7 bill broadley 2008-03-17 23:44:01 UTC
(In reply to comment #6)
> Looks like the reason why it was not being fixed because of:
> __NTH (feof_unlocked (FILE *__stream))
> 

So how would I fix it?
Comment 8 bill broadley 2008-03-18 00:02:57 UTC
(In reply to comment #6)
> Looks like the reason why it was not being fixed because of:
> __NTH (feof_unlocked (FILE *__stream))
> 

So how would I fix it?(In reply to comment #6)
> Looks like the reason why it was not being fixed because of:
> __NTH (feof_unlocked (FILE *__stream))
> 

BTW, this seems pretty common, I looked at Ubuntu Gutsy 7.10 system and it has the same definition:
cat /usr/include/bits/stdio.h | grep feof_unlocked | head -1
__NTH (feof_unlocked (FILE *__stream))

Comment 9 bill broadley 2008-03-19 20:38:16 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Looks like the reason why it was not being fixed because of:
> > __NTH (feof_unlocked (FILE *__stream))
> > 
> 
> So how would I fix it?(In reply to comment #6)
> > Looks like the reason why it was not being fixed because of:
> > __NTH (feof_unlocked (FILE *__stream))
> > 
> 
> BTW, this seems pretty common, I looked at Ubuntu Gutsy 7.10 system and it has
> the same definition:
> cat /usr/include/bits/stdio.h | grep feof_unlocked | head -1
> __NTH (feof_unlocked (FILE *__stream))
> 

I reproduced this error on Centos-5.1 as well.

Comment 10 bill broadley 2008-03-22 21:58:11 UTC
Created attachment 15361 [details]
Ubuntu 7.10 (fully patched) glibc-2.6.1 features.h

As requested.
Comment 11 bill broadley 2008-03-22 22:00:31 UTC
Created attachment 15362 [details]
Centos-5.1, glibc-2.5, features.h

as requested.
Comment 12 bill broadley 2008-03-22 22:02:03 UTC
Created attachment 15363 [details]
centos-4.6, glibc-2.3.4, features.h

as requested, from a patched system.
Comment 13 Andrew Pinski 2008-03-22 22:08:53 UTC
The Ubuntu 7.10 features should have been matched.

Maybe this is a problem with building in the src dir.

Can you try building GCC in an object directory?
Comment 14 bill broadley 2008-03-23 00:38:29 UTC
(In reply to comment #13)
> The Ubuntu 7.10 features should have been matched.
> 
> Maybe this is a problem with building in the src dir.
> 
> Can you try building GCC in an object directory?
> 

That fixed it on all 3 platforms (centos-4.6, 5.1, and ubuntu 7.10).

Thanks.

Comment 15 Uroš Bizjak 2008-04-21 07:18:51 UTC
Closed as invalid.
Comment 16 Andrew Pinski 2008-05-28 01:13:55 UTC
(In reply to comment #15)
> Closed as invalid.

This bug is not invalid, just you are not building GCC the recommended way.
Comment 17 Andrew Pinski 2008-05-28 01:15:23 UTC
*** Bug 36349 has been marked as a duplicate of this bug. ***
Comment 18 Richard Biener 2008-06-06 14:59:12 UTC
4.3.1 is being released, adjusting target milestone.
Comment 19 Mark Mitchell 2008-06-13 21:40:20 UTC
Andrew --

Why did you reopen this?  It sounds like the submitter was building in the srcdir, and that when building in the objdir, it worked fined.  Isn't that exactly the situation we expect?

-- Mark
Comment 20 Richard Biener 2008-06-25 11:57:29 UTC
Actually we made it work at some point and that is even documented:

"First, we @strong{highly} recommend that GCC be built into a
separate directory than the sources which does @strong{not} reside
within the source tree.  This is how we generally build GCC; building
where @var{srcdir} == @var{objdir} should still work, but doesn't
get extensive testing; building where @var{objdir} is a subdirectory
of @var{srcdir} is unsupported."

but lowering priority according to the strong suggestion in the docs.
Comment 21 Andrew Pinski 2008-07-26 21:23:21 UTC
*** Bug 36946 has been marked as a duplicate of this bug. ***
Comment 22 Joseph S. Myers 2008-08-27 22:03:32 UTC
4.3.2 is released, changing milestones to 4.3.3.
Comment 23 Andrew Pinski 2008-09-17 19:07:41 UTC
*** Bug 37564 has been marked as a duplicate of this bug. ***
Comment 24 Andrew Pinski 2008-11-04 00:40:49 UTC
*** Bug 37925 has been marked as a duplicate of this bug. ***
Comment 25 Richard Biener 2009-01-24 10:20:12 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 26 Andrew Pinski 2009-05-20 23:42:34 UTC
*** Bug 40212 has been marked as a duplicate of this bug. ***
Comment 27 Francois-Xavier Coudert 2009-05-21 20:32:35 UTC
*** Bug 40212 has been marked as a duplicate of this bug. ***
Comment 28 Andrew Pinski 2009-06-26 03:03:53 UTC
*** Bug 40555 has been marked as a duplicate of this bug. ***
Comment 29 Richard Biener 2009-08-04 12:28:56 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 30 Andrew Pinski 2009-09-15 20:16:10 UTC
*** Bug 41362 has been marked as a duplicate of this bug. ***
Comment 31 Andrew Pinski 2009-09-15 20:16:26 UTC
*** Bug 41363 has been marked as a duplicate of this bug. ***
Comment 32 Ralf Wildenhues 2009-09-19 08:30:37 UTC
Subject: Bug 35619

Author: rwild
Date: Sat Sep 19 08:29:58 2009
New Revision: 151880

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151880
Log:
Fix long-standing in-tree build include-fixed bug.

gcc/:
	PR bootstrap/35619
	* Makefile.in (stmp-fixinc): Ensure `include-fixed' is created
	in the directory this rule is called from, rather than the
	toplevel 'gcc' directory, to fix in-tree build.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in

Comment 33 Ralf Wildenhues 2009-09-19 08:33:14 UTC
Fixed on trunk.
Comment 34 Richard Biener 2010-05-22 18:12:14 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 35 karl 2011-03-27 23:51:28 UTC
*** Bug 42560 has been marked as a duplicate of this bug. ***
Comment 36 Richard Biener 2011-06-27 12:13:20 UTC
4.3 branch is being closed, moving to 4.4.7 target.
Comment 37 Jakub Jelinek 2012-03-13 13:04:20 UTC
Fixed in 4.5+, 4.4 is no longer supported.