building an ia64 cross toolchain on debian?
(Apologies if this isn't the appropriate list.)
I'm trying to build an i386->ia64 cross compiler on Debian sid as described here:
http://www.gelato.unsw.edu.au/IA64wiki/CrossCompilation
and in the toolchain-source manual.
There are errors about dh_split being missing, but they don't seem to interrupt the build process.
toolchain-source shows these messages at startup:
$ tpkg-make ia64-unknown-linux Target : ia64-unknown-linux Maintainer : Martin Pool Email-Address : [email protected] Toolchain : 3.2-7 binutils : 2.13.90.0.18 gcc : 3.2.3.cvs20030221 gdb : 5.3
The build gets a fair way through but fails when trying to build ld:
flex ../../src/ld/ldlex.l && mv lex.yy.c ldlex.c
gcc -DHAVE_CONFIG_H -I. -I../../src/ld -I. -D_GNU_SOURCE -I. -I../../src/ld -I../bfd -I../../src/ld/../bfd -I../../src/ld/../include -I../../src/ld/../intl -I../intl -g -O2 -DLOCALEDIR="\"/usr/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c ldlex.c
lex.yy.c:3465: warning: no previous prototype for yyget_lineno' lex.yy.c:3474: warning: no previous prototype for yyget_in' lex.yy.c:3482: warning: no previous prototype for yyget_out' lex.yy.c:3490: warning: no previous prototype for yyget_leng' lex.yy.c:3499: warning: no previous prototype for yyget_text' lex.yy.c:3508: warning: no previous prototype for yyset_lineno' lex.yy.c:3520: warning: no previous prototype for yyset_in' lex.yy.c:3525: warning: no previous prototype for yyset_out' lex.yy.c:3530: warning: no previous prototype for yyget_debug' lex.yy.c:3535: warning: no previous prototype for yyset_debug' lex.yy.c:3541: warning: no previous prototype for yylex_destroy' ../../src/ld/ldlex.l: In function yy_input':
../../src/ld/ldlex.l:615: `yy_current_buffer' undeclared (first use in this function) ../../src/ld/ldlex.l:615: (Each undeclared identifier is reported only once ../../src/ld/ldlex.l:615: for each function it appears in.) /usr/include/sys/stat.h: At top level:
lex.yy.c:2973: warning: `yyunput' defined but not used
make[4]: *** [ldlex.o] Error 1
It looks like an incompatibility between this version of binutils and the version of flex in sid, which is 2.5.31-3. Am I missing something or can this just not be built at the moment?
I had no more luck trying to build a cross gcc from source without tpkg-make -- more on that in a minute.
Any help would be enormously appreciated.
Signature · 1 line
Martin
Quoted 7 lines · Martin Pool
../../src/ld/ldlex.l: In function `yy_input':
../../src/ld/ldlex.l:615: `yy_current_buffer' undeclared (first use in this function) ../../src/ld/ldlex.l:615: (Each undeclared identifier is reported only once ../../src/ld/ldlex.l:615: for each function it appears in.)/usr/include/sys/stat.h: At top level:
lex.yy.c:2973: warning: `yyunput' defined but not used
make[4]: *** [ldlex.o] Error 1
I tried rolling flex back to the version from Stable, 2.5.4a-24, and this allowed the build to complete. It looks like ld's lexer was using an undocumented interface to flex, so it's not really flex's fault that it broke.
Should I report this as a bug against toolchain-source or flex? I suppose flex just got too far ahead of gcc as packaged in toolchain-source?
Signature · 1 line
Martin
I got a binutils package built and installed,
/home/mbp/work/toolchain-ia64-debian/gcc-ia64-unknown-linux-3.2.3.cvs20030221/build/gcc/xgcc -B/home/mbp/work/toolchain-ia64-debian/gcc-ia64-unknown-linux-3.2.3.cvs20030221/build/gcc/ -B/usr/ia64-unknown-linux/bin/ -B/usr/ia64-unknown-linux/lib/ -isystem /usr/ia64-unknown-linux/include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/config -I../../src/gcc/../include -DL_muldi3 -c ../../src/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:21,
from ../../src/gcc/libgcc2.c:36:
../../src/gcc/config/ia64/linux.h:57:20: signal.h: No such file or directory ../../src/gcc/config/ia64/linux.h:58:26: sys/ucontext.h: No such file or directory
make[3]: *** [libgcc/./_muldi3.o] Error 1
make[3]: Leaving directory `/home/mbp/work/toolchain-ia64-debian/gcc-ia64-unknown-linux-3.2.3.cvs20030221/build/gcc'
There seems to be a problem that the cross libc produced by "tpkg-install-libc ia64-unknown-linx" wants to install into /usr/ia64-linux (sic) whereas the binutils install into /usr/ia64-unknown-linux. I think this was causing gcc to be unable to find the header files.
I kludged this up by just symlinking the two together but it seems like there ought to be a better way.
Anyhow, now I seem to have a working cross toolchain, which is great.
Signature · 1 line
Martin
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Martin" = Martin Pool <[email protected]> writes:
Martin> There seems to be a problem that the cross libc produced by Martin> "tpkg-install-libc ia64-unknown-linx" wants to install into Martin> /usr/ia64-linux (sic) whereas the binutils install into Martin> /usr/ia64-unknown-linux. I think this was causing gcc to be Martin> unable to find the header files.
Yes,I found that too. Version 3.2-7 of the toolchain source didn't have the problem; an earlier version did; so I thought it was solved and removed the instructions for working around the problem from the Wiki.
Please feel free to edit the WiKi with any workarounds you needed. The bad version of flex was released after I last tested the instructions -- I've logged a bug against binutils, as the native driver can't build either at present.
--
Dr Peter Chubb http://www.gelato.unsw.edu.au [email protected]
You are lost in a maze of BitKeeper repositories, all slightly different.
Quoted 5 lines
Please feel free to edit the WiKi with any workarounds you needed. The bad version of flex was released after I last tested the instructions -- I've logged a bug against binutils, as the native driver can't build either at present.
??? there hasn't been a release of flex source since 1997, according to the date stamps in ftp.gnu.org/non-gnu/flex. Does this mean that there's a bad build floating around?
Quoted 4 lines · Mats D
Quoted 4 lines
Please feel free to edit the WiKi with any workarounds you needed. The bad version of flex was released after I last tested the instructions -- I've logged a bug against binutils, as the native driver can't build either at present.
OK, thanks.
I'm just trying to get a whole toolchain up and running first so that I can be sure I'm documenting the right thing.
In fact I later discovered that since the kernel requires(?) a cvs-head version of binutils to build, using the debian toolchain package won't help me anyhow. I might add another page about how to do a plain source build.
Quoted 3 lines
??? there hasn't been a release of flex source since 1997, according to the date stamps in ftp.gnu.org/non-gnu/flex. Does this mean that there's a bad build floating around?
Debian have 2.5.4a-24 (which can build the toolchain) and 2.5.31-3 (which cannot).
http://packages.debian.org/flex
According to the changelog for the new one:
lex (2.5.31-1) unstable; urgency=low
* New upstream release.
-- Manoj Srivastava <[email protected]> Wed, 9 Apr 2003 14:12:18 -0500
According to the source tarball, the new site is
<http://lex.sourceforge.net/> not gnu.org which as you say only has older versions.
The ldlex.l source says "FIXME: We should not be using a flex internal interface in the first place!" (although not in reference to the particular line that fails.) So it looks like ld depends on an older version of flex. (Perhaps it forked from GNU?)
Thanks,
Signature · 1 line
Martin