Skip to contentSkip to conversation

package/berkeleydb: add host variant

PATCH New Bernd Kuhls 3 participants 5 messages Jan 27, 2018 – Jul 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/berkeleydb: add host variant

Needed for the upcoming Exim version bump.

---
 package/berkeleydb/berkeleydb.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
package/berkeleydb/berkeleydb.mk +17 -0
index a315943ee6..b12ebbc209 100644
@@ -51,6 +51,22 @@ define BERKELEYDB_CONFIGURE_CMDS
 	)
 endef
 
+define HOST_BERKELEYDB_CONFIGURE_CMDS
+	(cd $(@D)/build_unix; rm -rf config.cache; \
+		$(HOST_CONFIGURE_OPTS) \
+		../dist/configure $(QUIET) \
+		--prefix=$(HOST_DIR) \
+		--with-gnu-ld \
+		--disable-cxx \
+		--disable-java \
+		--disable-tcl \
+		--disable-compat185 \
+		--with-pic \
+		--enable-o_direct \
+		--disable-mutexsupport \
+	)
+endef
+
 ifneq ($(BR2_PACKAGE_BERKELEYDB_TOOLS),y)
 
 define BERKELEYDB_REMOVE_TOOLS
@@ -68,3 +84,4 @@ endef
 BERKELEYDB_POST_INSTALL_TARGET_HOOKS += BERKELEYDB_REMOVE_DOCS
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 package/exim: bump version to 4.90

https://github.com/Exim/exim/commit/d185889f47b9b27088e777f7d382295c51271586
added new code to "Prebuild the data structure for builtin macros".

This function needs a host-built binary called macro_predef, it depends on host-berkeleydb, host-pcre and optionally on host-openssl.

Removed patch applied upstream:
https://github.com/Exim/exim/commit/98913c8ea2be5188dd22ec652da1182017e8edb7

Added license hash, switched _SITE to https.

---
 package/exim/0004-glibc.patch | 27 ---------------------------
 package/exim/exim.hash        |  3 ++-
 package/exim/exim.mk          | 16 ++++++++++++----
 3 files changed, 14 insertions(+), 32 deletions(-)
 delete mode 100644 package/exim/0004-glibc.patch
package/exim/0004-glibc.patch deleted +0 -27
deleted file mode 100644
index 7ae2ef8c70..0000000000
@@ -1,27 +0,0 @@
-uClibc does not contain gnu/libc-version.h
-
-Patch sent upstream: https://bugs.exim.org/show_bug.cgi?id=2070
-
-Signed-off-by: Bernd Kuhls <[email protected]>
-
-diff -uNr exim-4.88.org/src/exim.c exim-4.88/src/exim.c
---- exim-4.88.org/src/exim.c	2016-12-18 15:02:28.000000000 +0100
-+++ exim-4.88/src/exim.c	2016-12-26 12:12:57.000000000 +0100
-@@ -12,7 +12,7 @@
- 
- #include "exim.h"
- 
--#ifdef __GLIBC__
-+#if defined(__GLIBC__) && !defined(__UCLIBC__)
- # include <gnu/libc-version.h>
- #endif
- 
-@@ -1044,7 +1044,7 @@
-   fprintf(f, "Compiler: <unknown>\n");
- #endif
- 
--#ifdef __GLIBC__
-+#if defined(__GLIBC__) && !defined(__UCLIBC__)
-   fprintf(f, "Library version: Glibc: Compile: %d.%d\n",
- 	       	__GLIBC__, __GLIBC_MINOR__);
-   if (__GLIBC_PREREQ(2, 1))
package/exim/exim.hash +2 -1
index 41f51b15eb..3d11089f15 100644
@@ -1,2 +1,3 @@
 # Locally calculated after checking pgp signature
-sha256 1a21322a10e2da9c0bd6a2a483b6e7ef8fa7f16efcab4c450fd73e7188f5fa94  exim-4.89.1.tar.xz
+sha256 93548b529d0301629106001d73611c6098a676733f742f61ef626f1fb3f23a80  exim-4.90.tar.xz
+sha256 49240db527b7e55b312a46fc59794fde5dd006422e422257f4f057bfd27b3c8f  LICENCE
package/exim/exim.mk +12 -4
index 37eab501a4..5b692afbda 100644
@@ -4,12 +4,12 @@
 #
 ################################################################################
 
-EXIM_VERSION = 4.89.1
+EXIM_VERSION = 4.90
 EXIM_SOURCE = exim-$(EXIM_VERSION).tar.xz
-EXIM_SITE = ftp://ftp.exim.org/pub/exim/exim4
+EXIM_SITE = https://ftp.exim.org/pub/exim/exim4
 EXIM_LICENSE = GPL-2.0+
 EXIM_LICENSE_FILES = LICENCE
-EXIM_DEPENDENCIES = pcre berkeleydb host-pkgconf
+EXIM_DEPENDENCIES = host-berkeleydb host-pcre pcre berkeleydb host-pkgconf
 
 # Modify a variable value. It must already exist in the file, either
 # commented or not.
@@ -65,7 +65,7 @@ endef
 endif
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
-EXIM_DEPENDENCIES += openssl
+EXIM_DEPENDENCIES += host-openssl openssl
 define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
 	$(call exim-config-change,SUPPORT_TLS,yes)
 	$(call exim-config-change,USE_OPENSSL_PC,openssl)
@@ -120,9 +120,17 @@ ifeq ($(BR2_STATIC_LIBS),y)
 EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
 endif
 
+# We need the host version of macro_predef during the build, before
+# building it we need to prepare the makefile.
 # "The -j (parallel) flag must not be used with make"
 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
 define EXIM_BUILD_CMDS
+	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) makefile
+	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D)/build-br macro_predef \
+		CC=$(HOSTCC) \
+		LNCC=$(HOSTCC) \
+		CFLAGS="$(HOST_CFLAGS)" \
+		LFLAGS="-fPIC $(HOST_LDFLAGS)"
 	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
 endef
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 package/exim: bump version to 4.90

Hello,

package/exim/exim.mk endef · line 68

Quoted 3 lines · Bernd Kuhls

ifeq ($(BR2_PACKAGE_OPENSSL),y)

package/exim/exim.mk +1 -1
-EXIM_DEPENDENCIES += openssl
+EXIM_DEPENDENCIES += host-openssl openssl

This looks suspicious. Why are you bringing host-openssl when target OpenSSL support is enabled ? Is the OpenSSL support in the macro_predef program needed for target SSL support to work ? What does OpenSSL support in macro_predef actually brings ?

Quoted 8 lines

define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL

package/exim/exim.mk +1 -0
 	$(call exim-config-change,SUPPORT_TLS,yes)
 	$(call exim-config-change,USE_OPENSSL_PC,openssl)
@@ -120,9 +120,17 @@ ifeq ($(BR2_STATIC_LIBS),y)
 EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
 endif
 
+# We need the host version of macro_predef during the build, before

package/exim/exim.mk ifeq ($(BR2_STATIC_LIBS),y) · line 133

Quoted 10 lines
package/exim/exim.mk +7 -0
+# building it we need to prepare the makefile.
 # "The -j (parallel) flag must not be used with make"
 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
 define EXIM_BUILD_CMDS
+	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) makefile
+	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D)/build-br macro_predef \
+		CC=$(HOSTCC) \
+		LNCC=$(HOSTCC) \
+		CFLAGS="$(HOST_CFLAGS)" \
+		LFLAGS="-fPIC $(HOST_LDFLAGS)"

Meh, this is not nice. Perhaps we could submit a patch upstream that adds support for CC_FOR_BUILD, CFLAGS_FOR_BUILD, LFLAGS_FOR_BUILD, so that we don't need a separate build step. This could be useful for other projects.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 package/exim: bump version to 4.90

Hello Bernd,

Ping ? If you don't answer the review comments, we can't really move forward with merging this patch :-/

Thomas

Quoted 40 lines · Thomas Petazzoni

Hello,

package/exim/exim.mk endef · line 68

Quoted 3 lines · Bernd Kuhls

ifeq ($(BR2_PACKAGE_OPENSSL),y)

package/exim/exim.mk +1 -1
-EXIM_DEPENDENCIES += openssl
+EXIM_DEPENDENCIES += host-openssl openssl  

This looks suspicious. Why are you bringing host-openssl when target OpenSSL support is enabled ? Is the OpenSSL support in the macro_predef program needed for target SSL support to work ? What does OpenSSL support in macro_predef actually brings ?

Quoted 8 lines

define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL

package/exim/exim.mk +1 -0
 	$(call exim-config-change,SUPPORT_TLS,yes)
 	$(call exim-config-change,USE_OPENSSL_PC,openssl)
@@ -120,9 +120,17 @@ ifeq ($(BR2_STATIC_LIBS),y)
 EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
 endif
 
+# We need the host version of macro_predef during the build, before

package/exim/exim.mk ifeq ($(BR2_STATIC_LIBS),y) · line 133

Quoted 10 lines
package/exim/exim.mk +7 -0
+# building it we need to prepare the makefile.
 # "The -j (parallel) flag must not be used with make"
 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
 define EXIM_BUILD_CMDS
+	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) makefile
+	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D)/build-br macro_predef \
+		CC=$(HOSTCC) \
+		LNCC=$(HOSTCC) \
+		CFLAGS="$(HOST_CFLAGS)" \
+		LFLAGS="-fPIC $(HOST_LDFLAGS)"  

Meh, this is not nice. Perhaps we could submit a patch upstream that adds support for CC_FOR_BUILD, CFLAGS_FOR_BUILD, LFLAGS_FOR_BUILD, so that we don't need a separate build step. This could be useful for other projects.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 2/2 package/exim: bump version to 4.90

In reply to Thomas Petazzoni

Hi Thomas,

Am Mon, 29 Jan 2018 23:25:24 +0100 schrieb Thomas Petazzoni:

Quoted 4 lines

Hello,

On Sat, 27 Jan 2018 23:51:23 +0100, Bernd Kuhls wrote:

Quoted 8 lines

package/exim/exim.mk endef · line 68

Quoted 3 lines

ifeq ($(BR2_PACKAGE_OPENSSL),y)

package/exim/exim.mk +1 -1
-EXIM_DEPENDENCIES += openssl
+EXIM_DEPENDENCIES += host-openssl openssl

This looks suspicious. Why are you bringing host-openssl when target OpenSSL support is enabled ? Is the OpenSSL support in the macro_predef program needed for target SSL support to work ? What does OpenSSL support in macro_predef actually brings ?

If you try to build exim with this defconfig

BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_EXIM=y

without the buildroot package host-openssl and without a libssl-dev package installed on your host machine the exim build will fail:

/usr/bin/gcc -DMACRO_PREDEF macro_predef.c
In file included from hash.h:14,

                 from exim.h:485,
                 from macro_predef.c:11:

sha_ver.h:37:12: fatal error: openssl/ssl.h: No such file or directory

because macro_predef also has the an optional dependency on openssl:
https://github.com/Exim/exim/blob/exim-4.92%2Bfixes/src/src/
macro_predef.c#L130

Quoted 8 lines
Quoted 8 lines
package/exim/exim.mk +5 -0
+# We need the host version of macro_predef during the build, before
+# building it we need to prepare the makefile.
 # "The -j (parallel) flag must not be used with make"
 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
 define EXIM_BUILD_CMDS
+	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) makefile
+	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D)/build-br macro_predef \
+		CC=$(HOSTCC) \
Quoted 8 lines

package/exim/exim.mk ifeq ($(BR2_STATIC_LIBS),y) · line 133

Quoted 3 lines
package/exim/exim.mk +3 -0
+		LNCC=$(HOSTCC) \
+		CFLAGS="$(HOST_CFLAGS)" \
+		LFLAGS="-fPIC $(HOST_LDFLAGS)"

Meh, this is not nice. Perhaps we could submit a patch upstream that adds support for CC_FOR_BUILD, CFLAGS_FOR_BUILD, LFLAGS_FOR_BUILD, so that we don't need a separate build step. This could be useful for other projects.

Sorry, but this is beyond the scope of the time I am willing to invest in buildroot.

Sent new bump: http://patchwork.ozlabs.org/patch/1135814/

Please note that on July, 25th new security-related patches will be published as version bump to 4.92.1:
https://lists.exim.org/lurker/message/20190722.100208.85ae994c.en.html

Regards, Bernd