Linker errors when building ADATE with amd64

Lars Magnusson <[email protected]>
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
Hi

I'm currently working on porting the ADATE system to x86_64. I get
some linker errors when building that I'm having a hard time figuring
out.

The mlton output (with the compile SML output discarded):

Compile and Assemble starting
      gcc -std=gnu99 -c -I/usr/lib/mlton/targets/self/include \
          -I/usr/lib/mlton/include -O1 -fno-common -fno-strict-aliasing \
          -fomit-frame-pointer -w -m64 -o /tmp/fileeFQzBJ.o /tmp/filePR2V5Q.5.c
      gcc -c -m64 -o /tmp/fileCXMKcs.o /tmp/file08JvNj.4.s
      gcc -c -m64 -o /tmp/fileNKJ89G.o /tmp/filekicUjH.3.s
      gcc -c -m64 -o /tmp/fileSG5tLs.o /tmp/fileSzumK1.2.s
      gcc -c -m64 -o /tmp/filelBmNve.o /tmp/fileX2z7aA.1.s
      gcc -c -m64 -o /tmp/filew8NCvz.o /tmp/filevZ0aQ8.0.s
      gcc -std=gnu99 -c -I/usr/lib/mlton/targets/self/include \
          -I/usr/lib/mlton/include -O1 -fno-common -fno-strict-aliasing \
          -fomit-frame-pointer -w -m64 -o /tmp/fileHL1K7s.o ./execute.c
      gcc -std=gnu99 -c -I/usr/lib/mlton/targets/self/include \
          -I/usr/lib/mlton/include -O1 -fno-common -fno-strict-aliasing \
          -fomit-frame-pointer -w -m64 -o /tmp/fileUoLkXN.o \
          ./ampi_interface_mlton.c
      gcc -std=gnu99 -c -I/usr/lib/mlton/targets/self/include \
          -I/usr/lib/mlton/include -O1 -fno-common -fno-strict-aliasing \
          -fomit-frame-pointer -w -m64 -o /tmp/fileZS2MEL.o ./svd_lin_solve.c
   Compile and Assemble finished in 0.76 + 0.00 (0% GC)
   Link starting
      gcc -o makespec /tmp/fileeFQzBJ.o /tmp/fileCXMKcs.o /tmp/fileNKJ89G.o \
          /tmp/fileSG5tLs.o /tmp/filelBmNve.o /tmp/filew8NCvz.o \
          /tmp/fileHL1K7s.o /tmp/fileUoLkXN.o /tmp/fileZS2MEL.o \
          -L/usr/lib/mlton/targets/self -lmlton -lgdtoa -lm -lgmp -m64 \
          -mmodel=medium -fPIC -static
/tmp/fileUoLkXN.o: In function `ampi_init_client':
ampi_interface_mlton.c:(.text+0x1085): warning: Using 'gethostbyname'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/tmp/filew8NCvz.o: In function `L_5':
(.text+0x4fa2): relocation truncated to fit: R_X86_64_PC32 against
symbol `CommandLine_argv' defined in .bss section in
/usr/lib/mlton/targets/self/libmlton.a(CommandLine.o)
/tmp/filew8NCvz.o: In function `L_5':
(.text+0x4fa9): relocation truncated to fit: R_X86_64_PC32 against
symbol `CommandLine_argc' defined in .bss section in
/usr/lib/mlton/targets/self/libmlton.a(CommandLine.o)
/tmp/filew8NCvz.o: In function `L_5':
(.text+0x4fb0): relocation truncated to fit: R_X86_64_PC32 against
symbol `CommandLine_commandName' defined in .bss section in
/usr/lib/mlton/targets/self/libmlton.a(CommandLine.o)
/tmp/fileUoLkXN.o: In function `ampi_comm_size':
ampi_interface_mlton.c:(.text+0x2): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_comm_rank':
ampi_interface_mlton.c:(.text+0x9): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_get_source':
ampi_interface_mlton.c:(.text+0x11): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_get_tag':
ampi_interface_mlton.c:(.text+0x1c): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_get_count':
ampi_interface_mlton.c:(.text+0x27): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_write_buffer':
ampi_interface_mlton.c:(.text+0x38): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
ampi_interface_mlton.c:(.text+0x60): relocation truncated to fit:
R_X86_64_PC32 against `.bss'
/tmp/fileUoLkXN.o: In function `ampi_read_buffer':
ampi_interface_mlton.c:(.text+0x8d): additional relocation overflows
omitted from the output
collect2: ld returned 1 exit status
   Link raised in 0.13 + 0.00 (0% GC)
   Link raised: Fail
MLton raised in 10.86 + 4.38 (29% GC)
MLton raised: Fail
call to system failed with exit status 1:
gcc -o makespec /tmp/fileeFQzBJ.o /tmp/fileCXMKcs.o /tmp/fileNKJ89G.o
/tmp/fileSG5tLs.o /tmp/filelBmNve.o /tmp/filew8NCvz.o
/tmp/fileHL1K7s.o /tmp/fileUoLkXN.o /tmp/fileZS2MEL.o
-L/usr/lib/mlton/targets/self -lmlton -lgdtoa -lm -lgmp -m64
-mmodel=medium -fPIC -static


The mlton command line I'm using is:

mlton @MLton fixed-heap 800m -- -link-opt '-mmodel=medium -fPIC
-static' -verbose 1 -codegen amd64 -const 'Exn.keepHistory true'
-runtime 'ram-slop 1.0' -default-ann 'allowFFI true' makespec.sml
./execute.c ./ampi_interface_mlton.c ./svd_lin_solve.c

I've played around with the link-opt's but haven't been able to change
the outcome.

Can someone tell me what I can do to fix this?

- Lars Magnusson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.