[LEDE-DEV] OpenSSL: question about package Makefile

Nino Benedetto neoben.86 at gmail.com
Thu Mar 30 02:29:46 PDT 2017


I made some other tests to be sure that removing the make build-shared
and make do_linux-shared commands would'n break the compiled shared
objects.
I checked the md5 for the files compiled with the default package
Makefile and the with the simplified one obtaining the same result:

#### Default Makefile

b4bc475b8d41254e5f6ed4f6d608e2fe  libssl.so.1.0.0
b4bc475b8d41254e5f6ed4f6d608e2fe  ipkg-install/usr/lib/libssl.so.1.0.0
33ff8cdc39977c89f34af9e878180b5c  ipkg-ar71xx/libopenssl/usr/lib/libssl.so.1.0.0

8502cc3c1435ef67a361ca60a1340693  libcrypto.so.1.0.0
8502cc3c1435ef67a361ca60a1340693  ipkg-install/usr/lib/libcrypto.so.1.0.0
f531494071d90d96d92c11a12acd3102
ipkg-ar71xx/libopenssl/usr/lib/libcrypto.so.1.0.0

### Makefile without build-shared and make do_shared-linux

b4bc475b8d41254e5f6ed4f6d608e2fe  libssl.so.1.0.0
b4bc475b8d41254e5f6ed4f6d608e2fe  ipkg-install/usr/lib/libssl.so.1.0.0
33ff8cdc39977c89f34af9e878180b5c  ipkg-ar71xx/libopenssl/usr/lib/libssl.so.1.0.0

8502cc3c1435ef67a361ca60a1340693  libcrypto.so.1.0.0
8502cc3c1435ef67a361ca60a1340693  ipkg-install/usr/lib/libcrypto.so.1.0.0
f531494071d90d96d92c11a12acd3102
ipkg-ar71xx/libopenssl/usr/lib/libcrypto.so.1.0.0

I saw that the compilation workaround was introduced in 2005 with the
following commit:
https://github.com/openwrt/openwrt/commit/999987ddc3bbe7541e6e711c4fb9a4277f83379a

Please, let me know if you have any other suggestion.
Thanks!

Carmine Benedetto


On Wed, Mar 29, 2017 at 5:14 PM, Nino Benedetto <neoben.86 at gmail.com> wrote:
> Hi all,
> I was looking at the openssl package Makefile and I have a question about that.
> The Build/Compile target is formatted in the following way:
>
> define Build/Compile
> +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
> AR="$(TARGET_CROSS)ar r" \
> RANLIB="$(TARGET_CROSS)ranlib" \
> OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
> $(OPENSSL_MAKEFLAGS) \
> all
> +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
> AR="$(TARGET_CROSS)ar r" \
> RANLIB="$(TARGET_CROSS)ranlib" \
> OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
> $(OPENSSL_MAKEFLAGS) \
> build-shared
> # Work around openssl build bug to link libssl.so with libcrypto.so.
> -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
> +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
> $(OPENSSL_MAKEFLAGS) \
> do_linux-shared
> $(MAKE) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
> $(OPENSSL_MAKEFLAGS) \
> install
> endef
>
> I'm not totally understanding why we need to perform make build-shared
> and make do_linux-shared for openssl source code >= than 1.0.1.
> If I remove the compile the package without the workarounds, the
> library seems to work fine and the shared objects seem to be correct.
>
> define Build/Compile
> +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
> AR="$(TARGET_CROSS)ar r" \
> RANLIB="$(TARGET_CROSS)ranlib" \
> OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
> $(OPENSSL_MAKEFLAGS) \
> all
> $(MAKE) -C $(PKG_BUILD_DIR) \
> CC="$(TARGET_CC)" \
> INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
> $(OPENSSL_MAKEFLAGS) \
> install
> endef
>
> I noticed that this section of the package Makefile didn't change
> since 2012 (or maybe before) so I suppose was related to an old
> openssl source code.
> Is it safe to compile the package using the Compile section I proposed?
> Thanks!
>
> Carmine Benedetto
>
> --
> Website: www.carminebenedetto.net
> Skype: neoben86
>
> Keep an open mind, but not so open that your brain falls out. [Richard Feynmann]



-- 
Website: www.carminebenedetto.net
Skype: neoben86

Keep an open mind, but not so open that your brain falls out. [Richard Feynmann]



More information about the Lede-dev mailing list