tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.91k stars 329 forks source link

error in osxcross build #406

Closed efa closed 11 months ago

efa commented 11 months ago

Using the same SDK in the past work on LMDE5. Now on Debian12 I got this error with current git:

...
create_symlink x86_64-apple-darwin18-wrapper x86_64h-apple-darwin18-xcodebuild

testing x86_64-apple-darwin18-clang++ -stdlib=libc++ -std=c++11 ... failed (ignored)

testing x86_64h-apple-darwin18-clang ... ld: warning: architecture x86_64h not present in TBD /opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd, attempting fallback
ld: malformed file
/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18: error: invalid platform
platform:        zippered
                 ^~~~~~~~
 file '/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
failed (ignored)
testing x86_64h-apple-darwin18-clang++ ... ld: warning: architecture x86_64h not present in TBD /opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd, attempting fallback
ld: warning: architecture x86_64h not present in TBD /opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libc++.tbd, attempting fallback
ld: malformed file
/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18: error: invalid platform
platform:        zippered
                 ^~~~~~~~
 file '/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
failed (ignored)

testing x86_64-apple-darwin18-clang ... ld: malformed file
/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18: error: invalid platform
platform:        zippered
                 ^~~~~~~~
 file '/opt/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

exiting with abnormal exit code (1)
run 'OCDEBUG=1 ./build.sh' to enable debug messages
tpoechtrager commented 11 months ago

What Xcode version has been used to extract the SDK from? Also is it the master or testing branch?

efa commented 11 months ago

on 2021-01-25 I used: osxcross$ tools/gen_sdk_package_pbzx.sh Xcode_10.3.xip it generated: MacOSX10.14.sdk.tar.xz sized 25352432 Was master

efa commented 11 months ago

I made a test with SDK downloaded from: https://github.com/phracker/MacOSX-SDKs I got this error:

...
create_symlink x86_64-apple-darwin18-wrapper x86_64h-apple-darwin18-xcodebuild

Given SDK does not contain libc++ headers (-stdlib=libc++ test may fail)
You may want to re-package your SDK using 'tools/gen_sdk_package.sh' on macOS

testing x86_64-apple-darwin18-clang++ -stdlib=libc++ -std=c++11 ... failed (ignored)

testing x86_64h-apple-darwin18-clang ... osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target
failed (ignored)
testing x86_64h-apple-darwin18-clang++ ... osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target
failed (ignored)

testing x86_64-apple-darwin18-clang ... osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target

exiting with abnormal exit code (1)
run 'OCDEBUG=1 ./build.sh' to enable debug messages
tpoechtrager commented 11 months ago

I fixed the zippered issue here: https://github.com/tpoechtrager/apple-libtapi/commit/b8c5ac40267aa5f6004dd38cc2b2cd84f2d9d555

Please rebuild.

efa commented 11 months ago

works, thank you