Skip to content

[libc] fix unit tests in fullbuild #78864

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

Merged
merged 5 commits into from
Jan 22, 2024

Conversation

SchrodingerZhu
Copy link
Contributor

@SchrodingerZhu SchrodingerZhu commented Jan 20, 2024

fixes #78743

@llvmbot llvmbot added the libc label Jan 20, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 20, 2024

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/78864.diff

1 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+1-1)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 24f543f6e4c132b..9b7e9180275414a 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -187,7 +187,7 @@ function(create_libc_unittest fq_target_name)
   if(LLVM_LIBC_FULL_BUILD)
     target_compile_options(
       ${fq_build_target_name}
-      PRIVATE -ffreestanding
+      PRIVATE -ffreestanding -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables
     )
   endif()
   if(LIBC_UNITTEST_COMPILE_OPTIONS)

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought unit tests were supposed to be hosted even in full build mode. Though I'm unsure why we pass -ffreestanding in the first place. I forget what we do for the hermetic tests, maybe -nostdlib?

@SchrodingerZhu
Copy link
Contributor Author

I thought unit tests were supposed to be hosted even in full build mode. Though I'm unsure why we pass -ffreestanding in the first place. I forget what we do for the hermetic tests, maybe -nostdlib?

Not sure. I do see freestanding flying around fullbuild targets everywhere.

@SchrodingerZhu SchrodingerZhu marked this pull request as draft January 20, 2024 21:36
@SchrodingerZhu SchrodingerZhu marked this pull request as ready for review January 21, 2024 03:59
@SchrodingerZhu SchrodingerZhu merged commit be0fa31 into llvm:main Jan 22, 2024
@SchrodingerZhu SchrodingerZhu deleted the libc/fix-unit-tests branch January 22, 2024 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libc] Unit tests fail to build in fullbuild due to undefined symbols
4 participants