Bug#923023: original-awk FTCBFS: builds for the wrong architecture

2022-12-22 Thread Santiago Vila

El 22/12/22 a las 9:20, Helmut Grohne escribió:

I don't think having me test your branches is an efficient process. Can
I propose the following alternatives?

  * If you are using sbuild, add --host=somearch.
  * If you are using pbuilder, add --host-arch somearch.
  * If you are using salsa, enable salsa-ci and check the cross build.
  * If you use none of the above, upload and check
https://crossqa.debian.net/src/original-awk.
  * If you feel that all of this is too much work, close my FTCBFS bug
with a note "upstream build system significantly changed, patch no
longer applicable". I'll send a new patch eventually.


Ok, seems fair to me.

I tried sbuild --host=i386 and sbuild took care of everything, and
this time lintian did not complain about weird ELF binary.

I did not really know it was so easy to check. Now I do :-)

Thanks a lot.



Bug#923023: original-awk FTCBFS: builds for the wrong architecture

2022-12-22 Thread Helmut Grohne
Hi Santiago,

On Thu, Dec 22, 2022 at 12:10:57AM +0100, Santiago Vila wrote:
> The upstream makefile now has a CC and a HOSTCC for cross-builds.
> So I guess now we just need to pass CC as CC and CC_FOR_BUILD as HOSTCC.

Thank you for caring about cross builds.

> Can you try this and tell me if it works?
> 
> git clone g...@salsa.debian.org:sanvila/original-awk.git

I don't think having me test your branches is an efficient process. Can
I propose the following alternatives?

 * If you are using sbuild, add --host=somearch.
 * If you are using pbuilder, add --host-arch somearch.
 * If you are using salsa, enable salsa-ci and check the cross build.
 * If you use none of the above, upload and check
   https://crossqa.debian.net/src/original-awk.
 * If you feel that all of this is too much work, close my FTCBFS bug
   with a note "upstream build system significantly changed, patch no
   longer applicable". I'll send a new patch eventually.

This applies to all kinds of FTCBFS bugs filed by me.

Helmut



Bug#923023: original-awk FTCBFS: builds for the wrong architecture

2022-12-21 Thread Santiago Vila

El 23/2/19 a las 7:29, Helmut Grohne escribió:

Source: original-awk
Version: 2012-12-20-6
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

original-awk fails to cross build from source, because the packaging
forces the build architecture compiler "gcc". Using a triplet-prefixed
compiler fixes that, but makes executing maketab fail. [...]


Hi.

The upstream makefile now has a CC and a HOSTCC for cross-builds.
So I guess now we just need to pass CC as CC and CC_FOR_BUILD as HOSTCC.

Can you try this and tell me if it works?

git clone g...@salsa.debian.org:sanvila/original-awk.git

(I've set the default branch to be a pre-release for 2022-01-22-1)

Thanks.



Bug#923023: original-awk FTCBFS: builds for the wrong architecture

2019-02-22 Thread Helmut Grohne
Source: original-awk
Version: 2012-12-20-6
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

original-awk fails to cross build from source, because the packaging
forces the build architecture compiler "gcc". Using a triplet-prefixed
compiler fixes that, but makes executing maketab fail. For building
maketabe the build architecture compiler was the right thing. So we also
need to extend the build system to differentiate between these
compilers. The attached patch implements that and makes original-awk
cross buildable. Please consider applying it.

Helmut
diff --minimal -Nru original-awk-2012-12-20/debian/changelog 
original-awk-2012-12-20/debian/changelog
--- original-awk-2012-12-20/debian/changelog2017-01-08 18:47:44.0 
+0100
+++ original-awk-2012-12-20/debian/changelog2017-08-05 22:00:10.0 
+0200
@@ -1,3 +1,12 @@
+original-awk (2012-12-20-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Closes: #-1.
++ Let dpkg's buildtools.mk supply CC and CC_FOR_BUILD.
++ cross.patch: Use CC_FOR_BUILD for maketab.
+
+ -- Helmut Grohne   Sat, 05 Aug 2017 22:00:10 +0200
+
 original-awk (2012-12-20-6) unstable; urgency=medium
 
   * Rename all patches to end with .patch.
diff --minimal -Nru original-awk-2012-12-20/debian/patches/cross.patch 
original-awk-2012-12-20/debian/patches/cross.patch
--- original-awk-2012-12-20/debian/patches/cross.patch  1970-01-01 
01:00:00.0 +0100
+++ original-awk-2012-12-20/debian/patches/cross.patch  2017-08-05 
22:00:10.0 +0200
@@ -0,0 +1,19 @@
+--- original-awk-2012-12-20.orig/makefile
 original-awk-2012-12-20/makefile
+@@ -30,6 +30,7 @@
+ CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
+ CC = gcc -g -Wall -pedantic 
+ CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing
++CC_FOR_BUILD ?= $(CC)
+ 
+ YACC = bison -d -y
+ YACC = yacc -d -S
+@@ -62,7 +63,7 @@
+   ./maketab >proctab.c
+ 
+ maketab:  ytab.h maketab.c
+-  $(CC) $(CFLAGS) maketab.c -o maketab
++  $(CC_FOR_BUILD) $(CFLAGS) maketab.c -o maketab
+ 
+ bundle:
+   @cp ytab.h ytabh.bak
diff --minimal -Nru original-awk-2012-12-20/debian/patches/series 
original-awk-2012-12-20/debian/patches/series
--- original-awk-2012-12-20/debian/patches/series   2017-01-08 
17:00:00.0 +0100
+++ original-awk-2012-12-20/debian/patches/series   2017-08-05 
22:00:10.0 +0200
@@ -1,3 +1,4 @@
 01-awk-is-called-original-awk-here.patch
 02-remove-generated-files-in-clean-target.patch
 03-cflags-and-cppflags-together.patch
+cross.patch
diff --minimal -Nru original-awk-2012-12-20/debian/rules 
original-awk-2012-12-20/debian/rules
--- original-awk-2012-12-20/debian/rules2017-01-08 17:00:00.0 
+0100
+++ original-awk-2012-12-20/debian/rules2017-08-05 22:00:10.0 
+0200
@@ -1,4 +1,8 @@
 #!/usr/bin/make -f
+
+-include /usr/share/dpkg/buildtools.mk
+CC_FOR_BUILD ?= cc
+
 %:
dh $@
 
@@ -6,13 +10,12 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-CC = gcc
 CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall
 LDFLAGS := `dpkg-buildflags --get LDFLAGS`
 CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
 
 override_dh_auto_build:
-   dh_auto_build -- CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" 
ALLOC="$(LDFLAGS)" YACC="bison -d -y"
+   dh_auto_build -- CC="$(CC)" CC_FOR_BUILD="$(CC_FOR_BUILD)" 
CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" ALLOC="$(LDFLAGS)" YACC="bison -d -y"
 
 override_dh_auto_install:
install -m 755 a.out debian/$(package)/usr/bin/$(package)