Skip to content

Commit 782ea2f

Browse files
committed
[libc] Fix passing the full runtime target for multilibs
Summary: The multilib builds pass `+name` to the runtime target. We were using this as a strict triple and passing it to the compiler. Parse out the triple portion in this case.
1 parent 7f4422d commit 782ea2f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ if(explicit_target_triple AND
211211
"GCC target triple (${libc_compiler_triple}) and the explicity "
212212
"specified target triple (${explicit_target_triple}) do not match.")
213213
else()
214+
# Make sure we don't include any multilib specifiers.
215+
string(FIND "${explicit_target_triple}" "+" plus_pos)
216+
if(NOT plus_pos EQUAL -1)
217+
string(SUBSTRING "${explicit_target_triple}" 0 ${plus_pos} explicit_target_triple)
218+
endif()
219+
214220
list(APPEND
215221
LIBC_COMPILE_OPTIONS_DEFAULT "--target=${explicit_target_triple}")
216222
endif()

0 commit comments

Comments
 (0)