[PATCH] D18359: Add AIX support to Path.inc, Host.h, and CMake build files.
Andrew Paprocki via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 10:42:12 PDT 2016
apaprocki created this revision.
apaprocki added a subscriber: llvm-commits.
http://reviews.llvm.org/D18359
Files:
CMakeLists.txt
cmake/modules/AddLLVM.cmake
cmake/modules/HandleLLVMOptions.cmake
include/llvm/Support/Host.h
lib/Support/Unix/Path.inc
Index: include/llvm/Support/Host.h
===================================================================
--- include/llvm/Support/Host.h
+++ include/llvm/Support/Host.h
@@ -18,6 +18,8 @@
#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
#include <endian.h>
+#elif defined(_AIX)
+#include <sys/machine.h>
#else
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
#include <machine/endian.h>
Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -74,11 +74,11 @@
if(UNIX)
set(LLVM_ON_WIN32 0)
set(LLVM_ON_UNIX 1)
- if(APPLE)
+ if(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- else(APPLE)
+ else()
set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
- endif(APPLE)
+ endif()
else(UNIX)
MESSAGE(SEND_ERROR "Unable to determine platform")
endif(UNIX)
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -69,6 +69,9 @@
COMMENT "Creating export file for ${target_name}")
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+ set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+ LINK_FLAGS " -Wl,-bE:${export_file}")
elseif(LLVM_HAVE_LINK_VERSION_SCRIPT)
# Gold and BFD ld require a version script rather than a plain list.
set(native_export_file "${target_name}.exports")
@@ -156,7 +159,7 @@
# Pass -O3 to the linker. This enabled different optimizations on different
# linkers.
- if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|SunOS" OR WIN32))
+ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|SunOS|AIX" OR WIN32))
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-O3")
endif()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -587,7 +587,7 @@
# check its symbols. This is wasteful (the check was done when foo.so
# was created) and can fail since it is not the dynamic linker and
# doesn't know how to handle search paths correctly.
-if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS|AIX")
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
endif()
Index: lib/Support/Unix/Path.inc
===================================================================
--- lib/Support/Unix/Path.inc
+++ lib/Support/Unix/Path.inc
@@ -67,7 +67,8 @@
namespace fs {
#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) || \
- defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__)
+ defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__) || \
+ defined(_AIX)
static int
test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
{
@@ -138,7 +139,7 @@
}
#elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
defined(__OpenBSD__) || defined(__minix) || defined(__DragonFly__) || \
- defined(__FreeBSD_kernel__)
+ defined(__FreeBSD_kernel__) || defined(_AIX)
char exe_path[PATH_MAX];
if (getprogpath(exe_path, argv0) != NULL)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18359.51299.patch
Type: text/x-patch
Size: 3660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160322/a56d3d2a/attachment.bin>
More information about the llvm-commits
mailing list