
Here are some observations about yhc's build system. (1) "scons install" doesn't seem to install anything. How do I install yhc to a standard location after building it? (2) If there is a problem with any of the scons configuration steps (e.g. libgmp or wrong version of ghc found), then "scons help" does not work at all. I thus had several days of chasing configuration issues before I could even get scons to give me its usage message! (3) There seems to be no way to tell scons to use a particular version of ghc to bootstrap with, if I happen to have several installed and want to use a specific one. (This is especially a problem if my default version is too old for yhc, like ghc-6.2.2, but for other software I don't want to change the default.) (4) There seems to be no way to tell scons to use specific build options e.g. on my powerpc G5, it would be useful to give -mcpu=g5 to all C compilations, so that it will link properly against the 64-bit libgmp that is installed. I can imagine wanting to give a bunch of options to the haskell compiler we are bootstrapping with too. Would these be difficult to fix? Regards, Malcolm

On 2/12/07, Malcolm Wallace
(1) "scons install" doesn't seem to install anything. How do I install yhc to a standard location after building it?
It should print a message about being installed on an unsupported system. Not having a Mac machine to test on, or having any clue about where things should live means I can't write the installer portion of the build system. (2) If there is a problem with any of the scons configuration steps
(e.g. libgmp or wrong version of ghc found), then "scons help" does not work at all. I thus had several days of chasing configuration issues before I could even get scons to give me its usage message!
I've fixed this now. (3) There seems to be no way to tell scons to use a particular version
of ghc to bootstrap with, if I happen to have several installed and want to use a specific one. (This is especially a problem if my default version is too old for yhc, like ghc-6.2.2, but for other software I don't want to change the default.)
You can now run scons and add a ghc=<path to ghc> options. (4) There seems to be no way to tell scons to use specific build options
e.g. on my powerpc G5, it would be useful to give -mcpu=g5 to all C compilations, so that it will link properly against the 64-bit libgmp that is installed. I can imagine wanting to give a bunch of options to the haskell compiler we are bootstrapping with too.
This has always been supported, but only just documented :-) Yhc picks up the CCFLAGS environment variable. Simply build as: CCFLAGS="-mcpu=g5" scons It also supports GHCFLAGS and LIBPATH, which pass options to GHC and the linker's search path respectively. Cheers, Andrew

"Andrew Wilkinson"
(1) "scons install" doesn't seem to install anything. How do I install yhc to a standard location after building it?
It should print a message about being installed on an unsupported system. Not having a Mac machine to test on, or having any clue about where things should live means I can't write the installer portion of the build system.
Yes, it does say something like Sorry, don't know how to install on your platform. five or six lines before the end of the output (but I didn't see it at first). Installation on a Mac should be pretty much the same as on Linux, or any other unix-like platform. e.g. /usr/local/bin and /usr/local/include, or elsewhere if there was a --prefix= option. By the way, there is no "scons install" target listed in the help message.
(2) If there is a problem with any of the scons configuration steps
then "scons help" does not work at all.
I've fixed this now.
Excellent! Yes, this bit works now.
(3) There seems to be no way to tell scons to use a particular version
of ghc to bootstrap with,
You can now run scons and add a ghc=<path to ghc> options.
Great. Looks good.
(4) There seems to be no way to tell scons to use specific build options
This has always been supported, but only just documented :-) Yhc picks up the CCFLAGS environment variable. Simply build as: CCFLAGS="-mcpu=g5" scons
Right. Unfortunately, scons does not seem to respect the CCFLAGS variable when it is doing its own configuration tests. So on my machine, scons cannot recognise the installed libgmp, because the test for it requires certain C flags (-m64) to succeed, but these are not passed through. Regards, Malcolm

On 2/13/07, Malcolm Wallace
It should print a message about being installed on an unsupported system. Not having a Mac machine to test on, or having any clue about where things should live means I can't write the installer portion of the build system.
Yes, it does say something like Sorry, don't know how to install on your platform. five or six lines before the end of the output (but I didn't see it at first).
If you run scons as scons -s then you won't get those extra lines. They're a scons thing and unfortunately the script has no control over them. Installation on a Mac should be pretty much the same as on Linux, or any
other unix-like platform. e.g. /usr/local/bin and /usr/local/include, or elsewhere if there was a --prefix= option.
I've enabled this for the Mac too. Hope it doesn't break anything! Just run 'scons install' to install into /usr/local or add prefix=path to install somewhere else. By the way, there is no "scons install" target listed in the help message. I've now added this.
(4) There seems to be no way to tell scons to use specific build options
This has always been supported, but only just documented :-) Yhc picks up the CCFLAGS environment variable. Simply build as: CCFLAGS="-mcpu=g5" scons
Right. Unfortunately, scons does not seem to respect the CCFLAGS variable when it is doing its own configuration tests. So on my machine, scons cannot recognise the installed libgmp, because the test for it requires certain C flags (-m64) to succeed, but these are not passed through.
This should now work. Cheers, Andrew

"Andrew Wilkinson"
picks up the CCFLAGS environment variable. Simply build as: CCFLAGS="-mcpu=g5" scons
Right. Unfortunately, scons does not seem to respect the CCFLAGS variable when it is doing its own configuration tests. So on my machine, scons cannot recognise the installed libgmp, because the test for it requires certain C flags (-m64) to succeed, but these are not passed through.
This should now work.
Actually, it still does not work. In the meantime, I worked out how to disable the config test for libgmp, which enabled me to discover in addition that although the CCFLAGS variable is given to the C compiler when building C files, it is not given to the C compiler when linking those object files together. Thanks for looking into all this! Regards, Malcolm

On 2/13/07, Malcolm Wallace
Actually, it still does not work. In the meantime, I worked out how to disable the config test for libgmp, which enabled me to discover in addition that although the CCFLAGS variable is given to the C compiler when building C files, it is not given to the C compiler when linking those object files together.
Can you post the complete output of scons when trying to build? CCFLAGS are passed for me... andrew

"Andrew Wilkinson"
in addition that although the CCFLAGS variable is given to the C compiler when building C files, it is not given to the C compiler when linking those object files together.
Can you post the complete output of scons when trying to build? CCFLAGS are passed for me...
Attached below Regards, Malcolm ---- $ CCFLAGS=-m64 scons scons: Reading SConscript files ... Building version 0.7.0-20070213121534-custom. Checking for architecture... ppc Checking for operating system... darwin Adding '-m64' to CCFLAGS. Checking for architecture... ppc Checking for operating system... darwin Checking for Subversion binary... "svn" Checking for Subversion version... Found version 1.3.1. Checking for GHC binary... "ghc" Checking for GHC version 6.4.1 or later... Found version 6.6. Checking for C header file gmp.h... yes Checking for mpz_t integ; mpz_init (integ) in C library gmp... no Checking for mpz_t integ; mpz_init (integ) in C library GMP... no Error. libgmp must be installed made accessible before you can compile Yhc. Checking for libgmp version... failed Bootstrapping... Done. scons: done reading SConscript files. scons: Building targets ... gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/cfield.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/ffi_darwin.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/prep_cif.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/basepath.o src/runtime/BCKernel/basepath.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/external.o src/runtime/BCKernel/external.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/foreign.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/hashtable.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/heap.o src/runtime/BCKernel/heap.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/hsffi.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/info.o src/runtime/BCKernel/info.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/integer.o src/runtime/BCKernel/integer.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/iofuncs.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/jonkers.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/main.o src/runtime/BCKernel/main.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/make.o src/runtime/BCKernel/make.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/mark.o src/runtime/BCKernel/mark.c src/runtime/BCKernel/mark.c: In function 'mark_rec': src/runtime/BCKernel/mark.c:238: warning: unused variable 'indent' gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/module.o src/runtime/BCKernel/module.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/mutator.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/pretty.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/primitive.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/process.o src/runtime/BCKernel/process.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/profile.o src/runtime/BCKernel/profile.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/sanity.c src/runtime/BCKernel/sanity.c: In function 'sanity_init': src/runtime/BCKernel/sanity.c:59: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' src/runtime/BCKernel/sanity.c:59: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stable.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/stopcopy.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/thread.o src/runtime/BCKernel/thread.c src/runtime/BCKernel/thread.c: In function 'yhi_semaphore_create': src/runtime/BCKernel/thread.c:134: warning: comparison between pointer and integer gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Array.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/Concurrent.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/FFI.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IO.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/IORef.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/PackedString.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/Prelude.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/RuntimeAPI.c gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213121534-custom\" -DPOWERPC_DARWIN -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/System.o src/runtime/BCKernel/builtin/System.c gcc -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl /usr/bin/ld: truncated or malformed archive: /sw/lib/libgmp.a (ranlib structures in table of contents extends past the end of the table of contents, can't load from it) /usr/bin/ld: src/runtime/BCKernel/basepath.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/external.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/foreign.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/hashtable.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/heap.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/hsffi.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/info.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/integer.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/iofuncs.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/jonkers.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/main.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/make.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/mark.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/module.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/mutator.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/pretty.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/primitive.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/process.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/profile.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/sanity.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/stable.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/stopcopy.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/thread.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/Array.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/Concurrent.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/FFI.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/IO.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/IORef.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/PackedString.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/Prelude.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/RuntimeAPI.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/builtin/System.o bad magic number (not a Mach-O file) /usr/bin/ld: depends/ctypes/libffi/src/prep_cif.o bad magic number (not a Mach-O file) /usr/bin/ld: depends/ctypes/libffi/src/cfield.o bad magic number (not a Mach-O file) /usr/bin/ld: depends/ctypes/libffi/src/powerpc/ffi_darwin.o bad magic number (not a Mach-O file) collect2: ld returned 1 exit status scons: *** [inst/bin/yhi] Error 1 scons: building terminated because of errors.

Malcolm Wallace
in addition that although the CCFLAGS variable is given to the C compiler when building C files, it is not given to the C compiler when linking those object files together.
CCFLAGS are passed for me...
Actually, I see you did push a patch for that already, thanks. However, I have found another instance (this time in building libffi) where the crucial flag is not passed through to the compiler. It is for the two platform-specific files depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o (on the last two lines of the attached log) Regards, Malcolm ---- $ CCFLAGS=-m64 scons scons: Reading SConscript files ... Building version 0.7.0-20070213181100-custom. Checking for architecture... ppc Checking for operating system... darwin Adding '-m64' to CCFLAGS. Checking for architecture... ppc Checking for operating system... darwin Checking for Subversion binary... "svn" Checking for Subversion version... Found version 1.3.1. Checking for GHC binary... "ghc" Checking for GHC version 6.4.1 or later... Found version 6.6. Checking for C header file gmp.h... yes Checking for mpz_t integ; mpz_init (integ) in C library gmp... yes Checking for libgmp version... 4.1.4 Checking for Python version 2.3 or later... Found version 2.3.5 final (0). Checking for Scons binary... "scons" Checking for Scons version... Found version 0.96.1.D001. Checking for Darcs binary... "darcs" Checking for Darcs version... Found version 1.0.5 (release). Checking for Haddock binary... "haddock" Checking for Haddock version... Found version 0.8. Checking whether byte ordering is bigendian... yes Checking size of char... .sconf_temp/conftest_4.c: In function 'main': .sconf_temp/conftest_4.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 1 Checking size of short... .sconf_temp/conftest_5.c: In function 'main': .sconf_temp/conftest_5.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 2 Checking size of int... .sconf_temp/conftest_6.c: In function 'main': .sconf_temp/conftest_6.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 4 Checking size of long... .sconf_temp/conftest_7.c: In function 'main': .sconf_temp/conftest_7.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 8 Checking size of long long... .sconf_temp/conftest_8.c: In function 'main': .sconf_temp/conftest_8.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 8 Checking size of float... .sconf_temp/conftest_9.c: In function 'main': .sconf_temp/conftest_9.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 4 Checking size of double... .sconf_temp/conftest_10.c: In function 'main': .sconf_temp/conftest_10.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 8 Checking size of void*... .sconf_temp/conftest_11.c: In function 'main': .sconf_temp/conftest_11.c:5: warning: format '%i' expects type 'int', but argument 2 has type 'long unsigned int' 8 Checking for pthread_create() in C library pthread... yes Generating config.h with the following settings: WORDS_BIGENDIAN True HAVE_LIBPTHREAD 1 SIZEOF_LONG_LONG 8 SIZEOF_LONG 8 WIN32 0 SIZEOF_VOIDP 8 SIZEOF_CHAR 1 SIZEOF_DOUBLE 8 SIZEOF_FLOAT 4 SIZEOF_INT 4 HAVE_GCC_LABELS 1 SIZEOF_SHORT 2 darcs get --partial --repo-name=depends/cpphs http://www.cs.york.ac.uk/fp/darcs/cpphs Copying patch 1 of 41...Copying patch 2 of 41...Copying patch 3 of 41...Copying patch 4 of 41...Copying patch 5 of 41...Copying patch 6 of 41...Copying patch 7 of 41...Copying patch 8 of 41...Copying patch 9 of 41...Copying patch 10 of 41...Copying patch 11 of 41...Copying patch 12 of 41...Copying patch 13 of 41...Copying patch 14 of 41...Copying patch 15 of 41...Copying patch 16 of 41...Copying patch 17 of 41...Copying patch 18 of 41...Copying patch 19 of 41...Copying patch 20 of 41...Copying patch 21 of 41...Copying patch 22 of 41...Copying patch 23 of 41...Copying patch 24 of 41...Copying patch 25 of 41...Copying patch 26 of 41...Copying patch 27 of 41...Copying patch 28 of 41...Copying patch 29 of 41...Copying patch 30 of 41...Copying patch 31 of 41...Copying patch 32 of 41...Copying patch 33 of 41...Copying patch 34 of 41...Copying patch 35 of 41...Copying patch 36 of 41...Copying patch 37 of 41...Copying patch 38 of 41...Copying patch 39 of 41...Copying patch 40 of 41...Copying patch 41 of 41...Copying patch 41 of 41... done! Applying patch 1 of 40... Applying patch 2 of 40... Applying patch 3 of 40... Applying patch 4 of 40... Applying patch 5 of 40... Applying patch 6 of 40... Applying patch 7 of 40... Applying patch 8 of 40... Applying patch 9 of 40... Applying patch 10 of 40... Applying patch 11 of 40... Applying patch 12 of 40... Applying patch 13 of 40... Applying patch 14 of 40... Applying patch 15 of 40... Applying patch 16 of 40... Applying patch 17 of 40... Applying patch 18 of 40... Applying patch 19 of 40... Applying patch 20 of 40... Applying patch 21 of 40... Applying patch 22 of 40... Applying patch 23 of 40... Applying patch 24 of 40... Applying patch 25 of 40... Applying patch 26 of 40... Applying patch 27 of 40... Applying patch 28 of 40... Applying patch 29 of 40... Applying patch 30 of 40... Applying patch 31 of 40... Applying patch 32 of 40... Applying patch 33 of 40... Applying patch 34 of 40... Applying patch 35 of 40... Applying patch 36 of 40... Applying patch 37 of 40... Applying patch 38 of 40... Applying patch 39 of 40... Applying patch 40 of 40... done. Finished getting. darcs get --partial --repo-name=depends/filepath http://www.cs.york.ac.uk/fp/darcs/filepath Copying patch 1 of 138...Copying patch 2 of 138...Copying patch 3 of 138...Copying patch 4 of 138...Copying patch 5 of 138...Copying patch 6 of 138...Copying patch 7 of 138...Copying patch 8 of 138...Copying patch 9 of 138...Copying patch 10 of 138...Copying patch 11 of 138...Copying patch 12 of 138...Copying patch 13 of 138...Copying patch 14 of 138...Copying patch 15 of 138...Copying patch 16 of 138...Copying patch 17 of 138...Copying patch 18 of 138...Copying patch 19 of 138...Copying patch 20 of 138...Copying patch 21 of 138...Copying patch 22 of 138...Copying patch 23 of 138...Copying patch 24 of 138...Copying patch 25 of 138...Copying patch 26 of 138...Copying patch 27 of 138...Copying patch 28 of 138...Copying patch 29 of 138...Copying patch 30 of 138...Copying patch 31 of 138...Copying patch 32 of 138...Copying patch 33 of 138...Copying patch 34 of 138...Copying patch 35 of 138...Copying patch 36 of 138...Copying patch 37 of 138...Copying patch 38 of 138...Copying patch 39 of 138...Copying patch 40 of 138...Copying patch 41 of 138...Copying patch 42 of 138...Copying patch 43 of 138...Copying patch 44 of 138...Copying patch 45 of 138...Copying patch 46 of 138...Copying patch 47 of 138...Copying patch 48 of 138...Copying patch 49 of 138...Copying patch 50 of 138...Copying patch 51 of 138...Copying patch 52 of 138...Copying patch 53 of 138...Copying patch 54 of 138...Copying patch 55 of 138...Copying patch 56 of 138...Copying patch 57 of 138...Copying patch 58 of 138...Copying patch 59 of 138...Copying patch 60 of 138...Copying patch 61 of 138...Copying patch 62 of 138...Copying patch 63 of 138...Copying patch 64 of 138...Copying patch 65 of 138...Copying patch 66 of 138...Copying patch 67 of 138...Copying patch 68 of 138...Copying patch 69 of 138...Copying patch 70 of 138...Copying patch 71 of 138...Copying patch 72 of 138...Copying patch 73 of 138...Copying patch 74 of 138...Copying patch 75 of 138...Copying patch 76 of 138...Copying patch 77 of 138...Copying patch 78 of 138...Copying patch 79 of 138...Copying patch 80 of 138...Copying patch 81 of 138...Copying patch 82 of 138...Copying patch 83 of 138...Copying patch 84 of 138...Copying patch 85 of 138...Copying patch 86 of 138...Copying patch 87 of 138...Copying patch 88 of 138...Copying patch 89 of 138...Copying patch 90 of 138...Copying patch 91 of 138...Copying patch 92 of 138...Copying patch 93 of 138...Copying patch 94 of 138...Copying patch 95 of 138...Copying patch 96 of 138...Copying patch 97 of 138...Copying patch 98 of 138...Copying patch 99 of 138...Copying patch 100 of 138...Copying patch 101 of 138...Copying patch 102 of 138...Copying patch 103 of 138...Copying patch 104 of 138...Copying patch 105 of 138...Copying patch 106 of 138...Copying patch 107 of 138...Copying patch 108 of 138...Copying patch 109 of 138...Copying patch 110 of 138...Copying patch 111 of 138...Copying patch 112 of 138...Copying patch 113 of 138...Copying patch 114 of 138...Copying patch 115 of 138...Copying patch 116 of 138...Copying patch 117 of 138...Copying patch 118 of 138...Copying patch 119 of 138...Copying patch 120 of 138...Copying patch 121 of 138...Copying patch 122 of 138...Copying patch 123 of 138...Copying patch 124 of 138...Copying patch 125 of 138...Copying patch 126 of 138...Copying patch 127 of 138...Copying patch 128 of 138...Copying patch 129 of 138...Copying patch 130 of 138...Copying patch 131 of 138...Copying patch 132 of 138...Copying patch 133 of 138...Copying patch 134 of 138...Copying patch 135 of 138...Copying patch 136 of 138...Copying patch 137 of 138...Copying patch 138 of 138...Copying patch 138 of 138... done! Applying patch 1 of 138... Applying patch 2 of 138... Applying patch 3 of 138... Applying patch 4 of 138... Applying patch 5 of 138... Applying patch 6 of 138... Applying patch 7 of 138... Applying patch 8 of 138... Applying patch 9 of 138... Applying patch 10 of 138... Applying patch 11 of 138... Applying patch 12 of 138... Applying patch 13 of 138... Applying patch 14 of 138... Applying patch 15 of 138... Applying patch 16 of 138... Applying patch 17 of 138... Applying patch 18 of 138... Applying patch 19 of 138... Applying patch 20 of 138... Applying patch 21 of 138... Applying patch 22 of 138... Applying patch 23 of 138... Applying patch 24 of 138... Applying patch 25 of 138... Applying patch 26 of 138... Applying patch 27 of 138... Applying patch 28 of 138... Applying patch 29 of 138... Applying patch 30 of 138... Applying patch 31 of 138... Applying patch 32 of 138... Applying patch 33 of 138... Applying patch 34 of 138... Applying patch 35 of 138... Applying patch 36 of 138... Applying patch 37 of 138... Applying patch 38 of 138... Applying patch 39 of 138... Applying patch 40 of 138... Applying patch 41 of 138... Applying patch 42 of 138... Applying patch 43 of 138... Applying patch 44 of 138... Applying patch 45 of 138... Applying patch 46 of 138... Applying patch 47 of 138... Applying patch 48 of 138... Applying patch 49 of 138... Applying patch 50 of 138... Applying patch 51 of 138... Applying patch 52 of 138... Applying patch 53 of 138... Applying patch 54 of 138... Applying patch 55 of 138... Applying patch 56 of 138... Applying patch 57 of 138... Applying patch 58 of 138... Applying patch 59 of 138... Applying patch 60 of 138... Applying patch 61 of 138... Applying patch 62 of 138... Applying patch 63 of 138... Applying patch 64 of 138... Applying patch 65 of 138... Applying patch 66 of 138... Applying patch 67 of 138... Applying patch 68 of 138... Applying patch 69 of 138... Applying patch 70 of 138... Applying patch 71 of 138... Applying patch 72 of 138... Applying patch 73 of 138... Applying patch 74 of 138... Applying patch 75 of 138... Applying patch 76 of 138... Applying patch 77 of 138... Applying patch 78 of 138... Applying patch 79 of 138... Applying patch 80 of 138... Applying patch 81 of 138... Applying patch 82 of 138... Applying patch 83 of 138... Applying patch 84 of 138... Applying patch 85 of 138... Applying patch 86 of 138... Applying patch 87 of 138... Applying patch 88 of 138... Applying patch 89 of 138... Applying patch 90 of 138... Applying patch 91 of 138... Applying patch 92 of 138... Applying patch 93 of 138... Applying patch 94 of 138... Applying patch 95 of 138... Applying patch 96 of 138... Applying patch 97 of 138... Applying patch 98 of 138... Applying patch 99 of 138... Applying patch 100 of 138... Applying patch 101 of 138... Applying patch 102 of 138... Applying patch 103 of 138... Applying patch 104 of 138... Applying patch 105 of 138... Applying patch 106 of 138... Applying patch 107 of 138... Applying patch 108 of 138... Applying patch 109 of 138... Applying patch 110 of 138... Applying patch 111 of 138... Applying patch 112 of 138... Applying patch 113 of 138... Applying patch 114 of 138... Applying patch 115 of 138... Applying patch 116 of 138... Applying patch 117 of 138... Applying patch 118 of 138... Applying patch 119 of 138... Applying patch 120 of 138... Applying patch 121 of 138... Applying patch 122 of 138... Applying patch 123 of 138... Applying patch 124 of 138... Applying patch 125 of 138... Applying patch 126 of 138... Applying patch 127 of 138... Applying patch 128 of 138... Applying patch 129 of 138... Applying patch 130 of 138... Applying patch 131 of 138... Applying patch 132 of 138... Applying patch 133 of 138... Applying patch 134 of 138... Applying patch 135 of 138... Applying patch 136 of 138... Applying patch 137 of 138... Applying patch 138 of 138... done. Finished getting. svn co http://svn.python.org/projects/python/trunk/Modules/_ctypes/ depends/ctypes A depends/ctypes/libffi_arm_wince A depends/ctypes/libffi_arm_wince/fficonfig.h A depends/ctypes/libffi_arm_wince/ffitarget.h A depends/ctypes/libffi_arm_wince/ffi_common.h A depends/ctypes/libffi_arm_wince/sysv.asm A depends/ctypes/libffi_arm_wince/ffi.c A depends/ctypes/libffi_arm_wince/debug.c A depends/ctypes/libffi_arm_wince/prep_cif.c A depends/ctypes/libffi_arm_wince/ffi.h A depends/ctypes/callbacks.c A depends/ctypes/callproc.c A depends/ctypes/stgdict.c A depends/ctypes/ctypes_dlfcn.h A depends/ctypes/libffi_msvc A depends/ctypes/libffi_msvc/fficonfig.h A depends/ctypes/libffi_msvc/ffitarget.h A depends/ctypes/libffi_msvc/LICENSE A depends/ctypes/libffi_msvc/ffi_common.h A depends/ctypes/libffi_msvc/README.ctypes A depends/ctypes/libffi_msvc/win32.S A depends/ctypes/libffi_msvc/win32.c A depends/ctypes/libffi_msvc/ffi.c A depends/ctypes/libffi_msvc/types.c A depends/ctypes/libffi_msvc/win64.asm A depends/ctypes/libffi_msvc/prep_cif.c A depends/ctypes/libffi_msvc/ffi.h A depends/ctypes/libffi_msvc/README A depends/ctypes/darwin A depends/ctypes/darwin/dlfcn_simple.c A depends/ctypes/darwin/LICENSE A depends/ctypes/darwin/README.ctypes A depends/ctypes/darwin/dlfcn.h A depends/ctypes/darwin/README A depends/ctypes/malloc_closure.c A depends/ctypes/_ctypes_test.c A depends/ctypes/_ctypes.c A depends/ctypes/cfield.c A depends/ctypes/_ctypes_test.h A depends/ctypes/libffi A depends/ctypes/libffi/configure A depends/ctypes/libffi/LICENSE A depends/ctypes/libffi/configure.ac A depends/ctypes/libffi/include A depends/ctypes/libffi/include/ffi.h.in A depends/ctypes/libffi/include/ffi_common.h A depends/ctypes/libffi/fficonfig.h.in A depends/ctypes/libffi/fficonfig.py.in A depends/ctypes/libffi/src A depends/ctypes/libffi/src/powerpc A depends/ctypes/libffi/src/powerpc/ppc_closure.S A depends/ctypes/libffi/src/powerpc/darwin_closure.S A depends/ctypes/libffi/src/powerpc/ffitarget.h A depends/ctypes/libffi/src/powerpc/aix.S A depends/ctypes/libffi/src/powerpc/darwin.S A depends/ctypes/libffi/src/powerpc/ffi.c A depends/ctypes/libffi/src/powerpc/sysv.S A depends/ctypes/libffi/src/powerpc/asm.h A depends/ctypes/libffi/src/powerpc/linux64_closure.S A depends/ctypes/libffi/src/powerpc/ffi_darwin.c A depends/ctypes/libffi/src/powerpc/linux64.S A depends/ctypes/libffi/src/powerpc/aix_closure.S A depends/ctypes/libffi/src/arm A depends/ctypes/libffi/src/arm/ffitarget.h A depends/ctypes/libffi/src/arm/ffi.c A depends/ctypes/libffi/src/arm/sysv.S A depends/ctypes/libffi/src/m32r A depends/ctypes/libffi/src/m32r/ffitarget.h A depends/ctypes/libffi/src/m32r/ffi.c A depends/ctypes/libffi/src/m32r/sysv.S A depends/ctypes/libffi/src/sh64 A depends/ctypes/libffi/src/sh64/ffitarget.h A depends/ctypes/libffi/src/sh64/ffi.c A depends/ctypes/libffi/src/sh64/sysv.S A depends/ctypes/libffi/src/darwin A depends/ctypes/libffi/src/darwin/ffitarget.h A depends/ctypes/libffi/src/m68k A depends/ctypes/libffi/src/m68k/ffitarget.h A depends/ctypes/libffi/src/m68k/ffi.c A depends/ctypes/libffi/src/m68k/sysv.S A depends/ctypes/libffi/src/alpha A depends/ctypes/libffi/src/alpha/ffitarget.h A depends/ctypes/libffi/src/alpha/ffi.c A depends/ctypes/libffi/src/alpha/osf.S A depends/ctypes/libffi/src/x86 A depends/ctypes/libffi/src/x86/ffi64.c A depends/ctypes/libffi/src/x86/ffitarget.h A depends/ctypes/libffi/src/x86/win32.S A depends/ctypes/libffi/src/x86/darwin.S A depends/ctypes/libffi/src/x86/ffi.c A depends/ctypes/libffi/src/x86/sysv.S A depends/ctypes/libffi/src/x86/ffi_darwin.c A depends/ctypes/libffi/src/x86/unix64.S A depends/ctypes/libffi/src/frv A depends/ctypes/libffi/src/frv/eabi.S A depends/ctypes/libffi/src/frv/ffitarget.h A depends/ctypes/libffi/src/frv/ffi.c A depends/ctypes/libffi/src/s390 A depends/ctypes/libffi/src/s390/ffitarget.h A depends/ctypes/libffi/src/s390/ffi.c A depends/ctypes/libffi/src/s390/sysv.S A depends/ctypes/libffi/src/pa A depends/ctypes/libffi/src/pa/linux.S A depends/ctypes/libffi/src/pa/ffitarget.h A depends/ctypes/libffi/src/pa/ffi.c A depends/ctypes/libffi/src/cris A depends/ctypes/libffi/src/cris/ffitarget.h A depends/ctypes/libffi/src/cris/ffi.c A depends/ctypes/libffi/src/cris/sysv.S A depends/ctypes/libffi/src/ia64 A depends/ctypes/libffi/src/ia64/ffitarget.h A depends/ctypes/libffi/src/ia64/unix.S A depends/ctypes/libffi/src/ia64/ffi.c A depends/ctypes/libffi/src/ia64/ia64_flags.h A depends/ctypes/libffi/src/sparc A depends/ctypes/libffi/src/sparc/v9.S A depends/ctypes/libffi/src/sparc/ffitarget.h A depends/ctypes/libffi/src/sparc/ffi.c A depends/ctypes/libffi/src/sparc/v8.S A depends/ctypes/libffi/src/prep_cif.c A depends/ctypes/libffi/src/mips A depends/ctypes/libffi/src/mips/ffitarget.h A depends/ctypes/libffi/src/mips/n32.S A depends/ctypes/libffi/src/mips/o32.S A depends/ctypes/libffi/src/mips/ffi.c A depends/ctypes/libffi/src/sh A depends/ctypes/libffi/src/sh/ffitarget.h A depends/ctypes/libffi/src/sh/ffi.c A depends/ctypes/libffi/src/sh/sysv.S A depends/ctypes/libffi/config.guess A depends/ctypes/libffi/README A depends/ctypes/libffi/aclocal.m4 A depends/ctypes/libffi/config.sub A depends/ctypes/libffi/install-sh A depends/ctypes/ctypes.h Checked out revision 53777. Bootstrapping... build/SConscript.depends -> depends/SConscript build/SConscript.cpphs -> depends/cpphs/SConscript build/SConscript.filepath -> depends/filepath/SConscript build/SConscript.ctypes -> depends/ctypes/SConscript build/SConscript.libffi -> depends/ctypes/libffi/SConscript build/ffih/fficonfig.h -> depends/ctypes/libffi/fficonfig.h build/ffih/ffi.h -> depends/ctypes/libffi/include/ffi.h build/ffih/cfield.c -> depends/ctypes/libffi/src/cfield.c bootstrap/packages/yhc-base/1.0/Prelude.hi -> src/packages/yhc-base-1.0/Prelude.hi bootstrap/packages/yhc-base/1.0/PreludeBuiltin.hi -> src/packages/yhc-base-1.0/PreludeBuiltin.hi bootstrap/packages/yhc-base/1.0/YHC/Internal.hi -> src/packages/yhc-base-1.0/YHC/Internal.hi bootstrap/packages/yhc-base/1.0/Data/Ratio.hi -> src/packages/yhc-base-1.0/Data/Ratio.hi Done. scons: done reading SConscript files. scons: Building targets ... Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/CppIfdef.hs. Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/SymTab.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/SymTab.hs -o depends/cpphs/Language/Preprocessor/Cpphs/SymTab.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/Position.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/Position.hs -o depends/cpphs/Language/Preprocessor/Cpphs/Position.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/HashDefine.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/HashDefine.hs -o depends/cpphs/Language/Preprocessor/Cpphs/HashDefine.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/Tokenise.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/Tokenise.hs -o depends/cpphs/Language/Preprocessor/Cpphs/Tokenise.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/ReadFirst.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/ReadFirst.hs -o depends/cpphs/Language/Preprocessor/Cpphs/ReadFirst.o Getting dependencies for depends/cpphs/Text/ParserCombinators/HuttonMeijer.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Text/ParserCombinators/HuttonMeijer.hs -o depends/cpphs/Text/ParserCombinators/HuttonMeijer.o "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/CppIfdef.hs -o depends/cpphs/Language/Preprocessor/Cpphs/CppIfdef.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/MacroPass.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/MacroPass.hs -o depends/cpphs/Language/Preprocessor/Cpphs/MacroPass.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/Options.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/Options.hs -o depends/cpphs/Language/Preprocessor/Cpphs/Options.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs/RunCpphs.hs. Getting dependencies for depends/cpphs/Language/Preprocessor/Unlit.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Unlit.hs -o depends/cpphs/Language/Preprocessor/Unlit.o "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs/RunCpphs.hs -o depends/cpphs/Language/Preprocessor/Cpphs/RunCpphs.o Getting dependencies for depends/cpphs/Language/Preprocessor/Cpphs.hs. "ghc" -i./src/compiler98 -i./src/libraries/general -i./src/libraries/core -idepends/cpphs -idepends/filepath -i./src/interactive -package mtl -fwarn-missing-signatures -c depends/cpphs/Language/Preprocessor/Cpphs.hs -o depends/cpphs/Language/Preprocessor/Cpphs.o gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070213181100-custom\" -DPOWERPC_DARWIN -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/cfield.c gcc -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin.S gcc -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src -Idepends/ctypes/libffi/src/powerpc -Idepends/ctypes/libffi -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o depends/ctypes/libffi/src/powerpc/darwin_closure.o depends/ctypes/libffi/src/powerpc/darwin_closure.S

I have pushed a patched that may fix this. May being the important word
though...
Andrew
On 2/14/07, Malcolm Wallace
Malcolm Wallace
wrote: in addition that although the CCFLAGS variable is given to the C compiler when building C files, it is not given to the C compiler when linking those object files together.
CCFLAGS are passed for me...
Actually, I see you did push a patch for that already, thanks. However, I have found another instance (this time in building libffi) where the crucial flag is not passed through to the compiler.
It is for the two platform-specific files depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o (on the last two lines of the attached log)

"Andrew Wilkinson"
I have pushed a patched that may fix this. May being the important word though...
Yup, the linker no longer complains about the object files having the wrong format. But I'm still stuck... This time, it claims libffi does not contain some things it needs: Regards, Malcolm ---- $ CCFLAGS=-m64 scons ... gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070214152138-custom\" -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/System.o src/runtime/BCKernel/builtin/System.c gcc -m64 -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl can't resolve symbols: _ffi_call, referenced from: _hsffi_call in hsffi.o _hsffi_evalContext in hsffi.o _ffi_prep_cif_machdep, referenced from: _ffi_prep_cif in prep_cif.o ld64 failed: symbol(s) not found collect2: ld returned 1 exit status scons: *** [inst/bin/yhi] Error 1 scons: building terminated because of errors.

Hi,
I have added a new scons flag, ppc64 which will pass -m64 to the compiler
and hopefully the correct flag to libffi.
Please build as scons ppc64=1 and let me know what happens.
Cheers,
Andrew
On 2/14/07, Malcolm Wallace
"Andrew Wilkinson"
wrote: I have pushed a patched that may fix this. May being the important word though...
Yup, the linker no longer complains about the object files having the wrong format. But I'm still stuck... This time, it claims libffi does not contain some things it needs:
Regards, Malcolm
---- $ CCFLAGS=-m64 scons ... gcc -DPOWERPC_DARWIN -m64 -Wall -DVERSION=\"0.7.0-20070214152138-custom\" -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/System.o src/runtime/BCKernel/builtin/System.c gcc -m64 -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/bu iltin/Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl can't resolve symbols: _ffi_call, referenced from: _hsffi_call in hsffi.o _hsffi_evalContext in hsffi.o _ffi_prep_cif_machdep, referenced from: _ffi_prep_cif in prep_cif.o ld64 failed: symbol(s) not found collect2: ld returned 1 exit status scons: *** [inst/bin/yhi] Error 1 scons: building terminated because of errors.
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

Andrew,
I have added a new scons flag, ppc64 which will pass -m64 to the compiler and hopefully the correct flag to libffi. Please build as scons ppc64=1 and let me know what happens.
Well, it seems to fail on the linking line again, because the -m64 flag is missing there once again. $ scons ppc64=1 ... gcc -DPOWERPC_DARWIN -Wall -O -DVERSION=\"0.7.0-20070216115551-custom\" -DPOWERPC64 -m64 -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/System.o src/runtime/BCKernel/builtin/System.c gcc -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl /usr/bin/ld: truncated or malformed archive: /sw/lib/libgmp.a (ranlib structures in table of contents extends past the end of the table of contents, can't load from it) /usr/bin/ld: src/runtime/BCKernel/basepath.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/external.o bad magic number (not a Mach-O file) [ ... lots more errors like the last two ... ] Regards, Malcolm

Whoops, silly error on my part. I've pushed another patch. Please try the
new one.
Andrew
On 2/16/07, Malcolm Wallace
Andrew,
I have added a new scons flag, ppc64 which will pass -m64 to the compiler and hopefully the correct flag to libffi. Please build as scons ppc64=1 and let me know what happens.
Well, it seems to fail on the linking line again, because the -m64 flag is missing there once again.
$ scons ppc64=1 ... gcc -DPOWERPC_DARWIN -Wall -O -DVERSION=\"0.7.0-20070216115551-custom\" -DPOWERPC64 -m64 -I. -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/GMP.Framework/Headers -Idepends/ctypes/libffi/include -Idepends/ctypes/libffi/src/powerpc -c -o src/runtime/BCKernel/builtin/System.o src/runtime/BCKernel/builtin/System.c gcc -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin /Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl /usr/bin/ld: truncated or malformed archive: /sw/lib/libgmp.a (ranlib structures in table of contents extends past the end of the table of contents, can't load from it) /usr/bin/ld: src/runtime/BCKernel/basepath.o bad magic number (not a Mach-O file) /usr/bin/ld: src/runtime/BCKernel/external.o bad magic number (not a Mach-O file) [ ... lots more errors like the last two ... ]
Regards, Malcolm _______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

Now I'm back to a previously-seen error. It is possible I suppose that libffi just does not support this API for the ppc64 architecture? $ scons ppc64=1 ... gcc -DPOWERPC64 -m64 -Xlinker -lgmp -o inst/bin/yhi src/runtime/BCKernel/basepath.o src/runtime/BCKernel/external.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/process.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/IORef.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -L/usr/local/lib -L/opt/local/lib -L/Library/Frameworks/GMP.Framework -ldl can't resolve symbols: _ffi_call, referenced from: _hsffi_call in hsffi.o _hsffi_evalContext in hsffi.o _ffi_prep_cif_machdep, referenced from: _ffi_prep_cif in prep_cif.o ld64 failed: symbol(s) not found collect2: ld returned 1 exit status Regards, Malcolm
participants (2)
-
Andrew Wilkinson
-
Malcolm Wallace