Skip to content

macOS with g++-14: Error: ld: library 'asan' not found #71

@ClausKlein

Description

@ClausKlein
/Users/clausklein/Workspace/cpp/beman-project/execution26
bash-5.2$ CXX=g++-14 cmake --workflow --preset debug --fresh 
Executing workflow step 1 of 3: configure preset "debug"

Preset CMake variables:

  CMAKE_BUILD_TYPE="Debug"
  CMAKE_CXX_EXTENSIONS:BOOL="FALSE"
  CMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
  CMAKE_CXX_STANDARD="23"
  CMAKE_CXX_STANDARD_REQUIRED:BOOL="TRUE"
  CMAKE_EXPORT_COMPILE_COMMANDS:BOOL="TRUE"
  CMAKE_INSTALL_PREFIX:PATH="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_PREFIX_PATH:STRING="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_SKIP_TEST_ALL_DEPENDENCY:BOOL="FALSE"

-- The CXX compiler identification is GNU 14.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/bin/g++-14
-- Check for working CXX compiler: /usr/local/bin/g++-14 - broken
CMake Error at /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/usr/local/bin/g++-14"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/clausklein/Workspace/cpp/beman-project/execution26/build/debug/CMakeFiles/CMakeScratch/TryCompile-ajlZfX'
    
    Run Build Command(s): /usr/local/bin/ninja -v cmTC_2947e
    [1/2] /usr/local/bin/g++-14   -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -std=c++23 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -o CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -c /Users/clausklein/Workspace/cpp/beman-project/execution26/build/debug/CMakeFiles/CMakeScratch/TryCompile-ajlZfX/testCXXCompiler.cxx
    [2/2] : && /usr/local/bin/g++-14 -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib/c++ CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -o cmTC_2947e   && :
    FAILED: cmTC_2947e 
    : && /usr/local/bin/g++-14 -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib/c++ CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -o cmTC_2947e   && :
    ld: library 'asan' not found
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:8 (project)


-- Configuring incomplete, errors occurred!
bash-5.2$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions