Skip to content

Commit

Permalink
Fix Aix Build (#3860)
Browse files Browse the repository at this point in the history
* Fix : Aix System NumberFormatter Build Error

* Fix : Aix System OpenSSL 3.0 Build Support

 - https://github.com/openssl/openssl/blob/openssl-3.0.0/NOTES-UNIX.md?plain=1#L110

* Add : Aix System Gcc Build Support

* Revert "Add : Aix System Gcc Build Support"

This reverts commit b9a4b90.

* Add : Aix System Gcc Build Support
  • Loading branch information
OneTop4458 authored and aleks-f committed Nov 27, 2023
1 parent ddb94b9 commit f781cd5
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ include $(POCO_BASE)/build/rules/global

# see https://github.com/pocoproject/poco/issues/3073
GLOBAL_SYSLIBS := $(SYSLIBS)
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS = -lssl_a -lcrypto_a
else
SYSLIBS = -lssl -lcrypto
endif
SYSLIBS += $(GLOBAL_SYSLIBS)

objects = Cipher CipherFactory CipherImpl CipherKey CipherKeyImpl \
Expand Down
4 changes: 4 additions & 0 deletions Crypto/samples/genrsakey/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif
objects = genrsakey

target = genrsakey
Expand Down
4 changes: 4 additions & 0 deletions Crypto/testsuite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = CryptoTestSuite Driver \
CryptoTest DigestEngineTest ECTest \
Expand Down
2 changes: 1 addition & 1 deletion Foundation/include/Poco/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using UIntPtr = std::uintptr_t;
#if defined(__LP64__)
#define POCO_PTR_IS_64_BIT 1
#define POCO_LONG_IS_64_BIT 1
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_AIX
#define POCO_INT64_IS_LONG 1
#endif
#endif
Expand Down
5 changes: 4 additions & 1 deletion NetSSL_OpenSSL/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
#

include $(POCO_BASE)/build/rules/global

ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a
else
SYSLIBS += -lssl -lcrypto
endif

objects = AcceptCertificateHandler RejectCertificateHandler ConsoleCertificateHandler \
CertificateHandlerFactory CertificateHandlerFactoryMgr \
Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/samples/HTTPSTimeServer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = HTTPSTimeServer

Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/samples/Mail/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = Mail

Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/samples/SetSourceIP/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ include $(POCO_BASE)/build/rules/global
ifeq ($(POCO_CONFIG),FreeBSD)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif

objects = SetSourceIP

Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/samples/TwitterClient/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = Twitter TweetApp

Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/samples/download/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = download

Expand Down
4 changes: 4 additions & 0 deletions NetSSL_OpenSSL/testsuite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ else
ifeq ($(POCO_CONFIG),QNX)
SYSLIBS += -lssl -lcrypto -lz
else
ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX)
SYSLIBS += -lssl_a -lcrypto_a -lz -ldl
else
SYSLIBS += -lssl -lcrypto -lz -ldl
endif
endif
endif

objects = NetSSLTestSuite Driver \
HTTPSClientSessionTest HTTPSClientTestSuite HTTPSServerTest HTTPSServerTestSuite \
Expand Down
82 changes: 82 additions & 0 deletions build/config/AIX-GCC
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#
# AIX-GCC
#
# Make settings for AIX6.x/gcc 5.5
#
#

#
# General Settings
#
LINKMODE ?= SHARED

SANITIZEFLAGS ?=

#
# Define Tools
#
CC = ${CROSS_COMPILE}gcc
CXX = ${CROSS_COMPILE}g++
LINK = $(CXX)
LIB = $(CROSS_COMPILE)ar -cr -X32_64
RANLIB = $(CROSS_COMPILE)ranlib
## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability).
SHLIB = $(CXX) $(LDFLAGS) -shared -Wl,-bexpfull -o $@
SHLIBLN = $(POCO_BASE)/build/script/shlibln
STRIP = $(CROSS_COMPILE)strip -X32_64
DEP = $(POCO_BASE)/build/script/makedepend.gcc
SHELL = sh
RM = rm -rf
CP = cp
MKDIR = mkdir -p
LDFLAGS += -Wl,-bbigtoc

## http://www.ibm.com/developerworks/aix/library/au-gnu.html:
## > "/Using -brtl, the AIX linker will look for libraries with both the .a and
## > .so extensions, such as libfoo.a and libfoo.so.
## > Without -brtl, the AIX linker looks only for libfoo.a
#
# Extension for Shared Libraries
#
SHAREDLIBEXT = .so.$(target_version)
SHAREDLIBLINKEXT = .a

#
# Compiler and Linker Flags
#
CFLAGS = $(SANITIZEFLAGS) -std=c11
CFLAGS32 = -maix32
CFLAGS64 = -maix64
CXXFLAGS = $(SANITIZEFLAGS) -std=c++14 -Wno-sign-compare
CXXFLAGS32 = -maix32
CXXFLAGS64 = -maix64
SHLIBFLAGS = -Wl,-bh:5 -Wl,-bnoipath -Wl,-blibpath:/usr/lib:/lib -Wl,-blibsuff:so -Wl,-bautoexp -Wl,-bnoentry -Wl,-bM:SRE
SHLIBFLAGS32 = -maix32
SHLIBFLAGS64 = -maix64
LINKFLAGS = $(SANITIZEFLAGS) -Wl,-bh:5 -Wl,-bnoipath -Wl,-blibpath:/usr/lib:/lib -Wl,-blibsuff:so -Wl,-brtl
LINKFLAGS32 = -maix32
LINKFLAGS64 = -maix64
STATICOPT_CC =
STATICOPT_CXX =
STATICOPT_LINK =
SHAREDOPT_CC = -fPIC
SHAREDOPT_CXX = -fPIC
SHAREDOPT_LINK =
DEBUGOPT_CC = -g -D_DEBUG
DEBUGOPT_CXX = -g -D_DEBUG
DEBUGOPT_LINK = -g
RELEASEOPT_CC = -O2 -DNDEBUG
RELEASEOPT_CXX = -O2 -DNDEBUG
RELEASEOPT_LINK = -O2

#
# System Specific Flags
#
# Please note: add -v flag : print out how gcc performs compilation on the screen.
# see https://github.com/pocoproject/poco/issues/3795
SYSFLAGS = -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS
#
# System Specific Libraries
#
# -pthread is just that it should always be passed for a program using threads on AIX. -lpthread is not enough most of the time
SYSLIBS = -pthread -latomic -ldl

0 comments on commit f781cd5

Please sign in to comment.