[LLVMbugs] [Bug 5012] New: autoconf won' t build 64-bit or universal properly on Snow Leopard

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Sep 20 03:19:01 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=5012

           Summary: autoconf won't build 64-bit or universal properly on
                    Snow Leopard
           Product: Build scripts
           Version: 2.6
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: autoconf
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ewmailing at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Using the autoconf scripts, I was trying to build llvm, clang, and llvm-gcc on
Snow Leopard.
By default, it seems that everything gets built as i386 instead of x86_64 on my
64-bit Mac. Since Snow Leopard's default is now 64-bit, this is not as useful
for me.

I tried setting the environment C*FLAGS and LDFLAGS to use -arch i386 -arch
x86_64, but part way through the build, I got errors saying the system couldn't
handle multiple architectures.

I eventually just tried -arch x86_64. I think the llvm core built 64-bit, but I
had problems with Clang and llvm-gcc. These latter components seemed to be
trying to build 32-bit and failing. I am pretty sure llvm-gcc was ignoring all
my C*FLAGS environment. I don't understand what Clang was doing.

I eventually gave up and tried the CMake system. The CMake system worked
perfectly for llvm and Clang, but llvm-gcc doesn't have a CMake description and
I couldn't the llvm-gcc autoconf system to cooperate with the CMake build.

Here is a little script of how I tried to build everything.

#!/bin/sh

CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64"
CCFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64"
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64"
CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64"
LDFLAGS="-arch x86_64"

INSTALL_PATH=/opt/local
LLVMDIR=llvm_release_26
LLVMGCCDIR=llvm-gcc-4.2_release_26
LLVMOBJDIR=`pwd`/build_llvm
EXTRALANGS=,objc,obj-c++
TARGETOPTIONS='--with-arch=nocona --with-tune=generic'
TRIPLE=i686-apple-darwin10
BUILDOPTIONS=LLVM_VERSION_INFO=2.6

mkdir -p build_llvm
cd build_llvm
../$LLVMDIR/configure --prefix=$INSTALL_PATH --enable-optimized
--enable-targets=all
--with--llvmgccdir=/Users/ewing/Source/SVN/LLVM_RELEASE26/llvm-gcc-4.2_release_26/
make -j2
cd ..

mkdir -p build_llvm-gcc
cd build_llvm-gcc
../$LLVMGCCDIR/configure --enable-optimized --prefix=$INSTALL_PATH
--program-prefix=llvm- --enable-llvm=$LLVMOBJDIR
--enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS
--with-gxx-include-dir=/usr/include/c++/4.2.1 --build=$TRIPLE --host=$TRIPLE
--target=$TRIPLE
make ENABLE_OPTIMIZED=1 $BUILDOPTIONS -j2
make install
cd ..

ln -sf /usr/lib/libstdc++.6.dylib $INSTALL_PATH/lib
ln -sf /usr/lib/libstdc++.6.dylib $INSTALL_PATH/lib/libstdc++.dylib


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list