Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.1.0
-
None
-
OSX Mountain Lion, Xcode 4.6
Description
First off, the -sdk flag passed to configure has changed, and no longer supports setting an sdk root directly – instead you have to place the 10.6 SDK inside the Xcode SDKs directory. This is annoying as it means use of that SDK cannot be part of an automated script since copying it to that dir requires root access.
Second, the version of g++ used by xcrun does not properly support the 10.6 sdk:
./configure -developer-build -release -opensource -confirm-license -shared -nomake examples -nomake demos -nomake docs -no-c++11 -platform macx-g++ -sdk macosx10.6 -v
...
Determining architecture... ()
/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -c -pipe -g -gdwarf-2 -Wall -W -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -fPIE -I../../mkspecs/macx-g++ -I. -o arch.o arch.cpp
/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -o arch arch.o
ld: library not found for -lstdc++
collect2: ld returned 1 exit status
make: *** [arch] Error 1
Unable to determine architecture!
This seems to come down to the change to use xcrun. Trying to use xcrun on an empty test.cpp (just has a main()):
$ xcrun -sdk macosx10.6 g++ test.cpp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -o test
ld: library not found for -lstdc++
collect2: ld returned 1 exit status
vs. using the g++ in the PATH (/usr/bin/g++)
$ g++ test.cpp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -o test $