Bug 13334 - Bootstrap failure: libiberty/fibheap.c: LONG_MIN undeclared
Summary: Bootstrap failure: libiberty/fibheap.c: LONG_MIN undeclared
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Andrew Pinski
URL:
Keywords: documentation, patch
: 12708 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-06 13:56 UTC by Giovanni Bajo
Modified: 2014-02-16 13:17 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2004-05-21 20:18:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2003-12-06 13:56:57 UTC
Hello, 

I see this if I try to bootstrap with --disable-threads:

 /home/rasky/gcc/mainline/out/gcc/xgcc -B/home/rasky/gcc/mainline/out/gcc/ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/bin/ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/lib/ -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/include -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/sys-include -c -
DHAVE_CONFIG_H -O2 -O2 -fomit-frame-pointer -fstrict-aliasing -march=athlon-
tbird -mcpu=athlon-tbird -DNDEBUG -pipe -I. -
I../../../gcc/libiberty/../include  -W -Wall -Wtraditional -pedantic -
fpic ../../../gcc/libiberty/fibheap.c -o pic/fibheap.o; \
else true; fi
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
../../../gcc/libiberty/fibheap.c: In function `fibheap_delete_node':

../../../gcc/libiberty/fibheap.c:285: error: `LONG_MIN' undeclared (first use 
in this function)
../../../gcc/libiberty/fibheap.c:285: error: (Each undeclared identifier is 
reported only once
../../../gcc/libiberty/fibheap.c:285: error: for each function it appears in.)


rasky@trinity:~/gcc/mainline/out$ /home/rasky/gcc/mainline/out/gcc/xgcc -v
Reading specs from /home/rasky/gcc/mainline/install//lib/gcc/i686-pc-linux-
gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/home/rasky/gcc/mainline/install/ --
enable-languages=c,c++,java --enable-shared --disable-threads --with-system-
zlib --enable-__cxa_atexit --disable-multilib
Thread model: single
gcc version 3.4 20031206 (experimental)


My binutils *IS* new:
rasky@trinity:~/gcc/mainline/out$ ld -v
GNU ld version 2.14.90.0.6 20030820


This bug has been reported a few times, on different systems, without 
satisfatory answers:
http://gcc.gnu.org/ml/gcc/2002-06/msg00922.html (powerpc-eabisim)
http://gcc.gnu.org/ml/gcc/2003-08/msg01634.html (on the cs-branch) (!)
PR/12708 (which was incorrectly closed as duplicate of this, but the user DID 
have a new binutils).

This system is RH9, btw.
Comment 1 Giovanni Bajo 2003-12-06 13:57:56 UTC
*** Bug 12708 has been marked as a duplicate of this bug. ***
Comment 2 Giovanni Bajo 2003-12-06 13:59:16 UTC
Sorry, I oviously meant that PR12708 is a duplicate of *this* bug, and was 
incorrectly closed as "you need new binutils".
Comment 3 Andrew Pinski 2003-12-06 21:17:18 UTC
Can you provide the preprocessed source file for fibheap.c?
Comment 4 Giovanni Bajo 2003-12-07 01:36:25 UTC
It turned out to be a problem with non-standard CFLAGS/CXXFLAGS set.

I think the website (http://gcc.gnu.org/install/build.html) does not document 
properly that CFLAGS/CXXFLAGS are used for bootstrap of target components 
(libiberty, v3, libjava, etc.). I think it should be updated to include 
something like:

"Notice that CFLAGS and CXXFLAGS are used during the last part of GCC bootstrap 
(for target libraries like libjava or libstdc++). If bootstrap fails at that 
point, you might try to remove those variables from your environment and try 
again. In this case, remove your builddir and restart from scratch."

The last sentence has been added because I tried a 'make cleanstrap' after 
having removed the flags and it was not sufficient (the makefiles were already 
generated probably). Maybe there is a better and faster to accomplish this.
Comment 5 Andrew Pinski 2003-12-07 01:44:43 UTC
Not web but bootstrap and add documentation keyword.
I will make a patch tommorrow unless someone beats me to it.
Comment 6 Andrew Pinski 2003-12-07 01:55:39 UTC
*** Bug 13330 has been marked as a duplicate of this bug. ***
Comment 7 meapague 2004-01-29 21:37:02 UTC
You're missing kernel-headers, I installed it and solved my problem
Comment 8 Giovanni Bajo 2004-02-19 12:00:59 UTC
Andrew said he was going to take care of this.
Comment 9 Andrew Pinski 2004-05-28 13:19:32 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01817.html>.  Hopefully I did not have 
any typos in there.
Comment 10 Giovanni Bajo 2004-06-18 16:19:24 UTC
Gerald, would you please review and possibly approve this patch? Thanks.
Comment 11 Gerald Pfeifer 2004-06-20 15:11:34 UTC
The patch looks fine, Andrew.  I just suggest two minor changes:

+Note that using non-standard @code{CFLAGS} can cause bootstrap to fail in
+@file{libiberty}, if these trigger a warning with the new compiler.  For
+example using @samp{-O2 -g -mcpu=i686} on @code{i686-pc-linux-gnu} will
+cause bootstrap failure as @code{-mcpu=} is deprecated in 3.4.0 and above.
+
Comment 12 GCC Commits 2004-06-26 20:40:40 UTC
Subject: Bug 13334

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-06-26 20:40:31

Modified files:
	gcc            : ChangeLog 
	gcc/doc        : install.texi 

Log message:
	2004-06-26  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR 13334
	* doc/install.texi: Document non-standard CFLAGS and bootstrap
	failures and warnings.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4160&r2=2.4161
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/install.texi.diff?cvsroot=gcc&r1=1.293&r2=1.294

Comment 13 Andrew Pinski 2004-06-26 20:42:13 UTC
Fixed, Thanks Gerald for reviewing and sugessting some changes.
Comment 14 Jackie Rosen 2014-02-16 13:17:21 UTC Comment hidden (spam)