[libc-commits] [libc] [libc] init uefi os target (PR #120687)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Dec 20 07:56:57 PST 2024


================
@@ -69,6 +69,10 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
     set(target_sys "darwin")
   endif()
 
+  if(target_sys STREQUAL "unknown")
+    list(GET triple_comps -1 target_sys)
+  endif()
----------------
jhuber6 wrote:

Maybe the lack of the ABI in the triple freaks it out? Man I hate github code reviews, can't even comment on related lines of code.

```
  string(REPLACE "-" ";" triple_comps ${triple})
  list(LENGTH triple_comps triple_size)
  if(triple_size LESS "3")
    return()
    return()
  endif()
  math(EXPR system_index "${triple_size} - 2")
  list(GET triple_comps 0 target_arch)
```
Likely it just gets confused with a triple of size three and indexes into the system. Honestly it should probably just take the third element here

https://github.com/llvm/llvm-project/pull/120687


More information about the libc-commits mailing list