-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[CMake] Remove HAVE_LINK_H #104893
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
[CMake] Remove HAVE_LINK_H #104893
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.5-bogner
@llvm/pr-subscribers-llvm-support Author: Fangrui Song (MaskRay) ChangesWe can remove the variable from https://reviews.llvm.org/D5610 since Full diff: https://github.com/llvm/llvm-project/pull/104893.diff 8 Files Affected:
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 0aae13e30f2ab4..f76eacb9d51366 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -44,7 +44,6 @@ endif()
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(errno.h HAVE_ERRNO_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
-check_include_file(link.h HAVE_LINK_H)
check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H)
if( NOT PURE_WINDOWS )
check_include_file(pthread.h HAVE_PTHREAD_H)
diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake
index ff30741c8f360a..f39d2d56d61e89 100644
--- a/llvm/include/llvm/Config/config.h.cmake
+++ b/llvm/include/llvm/Config/config.h.cmake
@@ -125,9 +125,6 @@
/* Define to 1 if you have the `pthread_setname_np' function. */
#cmakedefine HAVE_PTHREAD_SETNAME_NP ${HAVE_PTHREAD_SETNAME_NP}
-/* Define to 1 if you have the <link.h> header file. */
-#cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
-
/* Define to 1 if you have the <mach/mach.h> header file. */
#cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 298fde1a387cc5..196e2f0e336350 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -65,9 +65,6 @@
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
-#if HAVE_LINK_H
-#include <link.h>
-#endif
#ifdef HAVE__UNWIND_BACKTRACE
// FIXME: We should be able to use <unwind.h> for any target that has an
// _Unwind_Backtrace function, but on FreeBSD the configure test passes
@@ -464,7 +461,7 @@ void llvm::sys::AddSignalHandler(sys::SignalHandlerCallback FnPtr,
RegisterHandlers();
}
-#if ENABLE_BACKTRACES && defined(HAVE_BACKTRACE) && HAVE_LINK_H && \
+#if ENABLE_BACKTRACES && defined(HAVE_BACKTRACE) && \
(defined(__linux__) || defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || defined(__NetBSD__))
struct DlIteratePhdrData {
diff --git a/llvm/unittests/Support/SignalsTest.cpp b/llvm/unittests/Support/SignalsTest.cpp
index a41b37c8f82c94..296478567e2903 100644
--- a/llvm/unittests/Support/SignalsTest.cpp
+++ b/llvm/unittests/Support/SignalsTest.cpp
@@ -29,7 +29,7 @@ using testing::Not;
// %i in the Symbolizer Markup Format spec
#define I_REGEX "(0x[0-9a-fA-F]+|0[0-7]+|[0-9]+)"
-#if defined(HAVE_BACKTRACE) && ENABLE_BACKTRACES && HAVE_LINK_H && \
+#if defined(HAVE_BACKTRACE) && ENABLE_BACKTRACES && \
(defined(__linux__) || defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || defined(__NetBSD__))
TEST(SignalsTest, PrintsSymbolizerMarkup) {
diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
index 1b0d4a10e4610e..1c9c19241508a7 100644
--- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
@@ -140,14 +140,12 @@ write_cmake_config("config") {
if (current_os == "linux" || current_os == "android") {
values += [
"HAVE_FUTIMENS=1",
- "HAVE_LINK_H=1",
"HAVE_MALLINFO=1",
"HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
]
} else {
values += [
"HAVE_FUTIMENS=",
- "HAVE_LINK_H=",
"HAVE_MALLINFO=",
"HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=",
]
diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
index 9de966688eda50..6e703d22e77567 100644
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
@@ -47,7 +47,6 @@ posix_defines = [
linux_defines = posix_defines + [
"_GNU_SOURCE",
- "HAVE_LINK_H=1",
"HAVE_MALLINFO=1",
"HAVE_SBRK=1",
"HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
index a4fb47d677ab15..15696c346bff17 100644
--- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
+++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
@@ -141,9 +141,6 @@
/* Define to 1 if you have the `pthread_setname_np' function. */
#define HAVE_PTHREAD_SETNAME_NP 1
-/* Define to 1 if you have the <link.h> header file. */
-/* HAVE_LINK_H defined in Bazel */
-
/* Define to 1 if you have the <mach/mach.h> header file. */
/* HAVE_MACH_MACH_H defined in Bazel */
diff --git a/utils/bazel/llvm_configs/config.h.cmake b/utils/bazel/llvm_configs/config.h.cmake
index ff30741c8f360a..f39d2d56d61e89 100644
--- a/utils/bazel/llvm_configs/config.h.cmake
+++ b/utils/bazel/llvm_configs/config.h.cmake
@@ -125,9 +125,6 @@
/* Define to 1 if you have the `pthread_setname_np' function. */
#cmakedefine HAVE_PTHREAD_SETNAME_NP ${HAVE_PTHREAD_SETNAME_NP}
-/* Define to 1 if you have the <link.h> header file. */
-#cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
-
/* Define to 1 if you have the <mach/mach.h> header file. */
#cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
|
LGTM but I guess @Endilll should stamp it. |
Endilll
approved these changes
Aug 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bazel
"Peripheral" support tier build system: utils/bazel
cmake
Build system in general and CMake in particular
llvm:support
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We can remove the variable from https://reviews.llvm.org/D5610 since
link.h is available on Linux (glibc/musl/Bionic), FreeBSD, and NetBSD.
Use
__has_include(<link.h>)
before including it.