Configurations/10-main.cf: AIX "facelift".
authorAndy Polyakov <appro@openssl.org>
Sat, 3 Sep 2016 20:03:55 +0000 (22:03 +0200)
committerAndy Polyakov <appro@openssl.org>
Thu, 8 Sep 2016 07:12:10 +0000 (09:12 +0200)
Improve interchangeability of aix*-gcc targets by linking shared
libraries with -static-libgcc, and address linking problems with
vendor compiler.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit f780eaad5be140cf192191b8d79dc3671443e0b2)

Configurations/10-main.conf
Makefile.shared

index 843647d58db7b21cd998d46212dc894493bb2bc2..008120beab3dda2b6098887ea6e3d597dac3084a 100644 (file)
@@ -1142,6 +1142,11 @@ sub vms_info {
     },
 
 #### IBM's AIX.
+    # Below targets assume AIX >=5. Caveat lector. If you are accustomed
+    # to control compilation "bitness" by setting $OBJECT_MODE environment
+    # variable, then you should know that in OpenSSL case it's considered
+    # only in ./config. Once configured, build procedure remains "deaf" to
+    # current value of $OBJECT_MODE.
     "aix-gcc" => {
         inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
         cc               => "gcc",
@@ -1155,7 +1160,7 @@ sub vms_info {
         perlasm_scheme   => "aix32",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-shared -Wl,-G",
+        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
         shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
         arflags          => "-X32",
     },
@@ -1172,13 +1177,10 @@ sub vms_info {
         perlasm_scheme   => "aix64",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-maix64 -shared -Wl,-G",
+        shared_ldflag    => "-maix64 -shared -static-libgcc -Wl,-G",
         shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
         arflags          => "-X64",
     },
-    # Below targets assume AIX 5. Idea is to effectively disregard
-    # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
-    # ./config stage!
     "aix-cc" => {
         inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
         cc               => "cc",
@@ -1189,6 +1191,7 @@ sub vms_info {
         sys_id           => "AIX",
         bn_ops           => "BN_LLONG RC4_CHAR",
         thread_scheme    => "pthreads",
+        ex_libs          => threads("-lpthreads"),
         perlasm_scheme   => "aix32",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
@@ -1206,6 +1209,7 @@ sub vms_info {
         sys_id           => "AIX",
         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
         thread_scheme    => "pthreads",
+        ex_libs          => threads("-lpthreads"),
         perlasm_scheme   => "aix64",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
index d856180bf134d8ae22249c29857118cc03722e3d..77dae6e791e33bf9fe89f1950c0de645ac4047bb 100644 (file)
@@ -150,8 +150,8 @@ LINK_SO_DSO=        INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
 LINK_SO_SHLIB_VIA_O=   \
   SHOBJECTS=$(DSTDIR)/lib$(LIBNAME).o; \
   ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
-  ( echo ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
-    ld $(LDFLAGS) -r -o $$SHOBJECTS.o $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \
+  ( echo ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
+    ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(DSTDIR)/lib$(LIBNAME).a $(LIBEXTRAS) ); \
   $(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
 
 LINK_SO_SHLIB_UNPACKED=        \
@@ -526,6 +526,7 @@ link_dso.aix:
        ALLSYMSFLAGS=''; \
        NOALLSYMSFLAGS=''; \
        SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
+       rm -f $(DSTDIR)/$$SHLIB$$SHLIB_SOVER 2>&1 > /dev/null ; \
        $(LINK_SO_DSO);
 link_shlib.aix:
        @ $(CALC_VERSIONS); \
@@ -536,6 +537,7 @@ link_shlib.aix:
        ALLSYMSFLAGS='-bnogc'; \
        NOALLSYMSFLAGS=''; \
        SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
+       rm -f $(DSTDIR)/$$SHLIB$$SHLIB_SOVER 2>&1 > /dev/null ; \
        $(LINK_SO_SHLIB_VIA_O)
 link_app.aix:
        LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \