[openssl-users] undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Michael Wojcik Michael.Wojcik at microfocus.com
Fri Feb 17 22:03:58 UTC 2017


> From: openssl-users [mailto:openssl-users-bounces at openssl.org] On Behalf
> Of Richard Levitte
> Sent: Friday, February 17, 2017 14:57
> 
> In message <1481BC8A-3E0C-4598-9556-0A83F78AC763 at dukhovni.org> on
> Fri, 17 Feb 2017 14:15:10 -0500, Viktor Dukhovni <openssl-
> users at dukhovni.org> said:
> 
> openssl-users> I would avoid adding that library dependency to all the code just because
> openssl-users> a test program uses fabs().  It is better to just avoid fabs() in the test
> openssl-users> code, or add "-lm" for just that program (or perhaps just all the test
> openssl-users> programs).
> 
> This would mean adding that in test/build.info.  Unfortunately, libm
> is Unix and the build.info are meant to be platform agnostic, so it's
> kind of a no can do.  I'll have a thought on this kind of thing.

For the record, we've always just changed the Solaris configuration we use in Configure to add -lm. While I understand Viktor's reservations about adding a library just for a test program, pretty much all other UNIX platforms long ago simply put all the libm functionality into libc and made libm a vestigial empty library. Adding -lm for Solaris just makes Solaris behave like other UNIX platforms.

The separation of the math routines such as fabs(3m) into libm is a historical accident anyway; it was done in (relatively) early UNIX implementations because they didn't have dynamic linking, and disk and memory were constrained resources.

In any event, programs that don't actually use any of the 3m routines won't resolve any symbols from libm, and so shouldn't end up loading it even if -lm is specified on the command line.

But I have no strong opinion on the matter. If the team decide it'd be better not to use -lm when linking all the Solaris executables, that's not an issue for me. We customize Configure on most platforms for various reasons; one customization more or less doesn't make much difference. I admit I'm a bit curious what other people do when building on Solaris, though.

Michael Wojcik 
Distinguished Engineer, Micro Focus 




More information about the openssl-users mailing list