Skip to content

[libc] Configure CMAKE_REQUIRED_FLAGS so the GPU can use flag checks #95424

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

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Jun 13, 2024

Summary:
This patch adds CMAKE_REQUIRED_FLAGS for the GPU build so checks like
check_cxx_compiler_flags work as expected. This is required because we
need to hack around the potential lack of nvlink and ptxas for NVPTX
targets and the fact that the AMDGPU target needs -nogpulib to avoid
errors on lack of ROCm. This makes a few of the checks pass and also
allows us to just check -mcpu=native for architecture detection
instead of finding the tools manually.

@llvmbot
Copy link
Member

llvmbot commented Jun 13, 2024

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
This patch adds CMAKE_REQUIRED_FLAGS for the GPU build so checks like
check_cxx_compiler_flags work as expected. This is required because we
need to hack around the potential lack of nvlink and ptxas for NVPTX
targets and the fact that the AMDGPU target needs -nogpulib to avoid
errors on lack of ROCm. This makes a few of the checks pass and also
allows us to just check -mcpu=native for architecture detection
instead of finding the tools manually.


Full diff: https://github.com/llvm/llvm-project/pull/95424.diff

2 Files Affected:

  • (modified) libc/cmake/modules/prepare_libc_gpu_build.cmake (+13-32)
  • (modified) llvm/runtimes/CMakeLists.txt (+2-2)
diff --git a/libc/cmake/modules/prepare_libc_gpu_build.cmake b/libc/cmake/modules/prepare_libc_gpu_build.cmake
index dc8beb14fd7f4..f1275e34a42e8 100644
--- a/libc/cmake/modules/prepare_libc_gpu_build.cmake
+++ b/libc/cmake/modules/prepare_libc_gpu_build.cmake
@@ -16,6 +16,17 @@ if(NOT LLVM_LIBC_FULL_BUILD)
                       "GPU.")
 endif()
 
+# Set the required flags globally so standard CMake utilities can compile.
+if(LIBC_TARGET_TRIPLE)
+  set(CMAKE_REQUIRED_FLAGS "--target=${explicit_target_triple}")
+endif()
+if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
+elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
+  set(CMAKE_REQUIRED_FLAGS
+      "${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
+endif()
+
 # Identify the program used to package multiple images into a single binary.
 get_filename_component(compiler_path ${CMAKE_CXX_COMPILER} DIRECTORY)
 if(TARGET clang-offload-packager)
@@ -56,39 +67,9 @@ endif()
 
 set(LIBC_GPU_TEST_ARCHITECTURE "" CACHE STRING "Architecture for the GPU tests")
 if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
-  # Identify any locally installed AMD GPUs on the system using 'amdgpu-arch'.
-  if(TARGET amdgpu-arch)
-    get_target_property(LIBC_AMDGPU_ARCH amdgpu-arch LOCATION)
-  else()
-    find_program(LIBC_AMDGPU_ARCH
-                 NAMES amdgpu-arch NO_DEFAULT_PATH
-                 PATHS ${LLVM_BINARY_DIR}/bin ${compiler_path})
-  endif()
-  if(LIBC_AMDGPU_ARCH)
-    execute_process(COMMAND ${LIBC_AMDGPU_ARCH}
-                    OUTPUT_VARIABLE arch_tool_output
-                    ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if(arch_tool_output MATCHES "^gfx[0-9]+")
-      set(PLATFORM_HAS_GPU TRUE)
-    endif()
-  endif()
+  check_cxx_compiler_flag(-mcpu=native PLATFORM_HAS_GPU)
 elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
-  # Identify any locally installed NVIDIA GPUs on the system using 'nvptx-arch'.
-  if(TARGET nvptx-arch)
-    get_target_property(LIBC_NVPTX_ARCH nvptx-arch LOCATION)
-  else()
-    find_program(LIBC_NVPTX_ARCH
-                 NAMES nvptx-arch NO_DEFAULT_PATH
-                 PATHS ${LLVM_BINARY_DIR}/bin ${compiler_path})
-  endif()
-  if(LIBC_NVPTX_ARCH)
-    execute_process(COMMAND ${LIBC_NVPTX_ARCH}
-                    OUTPUT_VARIABLE arch_tool_output
-                    ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if(arch_tool_output MATCHES "^sm_[0-9]+")
-      set(PLATFORM_HAS_GPU TRUE)
-    endif()
-  endif()
+  check_cxx_compiler_flag(-march=native PLATFORM_HAS_GPU)
 endif()
 
 set(gpu_test_architecture "")
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index e60c9dd6041b4..b6ed497fa122a 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -487,7 +487,7 @@ if(build_runtimes)
       if(TARGET amdhsa-loader)
         list(APPEND libc_cmake_args
              "-DRUNTIMES_amdgcn-amd-amdhsa_LIBC_GPU_LOADER_EXECUTABLE=$<TARGET_FILE:amdhsa-loader>")
-        list(APPEND extra_deps amdhsa-loader amdgpu-arch)
+        list(APPEND extra_deps amdhsa-loader)
       endif()
       list(APPEND libc_cmake_args "-DRUNTIMES_amdgcn-amd-amdhsa_LLVM_LIBC_FULL_BUILD=ON")
     endif()
@@ -495,7 +495,7 @@ if(build_runtimes)
       if(TARGET nvptx-loader)
         list(APPEND libc_cmake_args
              "-DRUNTIMES_nvptx64-nvidia-cuda_LIBC_GPU_LOADER_EXECUTABLE=$<TARGET_FILE:nvptx-loader>")
-        list(APPEND extra_deps nvptx-loader nvptx-arch)
+        list(APPEND extra_deps nvptx-loader)
       endif()
       list(APPEND libc_cmake_args "-DRUNTIMES_nvptx64-nvidia-cuda_LLVM_LIBC_FULL_BUILD=ON")
     endif()

Summary:
This patch adds `CMAKE_REQUIRED_FLAGS` for the GPU build so checks like
`check_cxx_compiler_flags` work as expected. This is required because we
need to hack around the potential lack of `nvlink` and `ptxas` for NVPTX
targets and the fact that the AMDGPU target needs `-nogpulib` to avoid
errors on lack of ROCm. This makes a few of the checks pass and also
allows us to just check `-mcpu=native` for architecture detection
instead of finding the tools manually.
@jhuber6 jhuber6 merged commit 6c9916d into llvm:main Jun 25, 2024
7 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 25, 2024

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu-dwarf5 running on doug-worker-1b while building libc,llvm at step 6 "test-build-unified-tree-check-cross-project".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/163/builds/585

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-cross-project) failure: test (failure)
******************** TEST 'cross-project-tests :: debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
RUN: at line 10: clang++ -O0 -glldb -std=gnu++11 /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp -o /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/Output/limit_steps_conditional.cpp.tmp
+ clang++ -O0 -glldb -std=gnu++11 /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp -o /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/Output/limit_steps_conditional.cpp.tmp
RUN: at line 11: "/usr/bin/python3.10" "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py" test --fail-lt 1.0 -w --debugger lldb --binary /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/Output/limit_steps_conditional.cpp.tmp -- /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp | /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/FileCheck /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp
+ /usr/bin/python3.10 /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py test --fail-lt 1.0 -w --debugger lldb --binary /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/Output/limit_steps_conditional.cpp.tmp -- /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp
+ /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/FileCheck /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_conditional.cpp
python3.10: /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/include/llvm/ADT/SmallVector.h:754: llvm::SmallVectorImpl<T>::iterator llvm::SmallVectorImpl<T>::erase(llvm::SmallVectorImpl<T>::const_iterator) [with T = std::pair<std::weak_ptr<lldb_private::Listener>, unsigned int>; llvm::SmallVectorImpl<T>::iterator = std::pair<std::weak_ptr<lldb_private::Listener>, unsigned int>*; llvm::SmallVectorImpl<T>::const_iterator = const std::pair<std::weak_ptr<lldb_private::Listener>, unsigned int>*]: Assertion `this->isReferenceToStorage(CI) && "Iterator to erase is out of bounds."' failed.

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 25, 2024

LLVM Buildbot has detected a new failure on builder clang-hip-vega20 running on hip-vega20-0 while building libc,llvm at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/586

Here is the relevant piece of the build log for the reference:

Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
...
[37/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -xhip -mfma -MD -MT External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -MF External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o.d -o External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -c /buildbot/llvm-test-suite/External/HIP/workload/ray-tracing/TheNextWeek/main.cc
[38/38] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -O3 -DNDEBUG  External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -o External/HIP/TheNextWeek-hip-6.0.2  --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --hip-link -rtlib=compiler-rt -unwindlib=libgcc -frtlib-add-rpath && cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /usr/local/bin/cmake -E create_symlink /buildbot/llvm-test-suite/External/HIP/TheNextWeek.reference_output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/TheNextWeek.reference_output-hip-6.0.2
+ build_step 'Testing HIP test-suite'
+ echo '@@@BUILD_STEP Testing HIP test-suite@@@'
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 6 tests, 6 workers --
/usr/bin/strip: /bin/bash.stripped: Bad file descriptor
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.
FAIL: test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test (5 of 6)
******************** TEST 'test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.time /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend-hip-6.0.2
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP ; /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2

+ cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP
+ /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2
/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target: Comparison failed, textual difference between 'M' and 'i'

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test


Testing Time: 50.89s

Total Discovered Tests: 6
  Passed: 5 (83.33%)
  Failed: 1 (16.67%)
FAILED: External/HIP/CMakeFiles/check-hip-simple-hip-6.0.2 
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
ninja: build stopped: subcommand failed.
Step 12 (Testing HIP test-suite) failure: Testing HIP test-suite (failure)
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 6 tests, 6 workers --
/usr/bin/strip: /bin/bash.stripped: Bad file descriptor
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.
FAIL: test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test (5 of 6)
******************** TEST 'test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.time /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend-hip-6.0.2
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP ; /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2

+ cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP
+ /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2
/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target: Comparison failed, textual difference between 'M' and 'i'

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test


Testing Time: 50.89s

Total Discovered Tests: 6
  Passed: 5 (83.33%)
  Failed: 1 (16.67%)
FAILED: External/HIP/CMakeFiles/check-hip-simple-hip-6.0.2 
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=156.791330

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 25, 2024

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building libc,llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/496

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: functionalities/data-formatter/custom-printf-summary/TestCustomSummaryLLVMFormat.py (331 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py (332 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (333 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py (334 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py (335 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py (336 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py (337 of 2736)
UNSUPPORTED: lldb-api :: functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py (338 of 2736)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py (339 of 2736)
UNRESOLVED: lldb-api :: functionalities/completion/TestCompletion.py (340 of 2736)
******************** TEST 'lldb-api :: functionalities/completion/TestCompletion.py' FAILED ********************
Script:
--
/usr/bin/python3.8 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env OBJCOPY=/usr/bin/llvm-objcopy --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --arch armv8l --build-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/dsymutil --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/functionalities/completion -p TestCompletion.py
--
Exit Code: -11

Command Output (stdout):
--
lldb version 19.0.0git (https://github.com/llvm/llvm-project.git revision 6c9916d0d8a40034c5e0dfc157f146855e42520e)
  clang revision 6c9916d0d8a40034c5e0dfc157f146855e42520e
  llvm revision 6c9916d0d8a40034c5e0dfc157f146855e42520e

--
Command Output (stderr):
--
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
 #0 0xeda49934 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xf82934)
 #1 0xeda47354 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xf80354)
 #2 0xeda4a1cc SignalHandler(int) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xf831cc)
 #3 0xf7bda530 __default_sa_restorer /build/glibc-tftl1u/glibc-2.31/signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67:0
 #4 0xed524058 lldb_private::Broadcaster::BroadcasterImpl::GetListeners(unsigned int, bool) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xa5d058)
 #5 0xed525bd4 lldb_private::Broadcaster::BroadcasterImpl::PrivateBroadcastEvent(std::shared_ptr<lldb_private::Event>&, bool) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xa5ebd4)
 #6 0xed5261e0 lldb_private::Broadcaster::BroadcasterImpl::BroadcastEvent(unsigned int) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0xa5f1e0)
 #7 0xed283cac lldb_private::ThreadedCommunication::ReadThread() (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0x7bccac)
 #8 0xed2844b4 std::_Function_handler<void* (), lldb_private::ThreadedCommunication::StartReadThread(lldb_private::Status*)::$_0>::_M_invoke(std::_Any_data const&) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0x7bd4b4)
 #9 0xed3284d8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-arm-linux-gnueabihf.so+0x8614d8)
Fatal Python error: Segmentation fault

Thread 0xf7ccc310 (most recent call first):
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lib/python3.8/site-packages/lldb/__init__.py", line 9378 in Kill
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1672 in invoke
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2008 in tearDown
  File "/usr/lib/python3.8/unittest/case.py", line 636 in _callTearDown
  File "/usr/lib/python3.8/unittest/case.py", line 679 in run
  File "/usr/lib/python3.8/unittest/case.py", line 736 in __call__
  File "/usr/lib/python3.8/unittest/suite.py", line 122 in run
  File "/usr/lib/python3.8/unittest/suite.py", line 84 in __call__
  File "/usr/lib/python3.8/unittest/suite.py", line 122 in run

AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
…lvm#95424)

Summary:
This patch adds `CMAKE_REQUIRED_FLAGS` for the GPU build so checks like
`check_cxx_compiler_flags` work as expected. This is required because we
need to hack around the potential lack of `nvlink` and `ptxas` for NVPTX
targets and the fact that the AMDGPU target needs `-nogpulib` to avoid
errors on lack of ROCm. This makes a few of the checks pass and also
allows us to just check `-mcpu=native` for architecture detection
instead of finding the tools manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants