[PATCH] D102084: Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h
Mariusz Ceier via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 8 00:53:16 PDT 2021
mceier updated this revision to Diff 343819.
mceier marked an inline comment as done.
mceier edited the summary of this revision.
mceier added a comment.
Verified that standalone lld builds with HAVE_LIBXAR set and unset.
Added HAVE_LIBXAR to LLVMConfig.cmake and linking liblldMachO2.so with XAR_LIB if HAVE_LIBXAR is set.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102084/new/
https://reviews.llvm.org/D102084
Files:
lld/CMakeLists.txt
lld/MachO/CMakeLists.txt
lld/MachO/Driver.cpp
lld/MachO/SyntheticSections.cpp
llvm/cmake/modules/LLVMConfig.cmake.in
llvm/include/llvm/Config/config.h.cmake
llvm/include/llvm/Config/llvm-config.h.cmake
Index: llvm/include/llvm/Config/llvm-config.h.cmake
===================================================================
--- llvm/include/llvm/Config/llvm-config.h.cmake
+++ llvm/include/llvm/Config/llvm-config.h.cmake
@@ -94,4 +94,7 @@
/* Define to 1 to enable the experimental new pass manager by default */
#cmakedefine01 LLVM_ENABLE_NEW_PASS_MANAGER
+/* Define if the xar_open() function is supported on this platform. */
+#cmakedefine HAVE_LIBXAR ${HAVE_LIBXAR}
+
#endif
Index: llvm/include/llvm/Config/config.h.cmake
===================================================================
--- llvm/include/llvm/Config/config.h.cmake
+++ llvm/include/llvm/Config/config.h.cmake
@@ -220,9 +220,6 @@
/* Define if the setupterm() function is supported this platform. */
#cmakedefine LLVM_ENABLE_TERMINFO ${LLVM_ENABLE_TERMINFO}
-/* Define if the xar_open() function is supported this platform. */
-#cmakedefine HAVE_LIBXAR ${HAVE_LIBXAR}
-
/* Define to 1 if you have the <termios.h> header file. */
#cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H}
Index: llvm/cmake/modules/LLVMConfig.cmake.in
===================================================================
--- llvm/cmake/modules/LLVMConfig.cmake.in
+++ llvm/cmake/modules/LLVMConfig.cmake.in
@@ -111,6 +111,8 @@
set(LLVM_DEFAULT_EXTERNAL_LIT "@LLVM_CONFIG_DEFAULT_EXTERNAL_LIT@")
set(LLVM_LIT_ARGS "@LLVM_LIT_ARGS@")
+set(HAVE_LIBXAR "@HAVE_LIBXAR")
+
if(NOT TARGET LLVMSupport)
set(LLVM_EXPORTED_TARGETS "@LLVM_CONFIG_EXPORTS@")
include("@LLVM_CONFIG_EXPORTS_FILE@")
Index: lld/MachO/SyntheticSections.cpp
===================================================================
--- lld/MachO/SyntheticSections.cpp
+++ lld/MachO/SyntheticSections.cpp
@@ -20,7 +20,7 @@
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/LEB128.h"
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -31,7 +31,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/BinaryFormat/Magic.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/LTO/LTO.h"
#include "llvm/Object/Archive.h"
#include "llvm/Option/ArgList.h"
Index: lld/MachO/CMakeLists.txt
===================================================================
--- lld/MachO/CMakeLists.txt
+++ lld/MachO/CMakeLists.txt
@@ -48,6 +48,7 @@
LINK_LIBS
lldCommon
${LLVM_PTHREAD_LIB}
+ ${XAR_LIB}
DEPENDS
MachOOptionsTableGen
Index: lld/CMakeLists.txt
===================================================================
--- lld/CMakeLists.txt
+++ lld/CMakeLists.txt
@@ -110,6 +110,10 @@
set(LLVM_INCLUDE_TESTS OFF)
endif()
endif()
+
+ if(HAVE_LIBXAR)
+ set(XAR_LIB xar)
+ endif()
endif()
set(LLD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102084.343819.patch
Type: text/x-patch
Size: 3074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210508/dff91efe/attachment.bin>
More information about the llvm-commits
mailing list