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: dynamic main executables must link with libSystem.dylib for architecture x86_64 #10

Open
pearu opened this issue Sep 14, 2019 · 0 comments
Labels
with a solution Issue has a solution

Comments

@pearu
Copy link
Contributor

pearu commented Sep 14, 2019

When running cmake:

-- Check for working C compiler: /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/clang -- broken
CMake Error at /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/quansight/pearu/git/omniscidb/omniscidb-internal/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/make cmTC_61f65/fast && /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/make -f CMakeFiles/cmTC_61f65.dir/build.make CMakeFiles/cmTC_61f65.dir/build
    make[1]: Entering directory '/Users/quansight/pearu/git/omniscidb/omniscidb-internal/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_61f65.dir/testCCompiler.c.o
    /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.12   -o CMakeFiles/cmTC_61f65.dir/testCCompiler.c.o   -c /Users/quansight/pearu/git/omniscidb/omniscidb-internal/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_61f65
    /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_61f65.dir/link.txt --verbose=1
    /Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/bin/clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.12 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/lib -Wl,-rpath,/Users/quansight/miniconda3/envs/omniscidb-cpu-dev2/lib  CMakeFiles/cmTC_61f65.dir/testCCompiler.c.o  -o cmTC_61f65 
    ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
    clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [CMakeFiles/cmTC_61f65.dir/build.make:87: cmTC_61f65] Error 1
    make[1]: Leaving directory '/Users/quansight/pearu/git/omniscidb/omniscidb-internal/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_61f65/fast] Error 2

Note that conda activate ... sets CONDA_BUILD_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk.

If you are using different SDK then the solution is:

export CONDA_BUILD_SYSROOT=/Users/quansight/MacOSX-SDKs/MacOSX10.12.sdk/

for instance (make sure you adjust the SDK path to your case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
with a solution Issue has a solution
Projects
None yet
Development

No branches or pull requests

1 participant