compiler-errorslinker-errorssolarislibressl

LibreSSL 3.0.2 compile error on Solaris 10 : undefined reference to symbol 'SHA512Final'


We are trying to compile LibreSSSL 3.0.2 on Solaris 10. We are using the GNU gcc 4.6.2 and have the following problem:

Making all in tests
make[1]: Entering directory `/users/login/e486530/openssh81/libressl-3.0.2/tests'
CCLD     handshake_table
/soft/gnu/lib/gcc/i386-pc-solaris2.10/4.6.2/../../../../i386-pc-solaris2.10/bin/ld: /users/login/e486530/openssh81/libressl-3.0.2/crypto/.libs/libcrypto.a(getentropy_solaris.o): undefined reference to symbol 'SHA512Final'
/soft/gnu/lib/gcc/i386-pc-solaris2.10/4.6.2/../../../../i386-pc-solaris2.10/bin/ld: note: 'SHA512Final' is defined in DSO /lib/libmd.so.1 so try adding it to the linker command line
/lib/libmd.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

The error is "undefined reference to symbol 'SHA512Final"

The proposition made is 'SHA512Final' is defined in DSO /lib/libmd.so.1 so try adding it to the linker command line. But just after we have the error "/lib/libmd.so.1: could not read symbols: Invalid operation" so apparently the compiler is trying already to read symbols from this library without succèss.

Any idea to compile LibreSSL on Solaris with succes?


I add some details ...

The compilation is made on Solaris 10 for i386 with the GNU gcc compiler 4.6.2. I don't 'set the bits for compilation.

The GNU gcc shows the following information with the option -v

$ gcc -v
Using built-in specs.
COLLECT_GCC=/soft/gnu/bin/gcc
COLLECT_LTO_WRAPPER=/soft/gnu/libexec/gcc/i386-pc-solaris2.10/4.6.2/lto-wrapper
Target: i386-pc-solaris2.10
Configured with: ../gcc-4.6.2/configure --prefix=/soft/gnu --with-gnu-ld --with-gnu-as --with-gmp=/soft/gnu --with-mpc=/soft/gnu --with-mpfr=/soft/gnu
Thread model: posix
gcc version 4.6.2 (GCC)

And the uname -a option shows:

$ uname -a
SunOS yvas0pd0 5.10 Generic_150401-30 i86pc i386 i86pc

I have just recompiled with the flags:

CC="gcc -m64"
CXX="g++ -m64"

And the error is now

/soft/gnu/lib/gcc/i386-pc-solaris2.10/4.6.2/../../../../i386-pc-solaris2.10/bin/ld: /users/login/e486530/openssh81/libressl-3.0.2/crypto/.libs/libcrypto.a(getentropy_solaris.o): undefined reference to symbol 'SHA512Final'
/soft/gnu/lib/gcc/i386-pc-solaris2.10/4.6.2/../../../../i386-pc-solaris2.10/bin/ld: note: 'SHA512Final' is defined in DSO /lib/amd64/libmd.so.1 so try adding it to the linker command line
/lib/amd64/libmd.so.1: could not read symbols: Invalid operation

So the library used now is a 64 bit library but the problem remains ... :-|

Hope it helps. For the moment we are going to use OpenSSL 1.1.1, which compiles succesfully.

Regards


Solution

  • The error shown in the compilation

    'SHA512Final' is defined in DSO /lib/amd64/libmd.so.1 so try adding it to the linker command line
    /lib/amd64/libmd.so.1: could not read symbols: Invalid operation
    

    Means really that the file /lib/amd64/libmd.so.1 is not being used by the linker. I have misunderstood the real meaning.

    So, adding -lmd to the LDFLAGS variable makes the compilation finish

    For information, the full content for the LDFLAGS variable used in my compilation is the following:

    export LDFLAGS="-Wl,-disable-new-dtags,-rpath=/opt/openssh-8.1/lib,-lmd"