@@ -958,14 +958,15 @@ function(
958958 get_runtimes_flags("${directory} " "${flags} " )
959959 extend_with_exception_and_rtti(target_name "libcxx_libcxxabi_libunwind_${variant} " ${enable_exceptions_and_rtti} )
960960 extend_with_exception_and_rtti(prefix "libcxx_libcxxabi_libunwind/${variant} " ${enable_exceptions_and_rtti} )
961+ extend_with_exception_and_rtti(instal_dir "${LLVM_BINARY_DIR} /${directory} " ${enable_exceptions_and_rtti} )
961962 if (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc)
962963 list (APPEND extra_cmake_options -DLIBCXXABI_ENABLE_EXCEPTIONS=${enable_exceptions_and_rtti} -DLIBCXX_ENABLE_EXCEPTIONS=${enable_exceptions_and_rtti} -DLIBCXX_ENABLE_RTTI=${enable_exceptions_and_rtti} -DLIBCXXABI_ENABLE_STATIC_UNWINDER=${enable_exceptions_and_rtti} )
963964 endif ()
964965
965966 ExternalProject_Add(
966967 ${target_name}
967968 SOURCE_DIR ${llvmproject_SOURCE_DIR} /runtimes
968- INSTALL_DIR " ${LLVM_BINARY_DIR} / ${directory} "
969+ INSTALL_DIR ${instal_dir}
969970 PREFIX ${prefix}
970971 DEPENDS ${lib_tool_dependencies} compiler_rt_${variant} ${libc_target}
971972 CMAKE_ARGS
@@ -979,7 +980,7 @@ function(
979980 -DCMAKE_C_COMPILER_TARGET=${target_triple}
980981 -DCMAKE_C_FLAGS=${runtimes_flags}
981982 -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
982- -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
983+ -DCMAKE_INSTALL_PREFIX=${instal_dir}
983984 -DCMAKE_NM=${LLVM_BINARY_DIR} /bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX}
984985 -DCMAKE_RANLIB=${LLVM_BINARY_DIR} /bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}
985986 # Let CMake know we're cross-compiling
@@ -1230,6 +1231,21 @@ function(add_library_variant target_arch)
12301231 DESTINATION "${directory} "
12311232 COMPONENT llvm-toolchain-libs
12321233 )
1234+ if (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc)
1235+ string (APPEND multilib_yaml_content "- Dir: ${parent_dir_name} /${variant} _exceptions_rtti\n " )
1236+ string (APPEND multilib_yaml_content " Flags:\n " )
1237+ string (REPLACE " " ";" multilib_flags_list ${VARIANT_MULTILIB_FLAGS} )
1238+ foreach (flag ${multilib_flags_list} )
1239+ string (APPEND multilib_yaml_content " - ${flag} \n " )
1240+ endforeach ()
1241+ string (APPEND multilib_yaml_content " ExclusiveGroup: stdlibs\n " )
1242+
1243+ install (
1244+ DIRECTORY "${LLVM_BINARY_DIR} /${directory} _exceptions_rtti/"
1245+ DESTINATION "${directory} _exceptions_rtti/"
1246+ COMPONENT llvm-toolchain-libs
1247+ )
1248+ endif ()
12331249 set (multilib_yaml_content "${multilib_yaml_content} " PARENT_SCOPE)
12341250endfunction ()
12351251
0 commit comments