Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-128

Building from source with XCode 11.7 fails

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Building the project from source with XCode 11.7 fails with

      > Task :cinterop:capiMacosUniversal FAILED
      -- The C compiler identification is AppleClang 11.0.3.11030032
      -- The CXX compiler identification is AppleClang 11.0.3.11030032
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
      CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
        The C compiler
      
          "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
      
        is not able to compile a simple test program.
      
        It fails with the following output:
      
          Change Dir: /Users/claus.rorbech/proj/realm-kotlin/packages/external/core/capi_macos_universal/CMakeFiles/CMakeTmp
          
          Run Build Command(s):/usr/local/bin/gmake cmTC_0a618/fast && /usr/local/bin/gmake  -f CMakeFiles/cmTC_0a618.dir/build.make CMakeFiles/cmTC_0a618.dir/build
          gmake[1]: Entering directory '/Users/claus.rorbech/proj/realm-kotlin/packages/external/core/capi_macos_universal/CMakeFiles/CMakeTmp'
          Building C object CMakeFiles/cmTC_0a618.dir/testCCompiler.c.o
          /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc   -arch x86_64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.9 -o CMakeFiles/cmTC_0a618.dir/testCCompiler.c.o -c /Users/claus.rorbech/proj/realm-kotlin/packages/external/core/capi_macos_universal/CMakeFiles/CMakeTmp/testCCompiler.c
          Linking C executable cmTC_0a618
          /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0a618.dir/link.txt --verbose=1
          /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  -arch x86_64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_0a618.dir/testCCompiler.c.o -o cmTC_0a618 
          ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/lib/darwin/libclang_rt.osx.a, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/lib/darwin/libclang_rt.osx.a (3 slices)
          ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
          ld: dynamic main executables must link with libSystem.dylib for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          gmake[1]: *** [CMakeFiles/cmTC_0a618.dir/build.make:106: cmTC_0a618] Error 1
          gmake[1]: Leaving directory '/Users/claus.rorbech/proj/realm-kotlin/packages/external/core/capi_macos_universal/CMakeFiles/CMakeTmp'
          gmake: *** [Makefile:140: cmTC_0a618/fast] Error 2
      

      Immediate workaround is to remove "-DOSX_ARM64=1" argument in https://github.com/realm/realm-kotlin/blob/master/packages/cinterop/build.gradle.kts#L323

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: