Skip to content

cmake failure for compiler-rt when building Flang #99747

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

Open
ajmay81 opened this issue Jul 20, 2024 · 1 comment
Open

cmake failure for compiler-rt when building Flang #99747

ajmay81 opened this issue Jul 20, 2024 · 1 comment
Labels
cmake Build system in general and CMake in particular compiler-rt

Comments

@ajmay81
Copy link

ajmay81 commented Jul 20, 2024

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.

@github-actions github-actions bot added the flang Flang issues not falling into any other category label Jul 20, 2024
@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular compiler-rt and removed flang Flang issues not falling into any other category labels Jul 20, 2024
@Nanotwerp
Copy link

Given the information in #92456, adding -DCOMPILER_RT_BUILD_SANITIZERS as an argument should allow it to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular compiler-rt
Projects
None yet
Development

No branches or pull requests

3 participants