Re: [openssl-users] undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris
> From: markus.sondereg...@juliusbaer.com > [mailto:markus.sondereg...@juliusbaer.com] > Sent: Tuesday, March 07, 2017 10:49 > To: Michael Wojcik > Subject: Re: undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on > solaris For threads that originated on openssl-users, please send messages to the list, rather than to me directly. > > >> For the record, we've always just changed the Solaris configuration we use >> in Configure to add -lm. > > I am not an experienced C developer so please can you tell me where in the > Configure file I have to add -lm. This has nothing to do with C development. The OpenSSL Configure process, while conceptually related to that used by some other packages, is an OpenSSL invention. And the use of -lm is an artifact of the toolchain (common to many toolchains for UNIX-like systems); it too has nothing to do with the C language. Also, I've just looked at our Configure and apparently I misremembered; we do not add -lm for the Solaris builds. (We make a number of other changes for that platform, though.) It seems it's not needed for the version of OpenSSL we're currently building. Where you would add -lm depends on what configuration you're using, which in turn depends on which system architecture and toolchain you're using. It also may depend on what version of OpenSSL you're building. I don't have that information, obviously. In OpensSSL 1.0.2j's Configure (and generally for all the 1.0.2 releases, I believe), all the Solaris configure entries have -ldl in their library list. So you can search Configure for "solaris (with the double-quote) at the beginning of a line, then add -lm (with a space) after -ldl on each such line. For example, in vi: :%s/^"solaris.* -ldl/& -lm Whether this also applies to OpenSSL 1.1.0 or whatever you're building, I can't say. Michael Wojcik Distinguished Engineer, Micro Focus -- openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Re: [openssl-users] undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris
> From: openssl-users [mailto:openssl-users-boun...@openssl.org] On Behalf > Of Richard Levitte > Sent: Friday, February 17, 2017 14:57 > > In message <1481bc8a-3e0c-4598-9556-0a83f78ac...@dukhovni.org> on > Fri, 17 Feb 2017 14:15:10 -0500, Viktor Dukhovni us...@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 -- openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Re: [openssl-users] undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris
> On Feb 17, 2017, at 1:51 PM, Bill Smithwrote: > > 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 > fabstest/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.confThu > 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
[openssl-users] undefined symbol fabs in file test/ct_test.o in openssl 1.1.0e on solaris
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 fabstest/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.confThu 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