Minimum gcc version required for openssl 3.x?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Minimum gcc version required for openssl 3.x?

Thomas Dwyer III
I searched all the docs I could find but I was unable to locate any statements regarding gcc compatibility for openssl 3.x. I'm having a problem cross-compiling for arm using gcc-4.4.5:

rm -f libssl.so && \
        ln -s libssl.so.3 libssl.so
arm-linux-gnueabi-gcc  -Iinclude  -fPIC -pthread -Wall -O3 -DNDEBUG -DL_ENDIAN -DOPENSSL_NO_COMP -MMD -MF engines/capi-dso-e_capi.d.tmp -MT engines/capi-dso-e_capi.o -c -o engines/capi-dso-e_capi.o engines/e_capi.c
/workspace/XXXXXX/perl/bin/perl ./util/mkdef.pl --ordinals util/engines.num  --name engines/capi --OS linux > engines/capi.ld
arm-linux-gnueabi-gcc -fPIC -pthread -Wall -O3 -L. -z defs -Wl,-znodelete -shared -Wl,-Bsymbolic   \
                -o engines/capi.so -Wl,--version-script=engines/capi.ld \
                engines/capi-dso-e_capi.o \
                -lcrypto -ldl -pthread
arm-linux-gnueabi-gcc: defs: No such file or directory
gmake[5]: *** [engines/capi.so] Error 1

I found that gcc-4.9.2 works fine (odd, see below), as does the following patch:

$ git diff Configurations/shared-info.pl
diff --git a/Configurations/shared-info.pl b/Configurations/shared-info.pl
index a673c7c..461ce3c 100644
--- a/Configurations/shared-info.pl
+++ b/Configurations/shared-info.pl
@@ -36,7 +36,7 @@ my %shared_info;
                 (grep /(?:^|\s)-fsanitize/,
                  @{$config{CFLAGS}}, @{$config{cflags}})
                 ? ''
-                : '-z defs',
+                : '-Wl,-z,defs',
         };
     },
     'bsd-gcc-shared' => sub { return $shared_info{'linux-shared'}; },

Although this works in gcc-4.9.2, it appears that the -z flag wasn't documented until gcc-5.5. All Google hits I get for "-z defs" take me to pages that show "-Wl,-z,defs" so it's curious that this particular option isn't being passed with -Wl like the others. Is there a minimum supported gcc version for openssl 3.x?


Thanks,
Tom.III

Reply | Threaded
Open this post in threaded view
|

Re: Minimum gcc version required for openssl 3.x?

Matt Caswell-2


On 13/05/2020 00:21, Thomas Dwyer III wrote:
> Although this works in gcc-4.9.2, it appears that the -z flag wasn't
> documented until gcc-5.5. All Google hits I get for "-z defs" take me to
> pages that show "-Wl,-z,defs" so it's curious that this particular
> option isn't being passed with -Wl like the others. Is there a minimum
> supported gcc version for openssl 3.x?

None has been specified. You might want to submit your patch as a PR.

Matt