Build: Make NonStop shared libraries only export selected symbols

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)
This commit is contained in:
Richard Levitte 2020-09-23 16:52:13 +02:00
parent 8a288609b1
commit 7a032be7f2
3 changed files with 23 additions and 10 deletions

View 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:
@ -97,7 +102,8 @@
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=',
},
@ -171,7 +177,7 @@
},
######################################################################
# 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',

View 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;

View File

@ -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 <<"_____";
;