AW: GHC and Panther (Mac OS X 10.3)

try using (sudo) gcc-select 2 Cheers, Markus
-----Ursprüngliche Nachricht----- Von: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] Im Auftrag von Thomas Davie Gesendet: Donnerstag, 20. November 2003 02:07 An: haskell-cafe@haskell.org Betreff: GHC and Panther (Mac OS X 10.3)
Hi, I've just upgraded to OS X 10.3 and have been having some problems with ghc. I'm using ghc 5.04.3 because it is compatible with hat - I'm doing a uni project on hat at the moment, so it's critical that it works. When I attempt to build hmake using ghc I get a whole load of errors like these:
ghc -DUSE_READLINE=1 -L/sw/lib/ -lreadline -I/sw/include -package lang -c -o /Users/tatd100/Documents/Work/Project/Tools/hmake-3.08/targets /powerpc- Darwin7/obj/hmake/QSort.o QSort.hs slow-fast dropthrough not mangled _sAi_entry: addi r0,r22,12 cmplw cr7,r0,r23 ble- cr7,L11 lis r2,ha16(L_MainCapability$non_lazy_ptr) lwz r2,lo16(L_MainCapability$non_lazy_ptr)(r2) lwz r29,12(r2) b L12 L11: lwz r15,0(r22) lwz r16,4(r22) lwz r17,8(r22) addi r22,r22,12 lis r2,ha16(L_sAi_fast3$non_lazy_ptr) lwz r29,lo16(L_sAi_fast3$non_lazy_ptr)(r2) L12: mtctr r29 bctr .align 2 .section __TEXT,__text,regular,pure_instructions
Which eventually drop down to one error that kills the whole process:
ghc -DUSE_READLINE=1 -L/sw/lib/ -lreadline -I/sw/include -package lang -c -cpp -o /Users/tatd100/Documents/Work/Project/Tools/hmake-3.08/targets /powerpc- Darwin7/obj/hmake/Compat.o Compat.hs Compat.hs:1: parse error on input `#' make[1]: *** [/Users/tatd100/Documents/Work/Project/Tools/hmake-3.08/targets/ powerpc-Darwin7/obj/hmake/Compat.o] Error 1 make: *** [targets/powerpc-Darwin7/hmake-ghc] Error 2
I'm guessing that there's some binary compatibility issues here... Could it be panther using gcc3.3?
Thanks
Bob
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi again, Just to let you know that the responses did set me down the right path to get hmake to make - it needed me to use "sudo gcc_select 3" (to select gcc 3.1 as opposed to 3.3), there were still errors with gcc2. Just out of interest though, the step below seemed to get rid of the main error when I was compiling with gcc3.3, (although still left a lot of messages). It finally broke when hmake tried to bootstrap it's self and decided that the -p meant try to load the package gcc3, does anyone have any idea how to get round that? On 20 Nov 2003, at 05:03, ozone@algorithm.com.au wrote:
This looks very much like a bug that a few other people have encountered with GHC and Panther; try adding
-pgmP "gcc3 -E -traditional"
to your commandline, which will use the gcc 3.1 pre-processor. (Apple's cpp-3.3 adds some extra line and debugging information to the output, which is harmless in C but interacts badly with Haskell syntax.)
Thanks a lot Bob

Thomas Davie
It finally broke when hmake tried to bootstrap it's self and decided that the -p meant try to load the package gcc3, does anyone have any idea how to get round that?
-pgmP "gcc3 -E -traditional"
My guess is that hmake is interpreting this as two separate arguments, rather than a single option to be passed through to the compiler. So you need somehow to hide these options from the hmake command-line, using a different mechanism to pass them to the compiler. (1) You could create a shell alias for ghc to always add the necessary arguments e.g. (in bash) alias ghc ghc -pgmP "gcc3 -E -traditional" (but beware of different behaviours in non-interactive shells). (2) You could add the extra arguments into hmake's configuration. e.g. in lib/powerpc-Darwin/hmakerc change , extraCompilerFlags = [] to , extraCompilerFlags = ["-pgmP \"gcc3 -E -traditional\""] and make sure that the extra arguments also appear in the finally-installed hmakerc file. (3) You could add the options into the HFLAGS environment variable e.g. (in bash) HFLAGS="-pgmP \"gcc3 -E -traditional\"" export HFLAGS The HFLAGS variable is expanded into the compiler's commandline by hmake. Regards, Malcolm
participants (3)
-
Malcolm Wallace
-
Markus.Schnell@infineon.com
-
Thomas Davie