Hi Andre,

On Mon, Aug 26, 2024 at 04:51:16PM +0200, Andre Noll wrote:
> Agreed. So I'll make a V3 which applies the following diff on top of
> the V2 version of the patch:
> 
> diff --git a/debian/changelog b/debian/changelog
> index a13d08e..d9df24a 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,9 +1,9 @@
> -liblopsub (1.0.5-1.1) UNRELEASED; urgency=medium
> +liblopsub (1.0.5-2) experimental; urgency=medium
>  
> -  * Non-maintainer upload.
> -  * Split lopsubgen into a Multi-Arch: foreign package. (Closes: #-1)
> +  * Split lopsubgen into a Multi-Arch: foreign package (Helmut Grohne).
> +    Closes: #1078823
>  
> - -- Helmut Grohne <hel...@subdivi.de>  Fri, 16 Aug 2024 19:03:09 +0200
> + -- Andre Noll <m...@tuebingen.mpg.de>  Mon, 26 Aug 2024 16:21:14 +0200
> 
> Correct?

The perfect is the enemy of the good. I think this is good enough for
uploading.

The most common way to attribute changes would likely look something
like this:

    liblopsub (1.0.5-2) experimental; urgency=medium

      [ Helmut Grohne ]
      * Split lopsubgen into a Multi-Arch: foreign package. Closes: #1078823

      [ Andre Noll ]
      * Mark liblopsub1t64 Multi-Arch: same.

     -- Andre Noll <m...@tuebingen.mpg.de>  Mon, 26 Aug 2024 16:21:14 +0200

If you attribute git commits, gbp dch would generate something like
this.

> Will do once you confirm the above.

Both ways work for me. Also keep in mind that we need two uploads
anyway.

> The only other pending change is my WIP patch to support cross building
> (i.e., the CC_FOR_BUILD thing). Would you be willing to review/sponsor
> this when it's ready?

I fear we've hit bad timing now. glibc 2.40 was uploaded to unstable and
as a result crossbuild-essential-* no longer is installable for any
architecture. In other words, all cross builds in unstable are broken
until someone uploads cross-toolchain-base. You probably can still cross
build packages in trixie.

That said, I happened to hit liblopsub myself yesterday (right before
glibc was uploaded) and started working on a patch independently. As a
result it is unfinished and very likely doesn't work. I'm attaching it
in case you enjoy working on it. Roughly speaking, it changes the
upstream Makefile to differentiated between VAR and VAR_FOR_BUILD for
e.g. CC, CFLAGS and a few more. Then the stage1 lopsubgen becomes a
build architecture executable and can be run during build. However, it
still runs the unstaged lopsubgen and that of course doesn't work. I
suppose it needs to be built twice (once for running and once for
installing). Maybe doing some kind of ifeq ($(CC),$(CC_FOR_BUILD)) build
lopsubgen once else build lopsubgen twice endif may work.

We may move ahead with the experimental upload with or without such
changes. You get to wait for NEW processing anyway before we can do an
unstable upload.

Helmut
diff --minimal -Nru liblopsub-1.0.5/debian/changelog 
liblopsub-1.0.5/debian/changelog
--- liblopsub-1.0.5/debian/changelog    2024-05-11 21:02:48.000000000 +0200
+++ liblopsub-1.0.5/debian/changelog    2024-08-26 08:14:28.000000000 +0200
@@ -1,3 +1,10 @@
+liblopsub (1.0.5-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Attempt to make liblopsub cross buildable
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 26 Aug 2024 08:14:28 +0200
+
 liblopsub (1.0.5-1) unstable; urgency=medium
 
   * prefer https:// over http:// and git://
diff --minimal -Nru liblopsub-1.0.5/debian/patches/cross.patch 
liblopsub-1.0.5/debian/patches/cross.patch
--- liblopsub-1.0.5/debian/patches/cross.patch  1970-01-01 01:00:00.000000000 
+0100
+++ liblopsub-1.0.5/debian/patches/cross.patch  2024-08-26 08:14:24.000000000 
+0200
@@ -0,0 +1,46 @@
+--- liblopsub-1.0.5.orig/Makefile
++++ liblopsub-1.0.5/Makefile
+@@ -6,6 +6,7 @@
+ ifeq ("$(origin CC)", "default")
+         CC := cc
+ endif
++CC_FOR_BUILD ?= $(CC)
+ .ONESHELL:
+ .SHELLFLAGS := -ec
+ 
+@@ -29,6 +30,8 @@
+ ZCAT := zcat
+ 
+ CC += -ffile-prefix-map=$(CURDIR)=.
++CPPFLAGS_FOR_BUILD ?= $(CPPFLAGS)
++CFLAGS_FOR_BUILD ?= $(CFLAGS)
+ 
+ dummy != $(M4) /dev/null || printf 'failed'
+ ifeq ($(dummy), failed)
+@@ -92,7 +95,7 @@
+       $(GZIP) ${@:.gz=}
+ 
+ # compiling
+-lsg1_objs := lopsubgen.o lsg1.o version.o
++lsg1_objs := lopsubgen1.o lsg1.o version1.o
+ lsg_objs := lopsubgen.o lsg.o lopsubgen.lsg.o lopsub.o version.o
+ liblopsub_objs := config_file.o lopsub.o version.o
+ lopsubex_objs := lopsubex.o lopsubex.lsg.o $(liblopsub_objs)
+@@ -105,13 +108,15 @@
+ lopsubgen.o config_file.o:
+       $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(CFLAGS) -c -o $@ ${@:.o=.c}
+ lsg1.o: lsg.c lsg.h
+-      $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -DSTAGE1 -c 
-o $@ $<
++      $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LLS_CFLAGS) $(STRICT_CFLAGS) 
$(CFLAGS_FOR_BUILD) -DSTAGE1 -c -o $@ $<
+ %.o: %.c
+       $(CC) -I. $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -c -o $@ 
$<
++%1.o: %.c
++      $(CC_FOR_BUILD) -I. $(CPPFLAGS_FOR_BUILD) $(LLS_CFLAGS) 
$(STRICT_CFLAGS) $(CFLAGS_FOR_BUILD) -c -o $@ $<
+ 
+ # linking
+ lopsubgen-stage1: $(lsg1_objs)
+-      $(CC) -Wall -g $(lsg1_objs) -o $@
++      $(CC_FOR_BUILD) -Wall -g $(lsg1_objs) -o $@
+ lopsubgen: $(lsg_objs)
+       $(CC) -Wall -g $(LDFLAGS) -o $@ $(lsg_objs)
+ $(REALNAME): $(liblopsub_objs)
diff --minimal -Nru liblopsub-1.0.5/debian/patches/series 
liblopsub-1.0.5/debian/patches/series
--- liblopsub-1.0.5/debian/patches/series       1970-01-01 01:00:00.000000000 
+0100
+++ liblopsub-1.0.5/debian/patches/series       2024-08-26 08:09:18.000000000 
+0200
@@ -0,0 +1 @@
+cross.patch
diff --minimal -Nru liblopsub-1.0.5/debian/rules liblopsub-1.0.5/debian/rules
--- liblopsub-1.0.5/debian/rules        2024-05-11 21:02:48.000000000 +0200
+++ liblopsub-1.0.5/debian/rules        2024-08-26 08:14:28.000000000 +0200
@@ -2,6 +2,8 @@
 # Invoke each target with `./debian/rules <target>'.  All targets should be
 # invoked with the package root as the current directory.
 
+include /usr/share/dpkg/buildtools.mk
+
 package := liblopsub1t64
 devpackage := liblopsub-dev
 
@@ -24,7 +26,8 @@
 
 build-arch:
        $(checkdir)
-       $(MAKE) $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all \
+       $(MAKE) CC='$(CC)' CC_FOR_BUILD='$(CC_FOR_BUILD)' \
+               $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all \
                dpkg-buildflags --export=cmdline)
 build-indep:
 build: build-indep build-arch

Reply via email to