undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Bill Smith
I pulled down 1.1.0e and tried to build it on Solaris 64.  I ran into the following error:


/tools/solaris/SunStudio12.2/bin/cc -xarch=v9 -mt -o test/ct_test test/ct_test.o test/testutil.o -L. -lcrypto -lresolv -lsocket -lnsl -ldl -lpthread
cc: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
Undefined                 first referenced
 symbol                             in file
fabs                                test/ct_test.o
ld: fatal: Symbol referencing errors. No output written to test/ct_test

These diffs appear to fix the issue.  Added -lm to ex_libs for Solaris.

solaris64:117$ diff -c /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf Configurations/10-main.conf
*** /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf    Thu Feb 16 06:58:20 2017
--- Configurations/10-main.conf Fri Feb 17 11:06:45 2017
***************
*** 179,185 ****
          inherit_from     => [ "BASE_unix" ],
          template         => 1,
          cflags           => "-DFILIO_H",
!         ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
          dso_scheme       => "dlfcn",
          thread_scheme    => "pthreads",
          shared_target    => "solaris-shared",
--- 179,185 ----
          inherit_from     => [ "BASE_unix" ],
          template         => 1,
          cflags           => "-DFILIO_H",
!         ex_libs          => add("-lresolv -lsocket -lnsl -ldl -lm"),
          dso_scheme       => "dlfcn",
          thread_scheme    => "pthreads",
          shared_target    => "solaris-shared",
solaris64:117$


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Viktor Dukhovni

> On Feb 17, 2017, at 1:51 PM, Bill Smith <[hidden email]> wrote:
>
> I pulled down 1.1.0e and tried to build it on Solaris 64.  I ran into the following error:
>
>
> /tools/solaris/SunStudio12.2/bin/cc -xarch=v9 -mt -o test/ct_test test/ct_test.o test/testutil.o -L. -lcrypto -lresolv -lsocket -lnsl -ldl -lpthread
> cc: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
> Undefined                 first referenced
> symbol                             in file
> fabs                                test/ct_test.o
> ld: fatal: Symbol referencing errors. No output written to test/ct_test
>
> These diffs appear to fix the issue.  Added -lm to ex_libs for Solaris.
>
> solaris64:117$ diff -c /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf Configurations/10-main.conf
> *** /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf    Thu Feb 16 06:58:20 2017
> --- Configurations/10-main.conf Fri Feb 17 11:06:45 2017
> ***************
> *** 179,185 ****
>          inherit_from     => [ "BASE_unix" ],
>          template         => 1,
>          cflags           => "-DFILIO_H",
> !         ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
>          dso_scheme       => "dlfcn",
>          thread_scheme    => "pthreads",
>          shared_target    => "solaris-shared",
> --- 179,185 ----
>          inherit_from     => [ "BASE_unix" ],
>          template         => 1,
>          cflags           => "-DFILIO_H",
> !         ex_libs          => add("-lresolv -lsocket -lnsl -ldl -lm"),
>          dso_scheme       => "dlfcn",
>          thread_scheme    => "pthreads",
>          shared_target    => "solaris-shared",
> solaris64:117$

I would avoid adding that library dependency to all the code just because
a test program uses fabs().  It is better to just avoid fabs() in the test
code, or add "-lm" for just that program (or perhaps just all the test
programs).

--
        Viktor.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Richard Levitte - VMS Whacker-2
In message <[hidden email]> on Fri, 17 Feb 2017 14:15:10 -0500, Viktor Dukhovni <[hidden email]> said:

openssl-users>
openssl-users> > On Feb 17, 2017, at 1:51 PM, Bill Smith <[hidden email]> wrote:
openssl-users> >
openssl-users> > I pulled down 1.1.0e and tried to build it on Solaris 64.  I ran into the following error:
openssl-users> >
openssl-users> >
openssl-users> > /tools/solaris/SunStudio12.2/bin/cc -xarch=v9 -mt -o test/ct_test test/ct_test.o test/testutil.o -L. -lcrypto -lresolv -lsocket -lnsl -ldl -lpthread
openssl-users> > cc: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
openssl-users> > Undefined                 first referenced
openssl-users> > symbol                             in file
openssl-users> > fabs                                test/ct_test.o
openssl-users> > ld: fatal: Symbol referencing errors. No output written to test/ct_test
openssl-users> >
openssl-users> > These diffs appear to fix the issue.  Added -lm to ex_libs for Solaris.
openssl-users> >
openssl-users> > solaris64:117$ diff -c /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf Configurations/10-main.conf
openssl-users> > *** /scratch/bsmith/openssl/openssl-1.1.0e/Configurations/10-main.conf    Thu Feb 16 06:58:20 2017
openssl-users> > --- Configurations/10-main.conf Fri Feb 17 11:06:45 2017
openssl-users> > ***************
openssl-users> > *** 179,185 ****
openssl-users> >          inherit_from     => [ "BASE_unix" ],
openssl-users> >          template         => 1,
openssl-users> >          cflags           => "-DFILIO_H",
openssl-users> > !         ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
openssl-users> >          dso_scheme       => "dlfcn",
openssl-users> >          thread_scheme    => "pthreads",
openssl-users> >          shared_target    => "solaris-shared",
openssl-users> > --- 179,185 ----
openssl-users> >          inherit_from     => [ "BASE_unix" ],
openssl-users> >          template         => 1,
openssl-users> >          cflags           => "-DFILIO_H",
openssl-users> > !         ex_libs          => add("-lresolv -lsocket -lnsl -ldl -lm"),
openssl-users> >          dso_scheme       => "dlfcn",
openssl-users> >          thread_scheme    => "pthreads",
openssl-users> >          shared_target    => "solaris-shared",
openssl-users> > solaris64:117$
openssl-users>
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.

Cheers,
Richard

--
Richard Levitte         [hidden email]
OpenSSL Project         http://www.openssl.org/~levitte/
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris

Michael Wojcik
> From: openssl-users [mailto:[hidden email]] On Behalf
> Of Richard Levitte
> Sent: Friday, February 17, 2017 14:57
>
> In message <[hidden email]> on
> Fri, 17 Feb 2017 14:15:10 -0500, Viktor Dukhovni <openssl-
> [hidden email]> 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


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Loading...