Skip to content

Conversation

@michaelrj-google
Copy link
Contributor

We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).

For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.

We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).

For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.
@llvmbot
Copy link
Member

llvmbot commented Oct 31, 2024

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).

For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.


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

2 Files Affected:

  • (modified) libc/test/src/search/hsearch_test.cpp (-1)
  • (modified) libc/test/src/sys/mman/linux/mlock_test.cpp (-2)
diff --git a/libc/test/src/search/hsearch_test.cpp b/libc/test/src/search/hsearch_test.cpp
index f7d94791f2bc03..01805d8f5b4da9 100644
--- a/libc/test/src/search/hsearch_test.cpp
+++ b/libc/test/src/search/hsearch_test.cpp
@@ -15,7 +15,6 @@
 #include "src/search/hsearch.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
-#include <asm-generic/errno-base.h>
 
 TEST(LlvmLibcHsearchTest, CreateTooLarge) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
diff --git a/libc/test/src/sys/mman/linux/mlock_test.cpp b/libc/test/src/sys/mman/linux/mlock_test.cpp
index 804038a68a7e09..c6e459276a8fbf 100644
--- a/libc/test/src/sys/mman/linux/mlock_test.cpp
+++ b/libc/test/src/sys/mman/linux/mlock_test.cpp
@@ -23,8 +23,6 @@
 #include "test/UnitTest/LibcTest.h"
 #include "test/UnitTest/Test.h"
 
-#include <asm-generic/errno-base.h>
-#include <asm-generic/mman.h>
 #include <linux/capability.h>
 #include <sys/mman.h>
 #include <sys/resource.h>

Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

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

Please test full build and overlay mode locally before submitting.

@michaelrj-google
Copy link
Contributor Author

Tests passed on both overlay and fullbuild. Merging.

@michaelrj-google michaelrj-google merged commit 3af87d4 into llvm:main Oct 31, 2024
7 of 8 checks passed
@michaelrj-google michaelrj-google deleted the libcNoAsmGeneric branch November 1, 2024 21:41
smallp-o-p pushed a commit to smallp-o-p/llvm-project that referenced this pull request Nov 3, 2024
We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).

For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).

For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.
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.

4 participants