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

"ld: warning: bad symbol action" #54

Open
arekkusu42 opened this issue Jun 6, 2019 · 2 comments
Open

"ld: warning: bad symbol action" #54

arekkusu42 opened this issue Jun 6, 2019 · 2 comments

Comments

@arekkusu42
Copy link

Using OSX 10.9.5 and starting with Xcode 6.2:

  • I downloaded the linked Xcode3 and 4 installers
  • I ran "./XcodeLegacy.sh -compilers -osx104 buildpackages" which appears to successfully extract all the components
  • I ran "sudo ./XcodeLegacy.sh -compilers -osx104 install" which mostly succeeds, but produces a "No value to remove at key path MinimumSDKVersion" error (as noted in Issue "No value to remove at key path MinimumSDKVersion" #53)
  • I restored the missing /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
  • I opened an existing Xcode project, which is configured to build i386 and x86_64 against the 10.9 SDK, deploying to 10.4. With no project changes (i.e. NOT changing the SDK or compiler), I now receive these new "bad symbol action" ld warnings:
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
Copy link
Owner

devernay commented May 2, 2021

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

@arekkusu42
Copy link
Author

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.

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

No branches or pull requests

2 participants