summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Kraft <Matthias.Kraft@softwareag.com>2020-05-25 10:10:24 +0200
committerRichard Levitte <levitte@openssl.org>2020-06-18 09:14:37 +0200
commit9a7319b0b0b9ddaa440b102dc8e197d267700756 (patch)
treee76c776736808d503d4fd3270df8bd30d6de692f
parentbb361a27bafeb733417d9ab471973a333a924944 (diff)
Configure DEPs for FIPS provider on AIX.
The binder of the AIX linker needs to be told which functions to call on loading and initializing a shared object. Therefore another configuration variable shared_fipsflag is introduced, which is appended to shared_defflag when the providers/fips module gets configured. It was suggested to refactor the line in the build file template to become more generic and less magic. There is, however, currently no suggestion how to actually achive this, so we leave a TODO comment. The possible shared_fipsflag must only be appended to the shared_def iff this code is acting on behalf of the fips provider module build. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11950)
-rw-r--r--Configurations/10-main.conf1
-rw-r--r--Configurations/unix-Makefile.tmpl3
-rw-r--r--providers/fips/self_test.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index a44a74cb32..3332f03765 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1164,6 +1164,7 @@ my %targets = (
module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
shared_defflag => "-Wl,-bE:",
+ shared_fipsflag => "-Wl,-binitfini:init:cleanup",
perl_platform => 'AIX',
},
"aix-gcc" => {
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 126180ace7..fc4f60770b 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -1485,7 +1485,8 @@ EOF
@{$args{objs}};
my @deps = compute_lib_depends(@{$args{deps}});
my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
-
+ # TODO(3.0): next line needs to become "less magic" (see PR #11950)
+ $shared_def .= ' '.$target{shared_fipsflag} if (m/providers\/fips/ && defined $target{shared_fipsflag});
my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
fill_lines(' ', $COLUMNS - length($dso) - 2,
diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c
index 4619fedef5..c482544346 100644
--- a/providers/fips/self_test.c
+++ b/providers/fips/self_test.c
@@ -92,7 +92,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
return TRUE;
}
-#elif defined(__sun)
+#elif defined(__sun) || defined(_AIX)
DEP_DECLARE() /* must be declared before pragma */
# define DEP_INIT_ATTRIBUTE