devernay / xcodelegacy

Legacy components for XCode 4-12 (deprecated compilers and Mac OS X SDKs)
https://github.com/devernay/xcodelegacy
470 stars 63 forks source link

"ld: warning: bad symbol action" #54

Open arekkusu42 opened 5 years ago

arekkusu42 commented 5 years ago

Using OSX 10.9.5 and starting with Xcode 6.2:

Ld build/App.build/Debug/App.build/Objects-normal/i386/App normal i386
    cd /Users/arekkusu/App
    export MACOSX_DEPLOYMENT_TARGET=10.4
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/arekkusu/App/build/Debug -F/Users/arekkusu/App/build/Debug -filelist /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App.LinkFileList -mmacosx-version-min=10.4 -fobjc-link-runtime -framework Cocoa -framework OpenGL -Xlinker -dependency_info -Xlinker /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App_dependency_info.dat -o /Users/arekkusu/App/build/App.build/Debug/App.build/Objects-normal/i386/App

ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//CoreGraphics.framework/CoreGraphics
ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//ImageIO.framework/ImageIO
ld: warning: bad symbol action: $ld$install_name$os10.4$/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices in dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks//CFNetwork.framework/CFNetwork
devernay commented 3 years ago

Does it make sense to compile against 10.9SDK to deploy on 10.4?

arekkusu42 commented 3 years ago

Yes. That is why the SDK and deployment target are two different variables.

Primarily, using a newer SDK than the deployment target has the downside of not generating build warnings if you use API not available in the older OS. This is solved by temporarily building against the old SDK, or simply testing every code path on every OS you can run on.

Secondarily, using a higher SDK may opt-in to new runtime behavior on new OS versions in some frameworks which look at LC_VERSION_MIN_MACOSX. This is a good reason to use a newer SDK.