Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 10.5 SDK PowerPC64 libgcc_s.10.5.dylib link errors. #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions XcodeLegacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,15 @@ EOF

if [ "$osx105" = 1 ]; then
# we also need to copy /usr/lib/libgcc_s.10.5.dylib from 10.6 SDK to 10.5SDK, see https://trac.macports.org/wiki/LeopardSDKFixes
# Do this by combining it with the PowerPC64 library from the 10.5 SDK so it doesn't break PowerPC64 builds.
# This should fix compiling the following:
# int main() { __uint128_t a = 100; __uint128_t b = 200; __uint128_t c = a / b; return 0; }
# with clang -isysroot /Developer/SDKs/MacOSX10.5.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 conftest1.c
cp /tmp/XC3-10.5/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib /tmp/XC3-10.5/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.bak
cp $SDKROOT/usr/lib/libgcc_s.10.5.dylib /tmp/XC3-10.5/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib
(cd /tmp/XC3-10.5/SDKs/MacOSX10.5.sdk/usr/lib/ &&
cp libgcc_s.10.5.dylib libgcc_s.10.5.dylib.bak &&
lipo libgcc_s.10.5.dylib.bak -extract ppc64 -output _ppc64.dylib &&
lipo -create $SDKROOT/usr/lib/libgcc_s.10.5.dylib _ppc64.dylib -output libgcc_s.10.5.dylib &&
rm _ppc64.dylib)

( (cd /tmp/XC3-10.5 || exit; tar cf - SDKs/MacOSX10.5.sdk) | gzip -c > Xcode105SDK.tar.gz) && echo "*** Created Xcode105SDK.tar.gz in directory $(pwd)"
fi
Expand Down