Skip to content

cmake failure for compiler-rt when building Flang #99747

Open
@ajmay81

Description

@ajmay81

The error occurs at the compiler-rt stage building as recommended by Flang getting started.

This is a regression due to 487d5af , prior to that cmake runs through without problem.

Explicitly I used:

cd /tmp && rm -rf /tmp/build && mkdir /tmp/build && cd /tmp/build && \
CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=11 -DCMAKE_C_CFLAGS=-mlong-double-128 -DCMAKE_CXX_CFLAGS=-mlong-double-128 -DCOMPILER_RT_BUILD_ORC=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_SANITIZERS=OFF ../llvm-project/compiler-rt

which results in:

...
-- Performing Test COMPILER_RT_TARGET_HAS_UNAME - Success
-- Configuring done (9.9s)
CMake Error at cmake/Modules/AddCompilerRT.cmake:357 (add_library):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>

  Objects of target "RTSanitizerCommon.x86_64" referenced but no such target
  exists.
Call Stack (most recent call first):
  lib/ctx_profile/CMakeLists.txt:25 (add_compiler_rt_runtime)


CMake Error at cmake/Modules/AddCompilerRT.cmake:357 (add_library):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>

  Objects of target "RTSanitizerCommon.x86_64" referenced but no such target
  exists.
Call Stack (most recent call first):
  lib/ctx_profile/CMakeLists.txt:25 (add_compiler_rt_runtime)


CMake Error at cmake/Modules/AddCompilerRT.cmake:357 (add_library):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>

  Objects of target "RTSanitizerCommon.x86_64" referenced but no such target
  exists.
Call Stack (most recent call first):
  lib/ctx_profile/CMakeLists.txt:25 (add_compiler_rt_runtime)


CMake Error at cmake/Modules/AddCompilerRT.cmake:357 (add_library):
  No SOURCES given to target: clang_rt.ctx_profile-x86_64
Call Stack (most recent call first):
  lib/ctx_profile/CMakeLists.txt:25 (add_compiler_rt_runtime)

One can temporarily work around the problem by deleting the last 8 lines of compiler-rt/lib/ctx_profile/CMakeLists.txt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularcompiler-rt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions