can't compile on command line

Helmut K. C. Tessarek's Avatar

Helmut K. C. Tessarek

15 Jun, 2020 04:25 PM

I pulled the latest commit (b884da7a) from the repo, but I also tried the one before d9f323fe.

Libmacgpg compiles without issues. But when I do a make in the GPGKeychainAccess directory, I get an error:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h:40:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libkern/OSAtomic.h:43:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libkern/OSAtomicDeprecated.h:247:9: note: 'OSAtomicAdd64Barrier' has been
      explicitly marked deprecated here
int64_t OSAtomicAdd64Barrier( int64_t __theAmount,
        ^

18 warnings generated.

Ld /Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain normal x86_64 (in target 'GPG Keychain' from project 'GPGKeychain')
    cd /Users/tessus/data/work/GPGTools/GPGKeychainAccess
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-macos10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/GPGKeychainAccess/Dependencies/Libmacgpg/build/Release -F/Users/tessus/data/work/GPGTools/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release -F/Library/Frameworks -F/Users/tessus/Library/Frameworks -filelist /Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -fobjc-arc -fobjc-link-runtime -lsqlite3 -framework QuartzCore -framework CoreImage -framework ScriptingBridge -framework Security -weak_framework Libmacgpg -framework Cocoa /Users/tessus/data/work/GPGTools/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release/Zxcvbn.framework/Zxcvbn -Xlinker -dependency_info -Xlinker /Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain_dependency_info.dat -o /Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain
ld: reference to bitcode symbol '_objc_destroyWeak' which LTO has not compiled in '-[GKMenuButton .cxx_destruct]' from /tmp/lto.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld /Users/tessus/data/work/GPGTools/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain normal x86_64
(1 failure)
make: *** [GPG Keychain] Error 65

Any idea, what's going on?

Building in Xcode UI works. But as soon as I try to Archive I get the same error as described above:

ld: reference to bitcode symbol '_objc_destroyWeak' which LTO has not compiled in '-[GKMenuButton .cxx_destruct]' from /tmp/lto.o for architecture x86_64

Reference to bitcode symbol '_objc_destroyWeak' which LTO has not compiled in '-[GKMenuButton .cxx_destruct]' from /tmp/lto.o for architecture x86_64
  1. 1 Posted by Helmut K. C. Te... on 23 Jun, 2020 04:09 PM

    Helmut K. C. Tessarek's Avatar

    Hello? Developers? Any idea how to fix this?

  2. Support Staff 2 Posted by Luke Le on 24 Jun, 2020 03:23 PM

    Luke Le's Avatar

    Hi Helmut,

    leider können wir dieses Problem nicht nachvollziehen.
    Welche Version von Xcode verwendest du?

  3. 3 Posted by Helmut K. C. Te... on 24 Jun, 2020 05:11 PM

    Helmut K. C. Tessarek's Avatar

    I tried on 2 machines:

    macOS 10.15.5 19F101
    Xcode 11.5 11E608c

    macOS 10.14.6 18G5033
    Xcode 11.3.1 11C504

    Then I tried to start over with cloning the repo from scratch. The compile run failed with another error. The dependencies are missing in the Dependencies directory. One has to manually create symbolic links. I think you have to update the README how to properly setup a dev environment. Something is certainly off.

    After solving the dependencies issues, I still get the same error.

    Please setup a new VM with macOS and just follow your readme how to compile GPG Keychain. You will run into several issues.....

  4. Support Staff 4 Posted by Luke Le on 24 Jun, 2020 08:52 PM

    Luke Le's Avatar

    git clone should be git clone --recursive so submodules are checked out as well. No other dependencies are needed, if you have Libmacgpg installed from GPG Suite. Otherwise you will need to compile Libmacgpg and install it in /Library/Frameworks

    About your error, please check in Xcode › File › Project Settings… if the Build System is set to Legacy Build System. If not, set it to Legacy Build System. That's the only thing I could think of that might result in the problem you are seeing. Apple is doing some strange things in non legacy build system and it's not well documented last time I checked.

  5. 5 Posted by Helmut K. C. Te... on 25 Jun, 2020 02:42 PM

    Helmut K. C. Tessarek's Avatar

    Thanks for your reply, but I think you mix up repositories. I tried --recursive, but it can't do anything in the GPGKeychainAccess repo (https://github.com/GPGTools/GPGKeychainAccess.git), since it does not have any sub modules defined.
    So as suspected, the Dependencies directory is empty and as soon as I do a make this is what happens:

    Ld /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain normal x86_64 (in target 'GPG Keychain' from project 'GPGKeychain')
        cd /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-macos10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Libmacgpg/build/Release -F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release -F/Library/Frameworks -F/Users/tessus/Library/Frameworks -filelist /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -fobjc-arc -fobjc-link-runtime -lsqlite3 -framework QuartzCore -framework CoreImage -framework ScriptingBridge -framework Security -weak_framework Libmacgpg -framework Cocoa /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Zxcvbn/build/Release/Zxcvbn.framework/Zxcvbn -Xlinker -dependency_info -Xlinker /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/GPGKeychain.build/Release/GPG\ Keychain.build/Objects-normal/x86_64/GPG\ Keychain_dependency_info.dat -o /Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/build/Release/GPG\ Keychain.app/Contents/MacOS/GPG\ Keychain
    ld: warning: directory not found for option '-F/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Dependencies/Libmacgpg/build/Release'
    ld: reference to bitcode symbol '_objc_destroyWeak' which LTO has not compiled in '-[GKMenuButton .cxx_destruct]' from /tmp/lto.o for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/tessus/data/work/GPGTools/new/GPGKeychainAccess/Resources/Info.plist'. (in target 'GPG Keychain' from project 'GPGKeychain')
    ** BUILD FAILED **
    

    Do you see the part where the linker tries to access Dependencies/Libmacgpg/build/Release? After checkout of the repo there is no such directory, even when using --recursive (which can't work for the reason I mentioned above: no submodules in this repo).
    Btw, the README does not mention recursive either.

    And yes, I have the most recent GPG Tools (2020.1) installed on my machine.

    Changing the build system to Legacy Build System does not help either.

  6. Support Staff 6 Posted by Luke Le on 25 Jun, 2020 02:48 PM

    Luke Le's Avatar

    Ah right, I thought Zxcvbn was added as a submodule, but that's no longer the case. So --recursive is in fact not required.

    Did you check Project Settings?

    The reference to Dependencies/Libmacgpg/build/Release is only one of all possible search paths for Frameworks. In your case /Library/Framework works fine, since Libmacgpg.framework is installed there (at least it normally is). The linker error is something else.

  7. 7 Posted by Helmut K. C. Te... on 25 Jun, 2020 02:50 PM

    Helmut K. C. Tessarek's Avatar

    Yes, I updated my post a second before you sent your reply, because I forgot to add that info...

    Changing the build system to Legacy Build System does not help either.

  8. Support Staff 8 Posted by Luke Le on 25 Jun, 2020 02:51 PM

    Luke Le's Avatar

    What does git status say? Are you on branch dev? If not, switch to dev by running git checkout dev

  9. 9 Posted by Helmut K. C. Te... on 25 Jun, 2020 02:52 PM

    Helmut K. C. Tessarek's Avatar

    Yes, I'm on dev.

    It's really a weird problem. When the version before the most recent came out, I had no issues compiling... So something must have changed in between....

  10. Support Staff 10 Posted by Luke Le on 29 Jun, 2020 10:07 AM

    Luke Le's Avatar

    So I've looked into that again and it appears that a file which is no longer necessary is still compiled in and creates an issue under certain configurations (not yet clear when). Remove the file PLWeakCompatibilityStubs.m from the list of files to be compiled, or generally from the project. After that it might work.

  11. 11 Posted by Helmut K. C. Te... on 29 Jun, 2020 10:54 PM

    Helmut K. C. Tessarek's Avatar

    Awesome. This fixed the issue.

    (not yet clear when)

    Since it doesn't happen for the debug build, but only the release branch (Release and Archive) it must have to do with that.

  12. 12 Posted by Helmut K. C. Te... on 30 Jun, 2020 02:08 PM

    Helmut K. C. Tessarek's Avatar

    Unfortunately under Catalina I run into another problem:

    Process:               GPG Keychain [95307]
    Path:                  /Applications/GPG Keychain.app/Contents/MacOS/GPG Keychain
    Identifier:            org.gpgtools.gpgkeychain
    Version:               1.6.1 (1620)
    Code Type:             X86-64 (Native)
    Parent Process:        ??? [1]
    Responsible:           GPG Keychain [95307]
    User ID:               502
    
    Date/Time:             2020-06-30 10:07:13.892 -0400
    OS Version:            Mac OS X 10.15.5 (19F101)
    Report Version:        12
    Bridge OS Version:     4.5 (17P5300)
    Anonymous UUID:        8978A6E7-3C54-43CD-60CE-105246DB01E4
    
    Sleep/Wake UUID:       A03009A4-2957-4FEA-81B9-AE9D3DCFD656
    
    Time Awake Since Boot: 800000 seconds
    Time Since Wake:       5500 seconds
    
    System Integrity Protection: enabled
    
    Crashed Thread:        0
    
    Exception Type:        EXC_CRASH (SIGABRT)
    Exception Codes:       0x0000000000000000, 0x0000000000000000
    Exception Note:        EXC_CORPSE_NOTIFY
    
    Termination Reason:    DYLD, [0x5] Code Signature
    
    Application Specific Information:
    dyld: launch, loading dependent libraries
    
    Dyld Error Message:
      Library not loaded: @rpath/Zxcvbn.framework/Versions/A/Zxcvbn
      Referenced from: /Applications/GPG Keychain.app/Contents/MacOS/GPG Keychain
      Reason: no suitable image found.  Did find:
        /Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn: code signature in (/Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
        /Applications/GPG Keychain.app/Contents/MacOS/../Frameworks/Zxcvbn.framework/Versions/A/Zxcvbn: stat() failed with errno=1
    
  13. 13 Posted by Helmut K. C. Te... on 30 Jun, 2020 02:19 PM

    Helmut K. C. Tessarek's Avatar

    maybe the framework is not codesigned in the build process?

  14. 14 Posted by Helmut K. C. Te... on 07 Jul, 2020 09:35 PM

    Helmut K. C. Tessarek's Avatar

    Can you reproduce this on Catalina?

  15. Support Staff 15 Posted by Luke Le on 08 Jul, 2020 05:21 PM

    Luke Le's Avatar

    Did you try to deactivate any code signing at all?

  16. 16 Posted by Helmut K. C. Te... on 08 Jul, 2020 08:27 PM

    Helmut K. C. Tessarek's Avatar

    This is not possible. You must at least select 'Sign to Run Locally'. There's no no signing option.

  17. 17 Posted by Helmut K. C. Te... on 08 Jul, 2020 09:13 PM

    Helmut K. C. Tessarek's Avatar

    Found the solution: Remove the hardened runtime.

  18. Steve closed this discussion on 27 Jul, 2020 12:26 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac