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

Conversation

AliceLR
Copy link

@AliceLR AliceLR commented Aug 28, 2024

Fixes linking issues for PowerPC64 binaries caused by overwriting the libgcc_s.10.5.dylib in the 10.5 SDK with the equivalent library from the 10.6 SDK--which does not contain a PowerPC64 binary. This is done by copying the PowerPC64 binary from the former into the latter with lipo.

Linking a PowerPC64 binary without this patch results in the following:

$ powerpc-apple-darwin10-gcc-4.2.1 -m64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 test.c
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib, missing required architecture ppc64 in file
$ otool-classic -L a.out
a.out:
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)

With this patch, instead:

$ powerpc-apple-darwin10-gcc-4.2.1 -m64 -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5 test.c
$ otool-classic -L a.out
a.out:
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/usr/lib/libgcc_s_ppc64.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)

With more complex programs, I have had this cause link failures due to missing symbols. I've only tested this patch in High Sierra, so please review and test carefully before merging.

Fixes #69.

Fixes linking issues for PowerPC64 binaries caused by overwriting the
libgcc_s.10.5.dylib in the 10.5 SDK with the equivalent library from
the 10.6 SDK--which does not contain a PowerPC64 binary--by copying
the PowerPC64 binary from the former into the latter with lipo.

Linking a PowerPC64 binary without this patch results in the following:
```
$ powerpc-apple-darwin10-gcc-4.2.1 -m64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 test.c
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib, missing required architecture ppc64 in file
$ otool-classic -L a.out
a.out:
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
```

With this patch, instead:
```
$ powerpc-apple-darwin10-gcc-4.2.1 -m64 -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5 test.c
$ otool-classic -L a.out
a.out:
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/usr/lib/libgcc_s_ppc64.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOSX10.5.sdk libgcc_s.10.5.dylib fix breaks linking PowerPC64 executables.
1 participant