Openssl compilation issue

  • Hello,


    I have the exact same problem as posted in this thread that was never resolved: Openssl compilation issue for 8.2.5 / 9


    I am trying to compile 8.2.5 on Ubuntu 16.04.6 on 64-bit machine. Original poster did not really explain how he solved the issue and nobody is replying to the post any more. There must have been many people with exact same issue if it occurs for 8.2.5 compilation on the recommended Ubuntu build machine.


    Can anyone please help me get over this issue?

  • Try to use this makeinstall_target() function in packages/security/openssl/package.mk

    Code
    1. makeinstall_target() {
    2. make INSTALL_PREFIX=$INSTALL install_sw
    3. #make INSTALL_PREFIX=$SYSROOT_PREFIX install_sw
    4. chmod 755 $INSTALL/usr/lib/*.so*
    5. chmod 755 $INSTALL/usr/lib/engines/*.so
    6. cp -a $INSTALL/* $SYSROOT_PREFIX
    7. }

    Didn't check why make crashes when installing to SYSROOT.


    This also works

    Gone...

  • And the winner is

    Code
    1. makeinstall_target() {
    2. make INSTALL_PREFIX=$INSTALL install_sw
    3. LD_LIBRARY_PATH= make INSTALL_PREFIX=$SYSROOT_PREFIX install_sw
    4. chmod 755 $INSTALL/usr/lib/*.so*
    5. chmod 755 $INSTALL/usr/lib/engines/*.so
    6. }

    After closer examination I noticed that LD_LIBRARY_PATH is set to

    Code
    1. /home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5/toolchain/lib:

    and (seems) it means current folder is also set because nothing exists after ":" separator. And make and every other command fails in the folder where libraries are stored

    Code
    1. /home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib


    Code
    1. cd /home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5
    2. [email protected]:/home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib$ LD_LIBRARY_PATH="/dummy" which make
    3. /usr/bin/make
    4. [email protected]:/home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib$ LD_LIBRARY_PATH="/dummy:" which make
    5. Segmentation fault (core dumped)

    Gone...

  • Thank you vpeter. That worked. I am surprised this was not caught earlier.


    Hopefully rest of the build goes ok.

  • I assume some change come with host system updates. Because 8.2.5 was build without a problem when it was current.

    Yes, but misusing LD_LIBRARY_PATH in openssl 1.0.* makefiles is the error.


    Looking at the official openssl.spec you see they are aware of the issue:

    Code: openssl.spec
    1. LD_LIBRARY_PATH=`pwd` make
    2. LD_LIBRARY_PATH=`pwd` make rehash
    3. LD_LIBRARY_PATH=`pwd` make test

    BTW: I don't understand why your fix is working, IMO LD_LIBRARY_PATH must not be empty.


    Starting with openssl 1.1.0 the bug is fixed so LibreELEC master is safe.


    But LE 9.0* is still using openssl 1.0.2X and the failure can pop up any time without LD_LIBRARY_PATH work around.

  • My fix is working because LD_LIBRARY_PATH is set with LE environment libreelec-8.0/config/path · GitHub

    Because host doesn't set it (it is empty) you will get the path with colon at the end. And this means "use current folder". I assume this change started to be problematic sometime with Ubuntu updates (didn't investigate where, why/...)

    LE 9 unsets this path that's why there is no this issue and will not pop up any time libreelec-9.0/config/path - GitHub

    Gone...

  • Thanks. So it can theoretical generate errors anywhere when building 8.2.5.


    I first thoughed it's only an openssl issue because of creating the wrong LD_LIBRARY_PATH while compiling, i.e. makefile.shared#l98

  • I build LE Generic 8.2.5 and it was made after this openssl fix. Maybe some other package could have similar issue.


    I think path in Makefile.shared is not yet used when issue happen.

    Gone...