Bug 399 - ar build problem (using bison-1.875?)
Summary: ar build problem (using bison-1.875?)
Status: RESOLVED WORKSFORME
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-23 00:54 UTC by Sampo Kellomaki
Modified: 2005-01-27 00:12 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sampo Kellomaki 2004-09-23 00:54:21 UTC
All tools built from sources and used successfully for building other software.
gcc-3.4.2
bison-1.875
host binutils-2.14.90.0.4.1
glibc-2.3.3

Trying to build binutils-2.15.91.0.2 (similar problem noted but not reported
with 2.15.91.0.1) obtained from kernel.org. Fails on linking ar. binutils
was configured with --prefix but otherwise as adviced in INSTALL.

(snip)
gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -o ar arparse.o
arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o
version.o filemode.o  ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -ldl
ar.o(.text+0x1020): In function `main':
../../binutils-2.15.91.0.2/binutils/ar.c:342: multiple definition of `main'
arlex.o(.text+0x0):/s/build-binutils/binutils/arlex.c:1: first defined here
/apps/binutils/std/bin/ld: Warning: size of symbol `main' changed from 16 in
arlex.o to 3488 in ar.o
bucomm.o(.text+0xa06): In function `make_tempname':
../../binutils-2.15.91.0.2/binutils/bucomm.c:425: the use of `mktemp' is
dangerous, better use `mkstemp'
arparse.o(.text+0x39): In function `yyerror':
/s/build-binutils/binutils/../../binutils-2.15.91.0.2/binutils/arparse.y:201:
undefined reference to `linenumber'
arparse.o(.text+0x402): In function `yyparse':
/s/build-binutils/binutils/y.tab.c:1004: undefined reference to `yylex'
collect2: ld returned 1 exit status
make[3]: *** [ar] Error 1
make[3]: Leaving directory `/d/src/build-binutils/binutils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/d/src/build-binutils/binutils'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/d/src/build-binutils/binutils'
make: *** [all-binutils] Error 2

--Sampo
Comment 1 Sampo Kellomaki 2004-09-23 19:28:37 UTC
I checked with bison-1.35. It repeats the same. Thus my hunch that it
was bison version related does not appear to be right.

Where is the symbol linenumber supposed to be defined?

--Sampo
Comment 2 Alan Modra 2004-10-12 08:55:39 UTC
This looks fairly obviously a problem with your binutils/arlex.c, a file created
by flex from binutils/arlex.l
Comment 3 Ben Elliston 2004-12-06 00:48:17 UTC
Can you reproduce this problem with binutils-2.15?
Comment 4 Ben Elliston 2004-12-06 23:19:40 UTC
You don't seem to be using an FSF release of binutils.  Nevertheless, a release
should not require you to have flex or bison installed in order to build
binutils.    Please try to use an FSF release like 2.15 and re-open this PR if
the problem persists for you.
Comment 5 Jon Grimm 2005-01-24 18:52:52 UTC
FYI, I saw this on a recently installed machine when building binutils CVS HEAD.
 Installing flex (and bison) made the problem go away for me.  
Comment 6 Alan Modra 2005-01-25 07:49:23 UTC
Yes, building from CVS requires that you have flex and bison installed.  The
reason is that files generated by flex and bison are not kept up-to-date in the
CVS repository.
Comment 7 Ben Elliston 2005-01-27 00:12:31 UTC
Actually, the generated files aren't kept in CVS at all!