[MLton] Building MLton

John Skaller skaller@users.sourceforge.net
Tue, 05 Jul 2005 02:17:10 +1000


--=-ciEIPl9n+wISP4+hYmkh
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2005-07-04 at 08:38 -0400, Ray Racine wrote:
> On Mon, 2005-07-04 at 16:03 +1000, John Skaller wrote:
> > On Sun, 2005-07-03 at 14:57 -0400, Matthew Fluet wrote:
> > > > I note I have these switches:
> > > >=20
> > > > -mtune=3Dopteron -m32
> > > >=20
>=20
> That's probably from my small patch to get MLton to compile on myy AMD
> 64 bit opteron on Fedora Core 3 - 64 bit using gcc version 3.4.x
>=20
> Concerning your build failure...

>=20
> I think you are just a tweak or two away from getting it to go modulo
> any gcc 4.0 adjustments.

I'm not so sure .. subsequently, I have found -m32 just doesn't
work, period, it has nothing to do with MLton: I can't generate
i386 code with the gcc I have. I can certainly run it, some of the
packages I have (like OpenOffice) are known to be 32 bit x86 code.

I added a symlink, to get rid of the ld failure, but now
I get this on 'hello world' program:

skaller@rosella:~$ gcc -m32 hello.c -o hello
/usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux/4.0.0/../../../libc.so when
searching for -lc
/usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux/4.0.0/../../../libc.a when
searching for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/gcc/x86_64-linux/4.0.0/../../../crt1.o' is incompatible with
i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/gcc/x86_64-linux/4.0.0/../../../crti.o' is incompatible with
i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/gcc/x86_64-linux/4.0.0/../../../crtn.o' is incompatible with
i386 output
/usr/lib/gcc/x86_64-linux/4.0.0/../../../crt1.o(.text+0x13): In function
`_start':
../sysdeps/x86_64/elf/start.S:89: undefined reference to
`__libc_csu_fini'
/usr/lib/gcc/x86_64-linux/4.0.0/../../../crt1.o(.text
+0x1a):../sysdeps/x86_64/elf/start.S:90: undefined reference to
`__libc_csu_init'
collect2: ld returned 1 exit status

so the compiler is trying to link the wrong startup files,
the -m32 switch just doesn't convert from amd64 to x86 like it should.

skaller@rosella:~$ gcc -march=3Di386 hello.c -o hello
hello.c:1: error: CPU you selected does not support x86-64 instruction
set
hello.c:1: error: CPU you selected does not support x86-64 instruction
set

So?? Why it it trying to use x86-64 instructions??

Anyhow this isn't an MLton problem ..



--=20
John Skaller <skaller at users dot sourceforge dot net>
Download Felix: http://felix.sf.net

--=-ciEIPl9n+wISP4+hYmkh
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBCyWEEw7vY25tjqN4RAi7JAJ9f+bCRdHCtvTlxU/RBH+SU768kdQCfQcmX
j/dyFlJ0U8Z5Zei/RBSMA1g=
=vnD8
-----END PGP SIGNATURE-----

--=-ciEIPl9n+wISP4+hYmkh--