Source: libowfat
Version: 0.32-4
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

libowfat fails to cross build from source, because it builds for the
build architecture. To cross build libowfat one is supposed to supply
either CCC or CROSS. Beyond that, it fails to use CCC for the linker
step. I'm attaching a patch for your convenience.

Helmut
diff --minimal -Nru libowfat-0.32/debian/changelog 
libowfat-0.32/debian/changelog
--- libowfat-0.32/debian/changelog      2022-11-10 16:32:49.000000000 +0100
+++ libowfat-0.32/debian/changelog      2023-04-06 09:31:10.000000000 +0200
@@ -1,3 +1,11 @@
+libowfat (0.32-5) UNRELEASED; urgency=medium
+
+  * Fix FTCBFS: (Closes: #-1)
+    + Pass CCC to make.
+    + cross.patch: Use CCC for linking as well.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 06 Apr 2023 09:31:10 +0200
+
 libowfat (0.32-4) unstable; urgency=high
 
   * QA upload
diff --minimal -Nru libowfat-0.32/debian/patches/cross.patch 
libowfat-0.32/debian/patches/cross.patch
--- libowfat-0.32/debian/patches/cross.patch    1970-01-01 01:00:00.000000000 
+0100
+++ libowfat-0.32/debian/patches/cross.patch    2023-04-06 09:31:10.000000000 
+0200
@@ -0,0 +1,9 @@
+--- libowfat-0.32.orig/GNUmakefile
++++ libowfat-0.32/GNUmakefile
+@@ -394,5 +394,5 @@
+       ln -sf $< $@
+ 
+ libowfat.so.0: $(ALL_OBJS)
+-      $(CC) -shared -Wl,-soname=$@ $(LDFLAGS) $^ -o $@
++      $(CCC) -shared -Wl,-soname=$@ $(LDFLAGS) $^ -o $@
+ 
diff --minimal -Nru libowfat-0.32/debian/patches/series 
libowfat-0.32/debian/patches/series
--- libowfat-0.32/debian/patches/series 2022-11-10 16:31:16.000000000 +0100
+++ libowfat-0.32/debian/patches/series 2023-04-06 09:31:10.000000000 +0200
@@ -6,3 +6,4 @@
 07-fix-FD_CLOEXEC.patch
 08-clang-ftbfs.diff
 fix_gcc10.patch
+cross.patch
diff --minimal -Nru libowfat-0.32/debian/rules libowfat-0.32/debian/rules
--- libowfat-0.32/debian/rules  2022-11-10 16:31:16.000000000 +0100
+++ libowfat-0.32/debian/rules  2023-04-06 09:31:10.000000000 +0200
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/buildtools.mk
+
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) -I.
 CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
@@ -9,9 +11,9 @@
        dh $@
 
 override_dh_auto_build:
-       $(MAKE) -f $(CURDIR)/GNUmakefile CFLAGS="$(CFLAGS) -fPIC" DIET='' 
libowfat.so
+       $(MAKE) -f $(CURDIR)/GNUmakefile CCC=$(CC) CFLAGS="$(CFLAGS) -fPIC" 
DIET='' libowfat.so
        $(MAKE) -f $(CURDIR)/GNUmakefile clean
-       $(MAKE) -f $(CURDIR)/GNUmakefile CFLAGS="$(CFLAGS)" DIET=''
+       $(MAKE) -f $(CURDIR)/GNUmakefile CCC=$(CC) CFLAGS="$(CFLAGS)" DIET=''
        rm entities.h
 
 override_dh_installchangelogs:

Reply via email to