[Yhc] build on x86-64 fails with undefined references

Tom Shackell shackell at cs.york.ac.uk
Thu Sep 14 07:02:55 EDT 2006


Hi Kartik,

Yhc does indeed work on (fully) 64-bit platforms but apparently not on 
32-bit distros running on 64-bit kernels.

We suspect the problem is that the architecture detects x86_64 (from the 
kernel) and then builds for that. But then nothing links because you 
don't have the 64bit development libraries. This is why your uname hack 
works, it makes the build script think you're running an x86 kernel.

In the long run you're probably better off sticking with either both 
64bit kernel and distro or both 32bit. I suspect you'll get a lot of 
trouble trying to build almost anything with a 'mixed' system. It's also 
worth remembering 64bit is still quite capable of running 32bit 
applications in Ubuntu (I run 64-bit ubuntu).

Anyhow, I've asked Andrew to add an option to the build to force the 
architecture. When that's done you should be able to repull the source 
and try rebuilding with:

	scons arch=x86

Hope that helps.


Tom


Kartik Vaddadi wrote:
> Hello,
> I have a 32-bit distro (Kubuntu 6.10) running on a 64-bit kernel. The yhc 
> build fails with 'undefined reference' errors.
> 
>> scons: Reading SConscript files ...
>> Checking for architecture... x86_64
>> Checking for operating system... linux2
>> Bootstrapping...
>> Done.
>> scons: done reading SConscript files.
>> scons: Building targets ...
>> gcc -o inst/bin/yhi src/runtime/BCKernel/sanity.o
>> src/runtime/BCKernel/info.o src/runtime/BCKernel/iofuncs.o
>> src/runtime/BCKernel/external.o src/runtime/BCKernel/profile.o
>> src/runtime/BCKernel/integer.o src/runtime/BCKernel/hsffi.o
>> src/runtime/BCKernel/foreign.o src/runtime/BCKernel/jonkers.o
>> src/runtime/BCKernel/mutator.o src/runtime/BCKernel/process.o
>> src/runtime/BCKernel/stable.o src/runtime/BCKernel/module.o
>> src/runtime/BCKernel/primitive.o src/runtime/BCKernel/main.o
>> src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/pretty.o
>> src/runtime/BCKernel/thread.o src/runtime/BCKernel/stopcopy.o
>> src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o
>> src/runtime/BCKernel/heap.o src/runtime/BCKernel/builtin/Array.o
>> src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/Prelude.o
>> src/runtime/BCKernel/builtin/FFI.o
>> src/runtime/BCKernel/builtin/RuntimeAPI.o
>> src/runtime/BCKernel/builtin/Concurrent.o
>> src/runtime/BCKernel/builtin/System.o
>> src/runtime/BCKernel/builtin/PackedString.o
>> depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o
>> depends/ctypes/libffi/src/x86/ffi64.o
>> depends/ctypes/libffi/src/x86/unix64.o depends/ctypes/libffi/src/x86/sysv.o
>> -L/usr/local/lib -lgmp -lm -lpthread -ldl src/runtime/BCKernel/hsffi.o: In
>> function `hsffi_call':hsffi.c:(.text+0x3a1): undefined reference to
>> `ffi_call' src/runtime/BCKernel/hsffi.o: In function
>> `hsffi_evalContext':hsffi.c:(.text+0x439): undefined reference to
>> `ffi_call' depends/ctypes/libffi/src/prep_cif.o: In function
>> `ffi_prep_cif':prep_cif.c:(.text+0x20c): undefined reference to
>> `ffi_prep_cif_machdep' depends/ctypes/libffi/src/x86/sysv.o: In function
>> `ffi_closure_SYSV':depends/ctypes/libffi/src/x86/sysv.S:(.text+0x8a):
>> undefined reference to `ffi_closure_SYSV_inner' collect2: ld returned 1
>> exit status
>> scons: *** [inst/bin/yhi] Error 1
>> scons: building terminated because of errors.
> 
> I replaced uname (in /bin) with a version that prints "i386" for the 
> architecture rather than "x86_64", and the build succeeds, with warnings 
> (some ffi-related).
> 
> But I'm not sure if my uname hack is a good idea (could it break builds of 
> other software?)
> 
> Does yhc support 64-bit architectures? And since my distribution is 32-bit, 
> will a 64-bit binary run at all?
> 
> Do you advise me to use a 32-bit kernel with yhc? Thanks a lot.
> 



More information about the Yhc mailing list