Skip to contentSkip to conversation

ed: add host package

PATCH New Vicente Olivert Riera 3 participants 5 messages May 12, 2017 – Jul 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ed: add host package

This will be necessary for updating bc's version in a subsequent patch.

---
 package/ed/ed.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
package/ed/ed.mk +17 -0
index ada0316..7f69480 100644
@@ -21,12 +21,29 @@ define ED_CONFIGURE_CMDS
 	)
 endef
 
+define HOST_ED_CONFIGURE_CMDS
+	(cd $(@D); \
+		$(HOST_MAKE_ENV) ./configure \
+		--prefix=/usr \
+		$(HOST_CONFIGURE_OPTS) \
+	)
+endef
+
 define ED_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
+define HOST_ED_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
 define ED_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
 endef
 
+define HOST_ED_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(HOST_DIR)" install
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/3 bc: add host package

This will be necessary for updating bc's version in a subsequent patch.

---
 package/bc/bc.mk | 1 +
 1 file changed, 1 insertion(+)
package/bc/bc.mk +1 -0
index a6446ce..4596192 100644
@@ -17,3 +17,4 @@ BC_DEPENDENCIES += busybox
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.10.2
#2 lore raw

PATCH 3/3 bc: bump version to 1.07.1

In reply to Vicente Olivert Riera

- Remove 01 and 02 patches as they are not needed anymore.
- Tweak 03 patch for the new version and rename it to 0001.
- host-flex dependency is not needed anymore.
- Added host-bc dependency: needed to bootstrap libmath.h at build time.
- Added host-ed dependency: used by fix-libmath_h script at build time.
- Swith site to GNU mirror.

---
 ...fo.patch => 0001-use_appropiate_makeinfo.patch} |  13 +-
 package/bc/01_array_initialize.patch               |  20 -
 package/bc/02_notice_read_write_errors.patch       | 708 ---------------------
 package/bc/bc.hash                                 |   2 +-
 package/bc/bc.mk                                   |  25 +-
 5 files changed, 30 insertions(+), 738 deletions(-)
 rename package/bc/{03_use_appropiate_makeinfo.patch => 0001-use_appropiate_makeinfo.patch} (53%)
 delete mode 100644 package/bc/01_array_initialize.patch
 delete mode 100644 package/bc/02_notice_read_write_errors.patch
package/bc/0001-use_appropiate_makeinfo.patch renamed from package/bc/03_use_appropiate_makeinfo.patch +8 -5
similarity index 53%
rename from package/bc/03_use_appropiate_makeinfo.patch
rename to package/bc/0001-use_appropiate_makeinfo.patch
index e6f9262..f6d89a3 100644
@@ -1,17 +1,20 @@
 Use the appropiate MAKEINFO variable rather than the hardcoded makeinfo
 command directly, otherwise missing logic never works.
 
+[Vincent: tweak the patch for 1.07.1]
+
 Signed-off-by: Gustavo Zacarias <[email protected]>
+Signed-off-by: Vicente Olivert Riera <[email protected]>
 
-diff -Nura bc-1.06.95.orig/doc/Makefile.in bc-1.06.95/doc/Makefile.in
---- bc-1.06.95.orig/doc/Makefile.in	2015-06-13 09:39:46.946620294 -0300
-+++ bc-1.06.95/doc/Makefile.in	2015-06-13 09:40:10.019407630 -0300
-@@ -96,7 +96,7 @@
+diff -Nura a/doc/Makefile.in b/doc/Makefile.in
+--- a/doc/Makefile.in	2017-04-07 23:20:02.000000000 +0100
++++ b/doc/Makefile.in	2017-05-10 17:29:19.126687266 +0100
+@@ -214,7 +214,7 @@
  LIBOBJS = @LIBOBJS@
  LIBS = @LIBS@
  LTLIBOBJS = @LTLIBOBJS@
 -MAKEINFO = makeinfo --no-split
 +MAKEINFO = @MAKEINFO@ --no-split
+ MKDIR_P = @MKDIR_P@
  OBJEXT = @OBJEXT@
  PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
package/bc/01_array_initialize.patch deleted +0 -20
deleted file mode 100644
index 9520d82..0000000
@@ -1,20 +0,0 @@
-Description: Fix array initialization bug
-Author: Phil Nelson
-Origin: upstream
-Bug-Debian: http://bugs.debian.org/586969
-Bug-Debian: http://bugs.debian.org/671513
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: bc/bc/storage.c
-===================================================================
---- bc.orig/bc/storage.c	2013-06-02 20:34:09.401273864 -0400
-+++ bc/bc/storage.c	2013-06-02 20:34:11.000000000 -0400
-@@ -179,7 +179,7 @@
- 
- 
-   /* Initialize the new elements. */
--  for (; indx < v_count; indx++)
-+  for (; indx < a_count; indx++)
-     arrays[indx] = NULL;
- 
-   /* Free the old elements. */
package/bc/02_notice_read_write_errors.patch deleted +0 -708

708 lines not on this page · raw message

package/bc/bc.hash +1 -1
index 5f1ed63..61beb49 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256 7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc  bc-1.06.95.tar.bz2
+sha256 62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a  bc-1.07.1.tar.gz
package/bc/bc.mk +21 -4
index 4596192..b5853b1 100644
@@ -4,17 +4,34 @@
 #
 ################################################################################
 
-BC_VERSION = 1.06.95
-BC_SOURCE = bc-$(BC_VERSION).tar.bz2
-BC_SITE = http://alpha.gnu.org/gnu/bc
-BC_DEPENDENCIES = host-flex
+BC_VERSION = 1.07.1
+BC_SITE = $(BR2_GNU_MIRROR)/bc
+# host-bc needed to bootstrap libmath.h at build time
+# host-ed needed by the fix-libmath_h script at build time
+BC_DEPENDENCIES = host-bc host-ed
 BC_LICENSE = GPL-2.0+, LGPL-2.1+
 BC_LICENSE_FILES = COPYING COPYING.LIB
+# host-ed needed by the fix-libmath_h script@build time
+HOST_BC_DEPENDENCIES = host-ed
 
 # Build after busybox so target ends up with bc's "dc" version
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 BC_DEPENDENCIES += busybox
 endif
 
+# A stripped-down version of bc (fbc) is built for bootstrapping purposes. Then
+# the bc build system tries to run it in order to generate some header files,
+# but that breaks cross-compilation because we cannot run in the host machine an
+# fbc that has been built for the target architecture. We tweak the Makefiles in
+# order to run the bc that was built for the host. As long as the host bc and
+# the target one have the same version the result should be fine. And also, note
+# we don't need to run the host fbc (which doesn't exist by the way, because
+# it was deleted after its use by the host-bc Makefile) and we can just run the
+# full bc program (remember the fbc was just a tripped-down version of bc).
+define BC_USE_HOST_FBC
+	$(SED) "s:\./fbc -c:$(HOST_DIR)/usr/bin/bc -c:" $(@D)/bc/Makefile.in
+endef
+BC_POST_PATCH_HOOKS += BC_USE_HOST_FBC
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.10.2
#3 lore raw

PATCH 3/3 bc: bump version to 1.07.1

Hi Vincente,

Le 12/05/2017 ? 16:28, Vicente Olivert Riera a ?crit :

Quoted 1 line

- Remove 01 and 02 patches as they are not needed anymore.

Patch 01 is upstream but not patch 02.
Why it's not needed anymore ?
Maybe add a previous patch to remove it before bumping bc ?

Quoted 4 lines

- Tweak 03 patch for the new version and rename it to 0001.
- host-flex dependency is not needed anymore.
- Added host-bc dependency: needed to bootstrap libmath.h at build time.
- Added host-ed dependency: used by fix-libmath_h script at build time.

bc is in Buildroot mandatory dependency, so why not using bc from the host ? Have you tried that ?
With that you can remove the dependency on host-ed and host-bc.

Quoted 14 lines

- Swith site to GNU mirror.

---
 ...fo.patch => 0001-use_appropiate_makeinfo.patch} |  13 +-
 package/bc/01_array_initialize.patch               |  20 -
 package/bc/02_notice_read_write_errors.patch       | 708 ---------------------
 package/bc/bc.hash                                 |   2 +-
 package/bc/bc.mk                                   |  25 +-
 5 files changed, 30 insertions(+), 738 deletions(-)
 rename package/bc/{03_use_appropiate_makeinfo.patch => 0001-use_appropiate_makeinfo.patch} (53%)
 delete mode 100644 package/bc/01_array_initialize.patch
 delete mode 100644 package/bc/02_notice_read_write_errors.patch

[...]

Quoted 23 lines
package/bc/bc.mk +7 -4
index 4596192..b5853b1 100644
@@ -4,17 +4,34 @@
 #
 ################################################################################
 
-BC_VERSION = 1.06.95
-BC_SOURCE = bc-$(BC_VERSION).tar.bz2
-BC_SITE = http://alpha.gnu.org/gnu/bc
-BC_DEPENDENCIES = host-flex
+BC_VERSION = 1.07.1
+BC_SITE = $(BR2_GNU_MIRROR)/bc
+# host-bc needed to bootstrap libmath.h at build time
+# host-ed needed by the fix-libmath_h script at build time
+BC_DEPENDENCIES = host-bc host-ed
 BC_LICENSE = GPL-2.0+, LGPL-2.1+
 BC_LICENSE_FILES = COPYING COPYING.LIB
+# host-ed needed by the fix-libmath_h script at build time
+HOST_BC_DEPENDENCIES = host-ed
 
 # Build after busybox so target ends up with bc's "dc" version

package/bc/bc.mk line 27

Quoted 10 lines
package/bc/bc.mk +6 -0
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 BC_DEPENDENCIES += busybox
 endif
 
+# A stripped-down version of bc (fbc) is built for bootstrapping purposes. Then
+# the bc build system tries to run it in order to generate some header files,
+# but that breaks cross-compilation because we cannot run in the host machine an
+# fbc that has been built for the target architecture. We tweak the Makefiles in
+# order to run the bc that was built for the host. As long as the host bc and
+# the target one have the same version the result should be fine.

Is there any output format changes between bc version ?

Best regards,
Romain

And also, note

Quoted 11 lines
package/bc/bc.mk +8 -0
+# we don't need to run the host fbc (which doesn't exist by the way, because
+# it was deleted after its use by the host-bc Makefile) and we can just run the
+# full bc program (remember the fbc was just a tripped-down version of bc).
+define BC_USE_HOST_FBC
+	$(SED) "s:\./fbc -c:$(HOST_DIR)/usr/bin/bc -c:" $(@D)/bc/Makefile.in
+endef
+BC_POST_PATCH_HOOKS += BC_USE_HOST_FBC
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
#4 lore raw

PATCH 1/3 ed: add host package

In reply to Vicente Olivert Riera

Hello,

Quoted 6 lines · Vicente Olivert Riera

This will be necessary for updating bc's version in a subsequent patch.

---
 package/ed/ed.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

I had a look at all of this, and my feeling is the same as the OpenEmbedded folks: this really sucks. Why on earth do they need "ed"? Why don't they fix their build system to build fbc for the host?

See https://patchwork.openembedded.org/patch/140001/ for the feedback from OpenEmbedded people. I really don't think there's a compelling reason to upgrade to 1.07.1 for now, so let's keep 1.06 and avoid this mess.

I've mailed the submitter of the OE patch, who said he would contact the upstream GNU bc maintainer, in order to see if he got some feedback. You are in Cc of this e-mail.

In addition, there was an issue in your patch: GNU bc has moved to GNU GPLv3+ since this 1.07.1 release, so the licensing details should be fixed as well.

Best regards,

Thomas

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