Skip to content

Commit 13ad84a

Browse files
authored
llvm-libc build: remove all references to libc-hdrgen. (#629)
The 'newhdrgen' tool replaced it some time ago, and that's written in Python, so it doesn't need to be built separately with host tools at all. As of upstream commit e0ae7793fca0c78, the migration is complete, and the old C++ libc-hdrgen doesn't exist at all any more. So we need to stop trying to build it – it will break our builds when no such build target exists.
1 parent 49bfb9d commit 13ad84a

File tree

3 files changed

+0
-73
lines changed

3 files changed

+0
-73
lines changed

CMakeLists.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -350,25 +350,6 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)
350350
COMPONENT llvm-toolchain-llvmlibc-configs
351351
)
352352

353-
# We need to build libc-hdrgen
354-
ExternalProject_Add(
355-
libc_hdrgen
356-
SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm
357-
DEPENDS ${lib_tool_dependencies}
358-
CMAKE_ARGS
359-
-DLLVM_ENABLE_RUNTIMES=libc
360-
-DLLVM_LIBC_FULL_BUILD=ON
361-
-DCMAKE_BUILD_TYPE=Debug
362-
STEP_TARGETS build install
363-
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen
364-
INSTALL_COMMAND ${CMAKE_COMMAND} -E true
365-
# Always run the build command so that incremental builds are correct.
366-
BUILD_ALWAYS TRUE
367-
CONFIGURE_HANDLED_BY_BUILD TRUE
368-
)
369-
ExternalProject_Get_property(libc_hdrgen BINARY_DIR)
370-
set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
371-
372353
# LLVM libc lacks a configuration for AArch64, but the AArch32 one works
373354
# fine. However, setting the configuration for both architectures to the
374355
# arm config directory means the baremetal config.json is never loaded,
@@ -616,7 +597,6 @@ if(NOT PREBUILT_TARGET_LIBRARIES)
616597
-DENABLE_PARALLEL_LIB_CONFIG=${ENABLE_PARALLEL_LIB_CONFIG}
617598
-DENABLE_PARALLEL_LIB_BUILD=${ENABLE_PARALLEL_LIB_BUILD}
618599
-DPARALLEL_LIB_BUILD_LEVELS=${PARALLEL_LIB_BUILD_LEVELS}
619-
-DLIBC_HDRGEN=${LIBC_HDRGEN}
620600
-DFVP_INSTALL_DIR=${FVP_INSTALL_DIR}
621601
-DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING}
622602
-DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING}

arm-multilib/CMakeLists.txt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ set(ENABLE_VARIANTS "all" CACHE STRING "Semicolon separated list of variants to
3232
set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.")
3333
set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc)
3434
set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.")
35-
set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR")
3635
option(
3736
ENABLE_QEMU_TESTING
3837
"Enable tests that use QEMU. This option is ON by default."
@@ -83,7 +82,6 @@ endif()
8382
# Arguments to pass down to the library projects.
8483
foreach(arg
8584
LLVM_BINARY_DIR
86-
LIBC_HDRGEN
8785
FVP_INSTALL_DIR
8886
FVP_CONFIG_DIR
8987
)
@@ -108,31 +106,6 @@ endif()
108106
# Target for any dependencies to build the runtimes project.
109107
add_custom_target(runtimes-depends)
110108

111-
# If building llvm-libc, ensure libc-hdrgen is available.
112-
if(C_LIBRARY STREQUAL llvmlibc)
113-
if(NOT LIBC_HDRGEN)
114-
if(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
115-
set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
116-
else()
117-
ExternalProject_Add(
118-
libc_hdrgen
119-
SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm
120-
CMAKE_ARGS
121-
-DLLVM_ENABLE_RUNTIMES=libc
122-
-DLLVM_LIBC_FULL_BUILD=ON
123-
-DCMAKE_BUILD_TYPE=Debug
124-
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen
125-
INSTALL_COMMAND ${CMAKE_COMMAND} -E true
126-
CONFIGURE_HANDLED_BY_BUILD TRUE
127-
)
128-
ExternalProject_Get_property(libc_hdrgen BINARY_DIR)
129-
set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
130-
add_dependencies(runtimes-depends libc_hdrgen)
131-
endif()
132-
endif()
133-
list(APPEND passthrough_dirs "-DLIBC_HDRGEN=${LIBC_HDRGEN}")
134-
endif()
135-
136109
# Create one target to run all the tests.
137110
add_custom_target(check-${C_LIBRARY})
138111
add_custom_target(check-compiler-rt)

arm-runtimes/CMakeLists.txt

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ set(ENABLE_LIBC_TESTS ${ENABLE_LIBC_TESTS_def} CACHE BOOL "Enable libc tests (pi
9696
set(ENABLE_COMPILER_RT_TESTS ${ENABLE_COMPILER_RT_TESTS_def} CACHE BOOL "Enable compiler-rt tests.")
9797
set(ENABLE_LIBCXX_TESTS ${ENABLE_LIBCXX_TESTS_def} CACHE BOOL "Enable libcxx tests.")
9898
set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain root to build libraries with")
99-
set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR")
10099

101100
# Temporary location to collect the libraries as they are built.
102101
set(TEMP_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp_install")
@@ -585,39 +584,14 @@ if(C_LIBRARY STREQUAL llvmlibc)
585584
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
586585
)
587586

588-
if(LIBC_HDRGEN)
589-
# If libc-hdrgen is provided, there is no need to build it,
590-
# but a target is still needed to satisfy the dependency.
591-
add_custom_target(libc_hdrgen)
592-
elseif(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
593-
set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
594-
add_custom_target(libc_hdrgen)
595-
else()
596-
ExternalProject_Add(
597-
libc_hdrgen
598-
SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm
599-
CMAKE_ARGS
600-
-DLLVM_ENABLE_RUNTIMES=libc
601-
-DLLVM_LIBC_FULL_BUILD=ON
602-
-DCMAKE_BUILD_TYPE=Debug
603-
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen
604-
INSTALL_COMMAND ${CMAKE_COMMAND} -E true
605-
CONFIGURE_HANDLED_BY_BUILD TRUE
606-
)
607-
ExternalProject_Get_property(libc_hdrgen BINARY_DIR)
608-
set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX})
609-
endif()
610-
611587
ExternalProject_Add(
612588
llvmlibc
613589
SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes
614590
INSTALL_DIR llvmlibc/install
615-
DEPENDS libc_hdrgen
616591
CMAKE_ARGS
617592
${compiler_launcher_cmake_args}
618593
${common_llvmlibc_cmake_args}
619594
-DLIBC_TARGET_TRIPLE=${target_triple}
620-
-DLIBC_HDRGEN_EXE=${LIBC_HDRGEN}
621595
-DLIBC_CONFIG_PATH=${LIBC_CFG_DIR}
622596
-DLIBC_CONF_TIME_64BIT=ON
623597
-DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm

0 commit comments

Comments
 (0)