Package: ck
Version: 0.7.1-6
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu jammy ubuntu-patch

Hi Daniel,

In Ubuntu, ck fails to build on armhf because the upstream build system is
passing an explicit -march option that is no longer correct because it does
not include floating-point support which is implicit in armhf:

[...]
/usr/bin/cc -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 
-pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align 
-Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe 
-Wno-parentheses -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
-fstack-protector-strong -Wformat -Werror=format-security -march=armv7-a -fPIC 
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall 
-W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual 
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
-Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses 
-g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -march=armv7-a -fPIC -I/<<PKGBUILDDIR>>/include 
-I/<<PKGBUILDDIR>>/include -D__arm__ -c -o 
/<<PKGBUILDDIR>>/src/ck_barrier_tournament.o 
/<<PKGBUILDDIR>>/src/ck_barrier_tournament.c
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
[...]

  (https://launchpad.net/ubuntu/+source/ck/0.7.1-6/+build/22357550)

I have not verified whether this build failure exists with the current
toolchain in Debian, therefore I am not marking this as a serious bug;
however, I expect that if this toolchain change has not yet happened in
Debian, it will happen soon.

I have applied the attached patch in Ubuntu to let ck build by choosing an
appropriate cpu target of -march=armv7-a+fp.  Please consider applying it in
Debian as well.  Alternatively, upstream could just not override the -march
at all and trust the compiler defaults.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru ck-0.7.1/debian/rules ck-0.7.1/debian/rules
--- ck-0.7.1/debian/rules       2021-10-30 17:45:35.000000000 -0700
+++ ck-0.7.1/debian/rules       2022-04-12 23:30:57.000000000 -0700
@@ -2,6 +2,11 @@
 
 include /usr/share/dpkg/architecture.mk
 
+ifeq ($(DEB_HOST_ARCH),armhf)
+    DEB_CFLAGS_MAINT_APPEND = -march=armv7-a+fp
+endif
+export DEB_CFLAGS_MAINT_APPEND
+
 ifneq (,$(filter $(DEB_HOST_ARCH), armel x32))
        PLATFORM = --platform=unknown
 endif

Reply via email to