Skip to content

Commit ab016f6

Browse files
[libc] init uefi os target
1 parent eb1b9fc commit ab016f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1833
-3
lines changed

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
6969
set(target_sys "darwin")
7070
endif()
7171

72+
if(target_sys STREQUAL "unknown")
73+
list(GET triple_comps -1 target_sys)
74+
endif()
75+
7276
# Setting OS name for GPU architectures.
7377
list(GET triple_comps -1 gpu_target_sys)
7478
if(gpu_target_sys MATCHES "^amdhsa" OR gpu_target_sys MATCHES "^cuda")
@@ -187,6 +191,8 @@ elseif(LIBC_TARGET_OS STREQUAL "windows")
187191
set(LIBC_TARGET_OS_IS_WINDOWS TRUE)
188192
elseif(LIBC_TARGET_OS STREQUAL "gpu")
189193
set(LIBC_TARGET_OS_IS_GPU TRUE)
194+
elseif(LIBC_TARGET_OS STREQUAL "uefi")
195+
set(LIBC_TARGET_OS_IS_UEFI TRUE)
190196
else()
191197
message(FATAL_ERROR
192198
"Unsupported libc target operating system ${LIBC_TARGET_OS}")

libc/config/uefi/config.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"errno": {
3+
"LIBC_CONF_ERRNO_MODE": {
4+
"value": "LIBC_ERRNO_MODE_DEFAULT"
5+
}
6+
},
7+
"printf": {
8+
"LIBC_CONF_PRINTF_DISABLE_FLOAT": {
9+
"value": true
10+
},
11+
"LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": {
12+
"value": true
13+
},
14+
"LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
15+
"value": true
16+
},
17+
"LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
18+
"value": false
19+
},
20+
"LIBC_CONF_PRINTF_DISABLE_STRERROR": {
21+
"value": true
22+
}
23+
},
24+
"qsort": {
25+
"LIBC_CONF_QSORT_IMPL": {
26+
"value": "LIBC_QSORT_HEAP_SORT"
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)