-1

I'm trying to get rid of linker-signed out of my xxx.dylib. So according to this, I added -no_adhoc_codesign to linker flag with -DCMAKE_SHARED_LINKER_FLAGS="-no_adhoc_codesign" but it seems clang has no idea about this flag. ld does have this option

clang: error: unknown argument: '-no_adhoc_codesign'

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
3
  • How exactly are you invoking clang? Can you show the actual command.
    – john
    Aug 2, 2022 at 8:10
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -fuse-ld=ld -stdlib=libc++ .... -dynamiclib -Wl,-headerpad_max_install_names -no_adhoc_codesign -o output/xxx.dylib It's from Clion run
    – isudfv
    Aug 2, 2022 at 8:12
  • 1
    try -Wl,-no_adhoc_codesign to pass the option directly to the linker Aug 2, 2022 at 8:12

1 Answer 1

0

You can use -Wl,-no_adhoc_codesign to pass the option directly to the linker if the compiler doesn't support adding the option itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.