From 93177ee09ab71c9c5498bfc12fd3619fa5b43935 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 1 Jul 2015 08:48:42 +0200 Subject: [PATCH] Fix build problems on AIX fixes #9531 --- CMakeLists.txt | 6 ++++-- third-party/socketpair/socketpair.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 203a77e61..3241607cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,8 +142,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") endif() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") + if(NOT CMAKE_SYSTEM_NAME MATCHES AIX) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") + endif() endif() if(ICINGA2_LTO_BUILD) diff --git a/third-party/socketpair/socketpair.c b/third-party/socketpair/socketpair.c index b8b9f2858..6ad0e7038 100644 --- a/third-party/socketpair/socketpair.c +++ b/third-party/socketpair/socketpair.c @@ -146,7 +146,7 @@ int dumb_socketpair(int socks[2], int dummy) errno = EINVAL; return -1; } - dummy = socketpair(AF_LOCAL, SOCK_STREAM, 0, socks); + dummy = socketpair(AF_UNIX, SOCK_STREAM, 0, socks); if (dummy) socks[0] = socks[1] = -1; return dummy;