Build: Make NonStop shared libraries only export selected symbols
authorRichard Levitte <levitte@openssl.org>
Wed, 23 Sep 2020 14:52:13 +0000 (16:52 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 25 Sep 2020 10:05:47 +0000 (12:05 +0200)
We can now re-enable test/recipes/01-test_symbol_presence.t for NonStop.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12962)

Configurations/50-nonstop.conf
test/recipes/01-test_symbol_presence.t
util/mkdef.pl

index 64385a809a12509a9c323d26e4007fcaadfc53a6..21cd64833dfb119060bbdb35d982a8d3ef5a406c 100644 (file)
@@ -16,7 +16,7 @@
                                 '_TANDEM_SOURCE',
                                 'B_ENDIAN'),
         perl             => '/usr/bin/perl',
-        shared_target    => 'self',
+        shared_target    => 'nonstop-shared',
         shared_extension => ".so",
         ex_libs          => add('-lrld'),
         enable           => ['egd'],
@@ -50,7 +50,8 @@
         defines          => ['NO_GETPID'],
         cflags           => '-Wtarget=tns/r -Wsystype=guardian',
         lflags           => '-Wld="-set systype guardian"',
-        shared_ldflag    => '-Wshared -Wld="-export_all -soname $(@:lib%.so=%)"',
+        shared_ldflag    => '-Wshared -Wld="-soname $(@:lib%.so=%)"',
+        shared_defflag   => '-Wld_obey=',
         shared_argfileflag => '-Wld_obey=',
     },
 
@@ -60,7 +61,8 @@
         defines          => ['NO_GETPID', '_TANDEM_ARCH=2'],
         cflags           => '-Wtarget=tns/e -Wsystype=guardian',
         lflags           => '-Weld="-set systype guardian"',
-        shared_ldflag    => '-Wshared -Weld="-export_all -soname $(@:lib%.so=%)"',
+        shared_ldflag    => '-Wshared -Weld="-soname $(@:lib%.so=%)"',
+        shared_defflag   => '-Weld_obey=',
         shared_argfileflag => '-Weld_obey=',
     },
 
@@ -70,7 +72,8 @@
         defines          => ['NO_GETPID', '_TANDEM_ARCH=3'],
         cflags           => '-Wtarget=tns/x -Wsystype=guardian',
         lflags           => '-Wxld="-set systype guardian"',
-        shared_ldflag    => '-Wshared -Wxld="-export_all -soname $(@:lib%.so=%)"',
+        shared_ldflag    => '-Wshared -Wxld="-soname $(@:lib%.so=%)"',
+        shared_defflag   => '-Wxld_obey=',
         shared_argfileflag => '-Wxld_obey=',
     },
 
@@ -79,7 +82,8 @@
         template         => 1,
         cflags           => '-Wtarget=tns/r -Wsystype=oss',
         lflags           => '-Wld="-set systype oss"',
-        shared_ldflag    => '-Wshared -Wld="-export_all"',
+        shared_ldflag    => '-Wshared',
+        shared_defflag   => '-Wld_obey=',
         shared_argfileflag => '-Wld_obey=',
     },
     # Itanium + oss:
@@ -88,7 +92,8 @@
         defines          => ['_TANDEM_ARCH=2'],
         cflags           => '-Wtarget=tns/e -Wsystype=oss',
         lflags           => '-Weld="-set systype oss"',
-        shared_ldflag    => '-Wshared -Weld="-export_all"',
+        shared_ldflag    => '-Wshared',
+        shared_defflag   => '-Weld_obey=',
         shared_argfileflag => '-Weld_obey=',
     },
     # x86_64 + oss:
         defines          => ['_TANDEM_ARCH=3'],
         cflags           => '-Wtarget=tns/x -Wsystype=oss',
         lflags           => '-Wxld="-set systype oss"',
-        shared_ldflag    => '-Wshared -Wxld="-export_all"',
+        shared_ldflag    => '-Wshared',
+        shared_defflag   => '-Wxld_obey=',
         shared_argfileflag => '-Wxld_obey=',
     },
 
     },
 
     ######################################################################
-    # Now for the entried themselves, let's combine things!
+    # Now for the entries themselves, let's combine things!
     'nonstop-nsx' => {
         inherit_from     => [ 'nonstop-common',
                               'nonstop-archenv-x86_64-oss',
index f22133d9d2d8e999b9deddcd45109fe61cfc1efa..d339770b0fabd6b46e5548686fb5fdf847862e4d 100644 (file)
@@ -17,8 +17,6 @@ setup("test_symbol_presence");
 plan skip_all => "Only useful when building shared libraries"
     if disabled("shared");
 
-plan skip_all => "Test is disabled on NonStop" if config('target') =~ m|^nonstop|;
-
 my @libnames = ("crypto", "ssl");
 my $testcount = scalar @libnames;
 
index 5e02c7dafbcf5849549cdc277751a8f3d686c4e1..a4772e9c8f033ed8a87db9bd785872bfe2bb1439 100755 (executable)
@@ -128,6 +128,9 @@ my %OS_data = (
     NT          => 'WIN32',     # alias
     nt          => 'WIN32',     # alias
     mingw       => 'WINDOWS',   # alias
+    nonstop     => { writer     => \&writer_nonstop,
+                     sort       => OpenSSL::Ordinals::by_name(),
+                     platforms  => { TANDEM                     => 1 } },
    );
 
 do {
@@ -280,6 +283,12 @@ sub writer_aix {
     }
 }
 
+sub writer_nonstop {
+    for (@_) {
+        print "-export ",$_->name(),"\n";
+    }
+}
+
 sub writer_windows {
     print <<"_____";
 ;