Cross compile: binutils build failed. lex problems?

Hi all,

I’d like to use Mingw32 to create win32 executables on my Linux box from
my SDL programs. Did a Google search and found this:

http://www.libsdl.org/extras/win32/cross/README.txt

The third option applies to me. So I began the build, but it failed on
binutils:


Extracting binutils
tar: Read 1024 bytes from -
Configuring binutils
Building binutils

make failed - log available: binutils-i386-mingw32msvc/make.log

Configure was happy, but something bad happened with with generating
ldlex.c:

gcc -DHAVE_CONFIG_H -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I. -D_GNU_SOURCE -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/include
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/intl
-I…/intl -g -O2 -DLOCALEDIR=""/usr/local/cross-tools/share/locale""
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c ldlex.c
lex.yy.c:3467: warning: no previous prototype for yyget_lineno' lex.yy.c:3476: warning: no previous prototype foryyget_in’
lex.yy.c:3492: warning: no previous prototype for `yyget_leng’

I’ve used lex before, but lex/bison are still pretty mysterious to me.
Any input on how to get binutils to compile correctly?

I’m using Debian testing with flex, not lex. Is that a problem?

Thanks!
Pete

gcc -DHAVE_CONFIG_H -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I. -D_GNU_SOURCE -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/include
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/intl
-I…/intl -g -O2
-DLOCALEDIR=""/usr/local/cross-tools/share/locale""
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c ldlex.c
lex.yy.c:3467: warning: no previous prototype for yyget_lineno' lex.yy.c:3476: warning: no previous prototype foryyget_in’
lex.yy.c:3492: warning: no previous prototype for `yyget_leng’

These are only warnings. Specifically, in the c code generated by flex,
they called functions that weren’t yet defined for the compiler. I’m
not sure what you can tell flex to make it do that (it will do that by
adding or #including some function prototypes,) but I don’t think it’s
the source of your problems.On Jul 30, 2004, at 8:03 PM, Peter Jay Salzman wrote:

On Fri 30 Jul 04, 5:03 PM, Peter Jay Salzman <@Peter_Jay_Salzman> said:

I’ve used lex before, but lex/bison are still pretty mysterious to me.
Any input on how to get binutils to compile correctly?

I’m using Debian testing with flex, not lex. Is that a problem?

Apparently, it is. You need to use the old lex, not the newer flex.

Pete–
In theory, theory and practise are the same. In practise, they aren’t.
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D

On Sat 31 Jul 04, 1:03 AM, Donny Viszneki said:

gcc -DHAVE_CONFIG_H -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I. -D_GNU_SOURCE -I.
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld
-I…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/bfd
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/include
-I/home/p/tmp/source/binutils-2.13.90-20030111-1-src/ld/…/intl
-I…/intl -g -O2
-DLOCALEDIR=""/usr/local/cross-tools/share/locale""
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c ldlex.c
lex.yy.c:3467: warning: no previous prototype for yyget_lineno' lex.yy.c:3476: warning: no previous prototype foryyget_in’
lex.yy.c:3492: warning: no previous prototype for `yyget_leng’

These are only warnings. Specifically, in the c code generated by flex,
they called functions that weren’t yet defined for the compiler. I’m
not sure what you can tell flex to make it do that (it will do that by
adding or #including some function prototypes,) but I don’t think it’s
the source of your problems.

Hi Donny,

Yeah – I stupidly forgot to paste in the actual errors that followed.
:frowning:

After a google search didn’t turn anything up on these errors relating
to a binutils build, I wanted to install the old lex, just to see if it
would work. I’ve heard that are incompatibilities between the two.
(I’ve used flex/bison before, but they’re still black magic to me.).

I didn’t want to uninstall flex, since who knows what kind of
dependencies there are on a system. But after a while, I got the
courage up. I uninstalled flex, installed the old lex, and the build
actually worked.

Now I just need to figure out how to actually USE the cross compiling
system that I just built and installed! :wink:

Pete> On Jul 30, 2004, at 8:03 PM, Peter Jay Salzman wrote:


In theory, theory and practise are the same. In practise, they aren’t.
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D