[gambit-list] A couple of random questions

Marc Feeley feeley at iro.umontreal.ca
Sun Jul 31 18:14:36 EDT 2011


On 2011-07-31, at 4:48 PM, mikel evins wrote:

> 
> On Jul 31, 2011, at 6:50 AM, Marc Feeley wrote:
> 
>> I have encountered this problem also (with Lion and the new Xcode).  The problem is due to LLVM gcc which is the default C compiler now and which does not compile the Gambit sources properly when the --enable-single-host configure option is given.  I've tried using gdb to find where the error is, but it is giving me an execution trace which doesn't correlate with the sources so I am confused in regards to the location of the error.
>> 
>> So to fix the problem temporarily I did
>> 
>>  CC="i686-apple-darwin11-gcc-4.2.1" ./configure --enable-single-host
>>  make
>>  make check
>> 
>> I also committed a patch to look for "i686-apple-darwin11-gcc-4.2.1" before "gcc", but that is not a long term solution.
>> 
>> My guess is that LLVM gcc is buggy, but I have not yet found a proof.
> 
> Using the above workaround, I certainly get farther than before. I can make it through the make check without crashes or errors.
> 
> After that, I tried this:
> 
> 1. rm examples/iOS/Prefix.pch (needed because otherwise make update fails when git is unable to update that file)
> 
> 2. make update
> 
> 3. cd examples/iOS
> 
> 4. make examples
> 
> 5. ./build-gambit-iOS
> 
> 
> A cursory examination seems to show that these steps all succeeded, but I'm unable to run Gambit-REPL in the iPad or iPhone simulator. It launches and immediately crashes, complaining that it can't access memory address 1.
> 
> Perhaps I need to alter the Makefiles used in the iOS build to ensure that LLVM is not used? Or perhaps I overlooked some other step?

Indeed the build-gambit-iOS script also has to be modified to avoid LLVM gcc.  That can be achieved by changing the lines:

  case "$kind$platform_type" in

           iPhoneOS) config_options_extras=--host=arm-apple-darwin
                     ;;

    iPhoneSimulator) config_options_extras=
                     ;;

  esac

  export CC="$ios_platform_dir/Developer/usr/bin/gcc -isysroot $ios_sdk_dir -arch $arch"
  export CXX="$ios_platform_dir/Developer/usr/bin/g++ -isysroot $ios_sdk_dir -arch $arch"

to

  case "$kind$platform_type" in

           iPhoneOS) config_options_extras=--host=arm-apple-darwin
                     export CC="$ios_platform_dir/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -isysroot $ios_sdk_dir -arch $arch"
                     export CXX="$ios_platform_dir/Developer/usr/bin/arm-apple-darwin10-g++-4.2.1 -isysroot $ios_sdk_dir -arch $arch"
                     ;;

    iPhoneSimulator) config_options_extras=
                     export CC="$ios_platform_dir/Developer/usr/bin/i686-apple-darwin11-gcc-4.2.1 -isysroot $ios_sdk_dir -arch $arch"
                     export CXX="$ios_platform_dir/Developer/usr/bin/i686-apple-darwin11-g++-4.2.1 -isysroot $ios_sdk_dir -arch $arch"
                     ;;

  esac

I wonder why Apple is moving to LLVM gcc.  I've read somewhere that Apple thinks gcc is more buggy than LLVM gcc, and that it generates better code.  At least for compiling Gambit, this seems to be a mistaken belief on both counts.

Marc




More information about the Gambit-list mailing list