[LLVMdev] llvm-gcc 4.0 question

Jose Rangel jrangel at arxan.com
Sat Jan 30 16:25:17 PST 2010


Thanks for responding, Duncan, and clarifying that y'all need more info
to help.

I'm trying to compile binaries on os x 10.5.8 intel hardware that are  
compatible on ppc os x 10.4.

When I include various flags to llvm-gcc, including: -m32 -arch ppc
-isysroot /Developer/SDKs/MacOS10.4u.sdk -mmacosx-version-min=10.4

I am seeing errors when compiling using llvm-gcc 4.2.

If I leave out just the -isysroot /Developer/SDKs/MacOS10.4u.sdk flag,  
then both the native gcc and llvm-gcc produced binaries on 10.4 have  
runtime bus errors.

Here are a couple of examples of the errors that are seen during  
compilation:

gcc -I/Users/build/NightlyBuild/rabbit_main/deploy/llvm-2.6-test/ 
projects/test-suite/SingleSource/UnitTests -I/Users/build/NightlyBuild/ 
rabbit_main/3rdparty/llvm-2.6-src/projects/test-suite/SingleSource/ 
UnitTests -I/Users/build/NightlyBuild/rabbit_main/deploy/llvm-2.6-test/ 
include -I/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/ 
projects/test-suite/include -I../../include -I/Users/build/ 
NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/include -D_GNU_SOURCE - 
D__STDC_LIMIT_MACROS -DNDEBUG  -O3 -O2 -m32 -arch ppc -isysroot / 
Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -fno-omit- 
frame-pointer -fno-strict-aliasing -fPIC /Users/build/NightlyBuild/ 
rabbit_main/3rdparty/llvm-2.6-src/projects/test-suite/SingleSource/ 
UnitTests/2003-05-07-VarArgs.c -lm -o Output/2003-05-07-VarArgs.native
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/RunSafely.sh -r ppcmac3x104.arxan.com -l build -rc ssh 500  
1 /dev/null Output/2003-05-07-VarArgs.out-nat Output/2003-05-07- 
VarArgs.native
/Developer/usr/bin/llvm-gcc -I/Users/build/NightlyBuild/rabbit_main/ 
deploy/llvm-2.6-test/projects/test-suite/SingleSource/UnitTests -I/ 
Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests -I/Users/build/NightlyBuild/ 
rabbit_main/deploy/llvm-2.6-test/include -I/Users/build/NightlyBuild/ 
rabbit_main/3rdparty/llvm-2.6-src/projects/test-suite/include -I../../ 
include -I/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/ 
include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -DNDEBUG   -O2 -m32 -arch  
ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version- 
min=10.4 -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -c /Users/ 
build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/test- 
suite/SingleSource/UnitTests/2003-05-07-VarArgs.c -o Output/2003-05-07- 
VarArgs.bc -emit-llvm
In file included from /Users/build/NightlyBuild/rabbit_main/3rdparty/ 
llvm-2.6-src/projects/test-suite/SingleSource/UnitTests/2003-05-07- 
VarArgs.c:2:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
stdarg.h: No such file or directory/Users/build/NightlyBuild/ 
rabbit_main/3rdparty/llvm-2.6-src/projects/test-suite/SingleSource/ 
UnitTests/2003-05-07-VarArgs.c: In function 'test':
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:30: error:  
expected expression before 'char'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:30: warning:  
assignment makes pointer from integer without a cast
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:34: error:  
expected expression before 'int'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:38: error:  
expected expression before 'double'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:41: error:  
expected expression before'long'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:46: error:  
expected expression before'int'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:50: error:  
expected expression before 'DWordS'
/Users/build/NightlyBuild/rabbit_main/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/UnitTests/2003-05-07-VarArgs.c:50: error:  
incompatible types in assignment


Developer/usr/bin/llvm-g++ -I/Users/build/NightlyBuild/llvm_root/ 
deploy/llvm-2.6-test/projects/test-suite/SingleSource/Regression/C++ - 
I/Users/build/NightlyBuild/llvm_root/3rdparty/llvm-2.6-src/projects/ 
test-suite/SingleSource/Regression/C++ -I/Users/build/NightlyBuild/ 
llvm_root/deploy/llvm-2.6-test/include -I/Users/build/NightlyBuild/ 
llvm_root/3rdparty/llvm-2.6-src/projects/test-suite/include -I../../../ 
include -I/Users/build/NightlyBuild/llvm_root/3rdparty/llvm-2.6-src/ 
include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -DNDEBUG   -O2 -m32 -arch  
ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version- 
min=10.4 -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -c /Users/ 
build/NightlyBuild/llvm_root/3rdparty/llvm-2.6-src/projects/test-suite/ 
SingleSource/Regression/C++/ofstream_ctor.cpp -o Output/ 
ofstream_ctor.bc -emit-llvm
In file included from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/ 
wchar.h:112,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/cwchar:54,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/bits/postypes.h:46,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/iosfwd:49,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/ios:43,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/istream:44,
                  from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/ 
4.0.0/fstream:44,
                  from /Users/build/NightlyBuild/llvm_root/3rdparty/ 
llvm-2.6-src/projects/test-suite/SingleSource/Regression/C++/ 
ofstream_ctor.cpp:2:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
stdarg.h: No such file or directory
make[4]: *** [Output/ofstream_ctor.bc] Error 1


Thanks,

Jose

---

Hi Jose,

> I think Dale meant to post this to ask the whole group, instead of 
> just me. Basically, I'd like to build llvm-gcc 4.2 on host 
> i686-apple-darwin9 for target powerpc-apple-darwin8. So far my efforts

> have failed. If you know the answer or can point me in the right 
> direction, I'd be much obliged.

without details of what you did and how it fails, nobody is likely to be
able to help you.

Best wishes,

Duncan.




More information about the llvm-dev mailing list