-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] init uefi os target #120687
[libc] init uefi os target #120687
Changes from all commits
756a121
9150a62
52abff6
d21c902
6ba52a4
3a72dae
91f554d
c7093ea
ac12e60
5ae9b03
2c17e66
99e4e9f
e082649
d7cbeea
778c66c
332c399
0d12108
8960508
c0211ab
c57b248
41a17d3
a6e47de
61cad73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -605,6 +605,7 @@ function(add_integration_test test_name) | |||
${INTEGRATION_TEST_ENV} | ||||
$<$<BOOL:${LIBC_TARGET_OS_IS_GPU}>:${gpu_loader_exe}> | ||||
${CMAKE_CROSSCOMPILING_EMULATOR} | ||||
$<$<BOOL:${LIBC_TARGET_OS_IS_UEFI}>:${LIBC_TARGET_TRIPLE}> | ||||
${INTEGRATION_TEST_LOADER_ARGS} | ||||
$<TARGET_FILE:${fq_build_target_name}> ${INTEGRATION_TEST_ARGS}) | ||||
add_custom_target( | ||||
|
@@ -673,6 +674,7 @@ function(add_libc_hermetic test_name) | |||
libc.src.string.memset | ||||
libc.src.strings.bcmp | ||||
libc.src.strings.bzero | ||||
libc.src.stdlib.atexit | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list here is for libcalls that the compiler specifically exports, however we do need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, for whatever reason that I can't remember I needed to add it for the tests to compile. |
||||
) | ||||
|
||||
if(libc.src.compiler.__stack_chk_fail IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS) | ||||
|
@@ -743,6 +745,11 @@ function(add_libc_hermetic test_name) | |||
endif() | ||||
endforeach() | ||||
|
||||
if(LIBC_TARGET_OS_IS_UEFI) | ||||
target_link_options(${fq_build_target_name} PRIVATE | ||||
${LIBC_COMPILE_OPTIONS_DEFAULT} "-Wl,/lldmingw") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the reason for switching to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this was to fix archive libraries not linking all the symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like that's not the proper solution, though I don't know off the top of my head why symbols would be missing. I'd think that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did remember trying |
||||
endif() | ||||
|
||||
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU) | ||||
target_link_options(${fq_build_target_name} PRIVATE | ||||
${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu | ||||
|
@@ -778,7 +785,8 @@ function(add_libc_hermetic test_name) | |||
${fq_deps_list}) | ||||
# TODO: currently the dependency chain is broken such that getauxval cannot properly | ||||
# propagate to hermetic tests. This is a temporary workaround. | ||||
if (LIBC_TARGET_ARCHITECTURE_IS_AARCH64) | ||||
# getauxval does not exist on UEFI. | ||||
if (LIBC_TARGET_ARCHITECTURE_IS_AARCH64 AND NOT LIBC_TARGET_OS_IS_UEFI) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO shouldn't be needed since there's no AUX vector in UEFI. |
||||
target_link_libraries( | ||||
${fq_build_target_name} | ||||
PRIVATE | ||||
|
@@ -793,7 +801,8 @@ function(add_libc_hermetic test_name) | |||
endif() | ||||
|
||||
set(test_cmd ${HERMETIC_TEST_ENV} | ||||
$<$<BOOL:${LIBC_TARGET_OS_IS_GPU}>:${gpu_loader_exe}> ${CMAKE_CROSSCOMPILING_EMULATOR} ${HERMETIC_TEST_LOADER_ARGS} | ||||
$<$<BOOL:${LIBC_TARGET_OS_IS_GPU}>:${gpu_loader_exe}> ${CMAKE_CROSSCOMPILING_EMULATOR} | ||||
$<$<BOOL:${LIBC_TARGET_OS_IS_UEFI}>:${LIBC_TARGET_TRIPLE}> ${HERMETIC_TEST_LOADER_ARGS} | ||||
$<TARGET_FILE:${fq_build_target_name}> ${HERMETIC_TEST_ARGS}) | ||||
add_custom_target( | ||||
${fq_target_name} | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"errno": { | ||
"LIBC_CONF_ERRNO_MODE": { | ||
"value": "LIBC_ERRNO_MODE_SHARED" | ||
} | ||
}, | ||
"printf": { | ||
"LIBC_CONF_PRINTF_DISABLE_FLOAT": { | ||
"value": true | ||
}, | ||
"LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": { | ||
"value": true | ||
}, | ||
"LIBC_CONF_PRINTF_DISABLE_WRITE_INT": { | ||
"value": true | ||
}, | ||
"LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": { | ||
"value": true | ||
}, | ||
"LIBC_CONF_PRINTF_DISABLE_STRERROR": { | ||
"value": true | ||
} | ||
}, | ||
"qsort": { | ||
"LIBC_CONF_QSORT_IMPL": { | ||
"value": "LIBC_QSORT_HEAP_SORT" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this doing? This line is supposed to define the 'emulator
, so I'm guessing intentionally that this will run
x86_64-unknown-uefi-gnu test.exe`?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It adds the target triplet for the test runner.