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
    makeinstall_target() {
      make INSTALL_PREFIX=$INSTALL install_sw
      #make INSTALL_PREFIX=$SYSROOT_PREFIX install_sw
      chmod 755 $INSTALL/usr/lib/*.so*
      chmod 755 $INSTALL/usr/lib/engines/*.so
    
      cp -a $INSTALL/* $SYSROOT_PREFIX
    }

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

    This also works

  • And the winner is

    Code
    makeinstall_target() {
      make INSTALL_PREFIX=$INSTALL install_sw
      LD_LIBRARY_PATH= make INSTALL_PREFIX=$SYSROOT_PREFIX install_sw
      chmod 755 $INSTALL/usr/lib/*.so*
      chmod 755 $INSTALL/usr/lib/engines/*.so
    }

    After closer examination I noticed that LD_LIBRARY_PATH is set to

    Code
    /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
    /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
    cd /home/le/LibreELEC.tv.8.2.5/build.LibreELEC-Generic.x86_64-8.2.5
    le@here:/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
    /usr/bin/make
    le@here:/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
    Segmentation fault (core dumped)
  • 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
    LD_LIBRARY_PATH=`pwd` make
    LD_LIBRARY_PATH=`pwd` make rehash
    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

  • 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.