Package: altos
Version: 1.9.22-3
Severity: serious
Tags: patch ftbfs
Justification: fails to build from source
X-Debbugs-Cc: [email protected], [email protected]
User: [email protected]
Usertags: amd64

Dear Maintainer,

When building the package for amd64v3 in Ubuntu, `-march=x86-64-v3` is added to 
LDFLAGS. This flag is incorrectly used with `arm-none-eabi-gcc`, which causes 
the build to fail. The attached patch prevents the host's LDFLAGS from being 
used with foreign compilers.

-- System Information:
Debian Release: forky/sid
  APT prefers resolute-updates
  APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 
'resolute'), (100, 'resolute-proposed'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 7.0.0-42-generic (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages altos depends on:
pn  default-jre | java2-runtime  <none>
pn  freetts                      <none>
ii  libc6                        2.43-2ubuntu2.4
ii  libelf1t64                   0.194-4
ii  libjansson4                  2.14-2build4
pn  libjfreechart-java           <none>
ii  libjson-c5                   0.18+ds-3
ii  libreadline8t64              8.3-4
ii  libusb-1.0-0                 2:1.0.29-2build1
pn  nickle                       <none>

altos recommends no packages.

altos suggests no packages.
Description: Don't pass host CPPFLAGS/LDFLAGS to the ARM compiler probes
 The cortex-m0/m3 checks override CFLAGS but inherit the host LDFLAGS and
 CPPFLAGS. On amd64v3 (and any build using -march in LDFLAGS for LTO)
 these contain -march=x86-64-v3, which arm-none-eabi-gcc rejects, so the
 probes fail and no firmware (*.ihx) is built, making dh_install fail.
Author: OpenCode
Reviewed-By: Sebastien Bacher <[email protected]>
Reviewed-By: Willow Carlson-Huber <[email protected]>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/altos/+bug/2168943
Forwarded: no

--- a/configure.ac
+++ b/configure.ac
@@ -278,9 +278,13 @@
 if test "x$HAVE_ARM_CC" = "xyes"; then
        save_CC="$CC"
        save_CFLAGS="$CFLAGS"
+       save_CPPFLAGS="$CPPFLAGS"
+       save_LDFLAGS="$LDFLAGS"
        save_LIBS="$LIBS"
        CC="$ARM_CC"
        CFLAGS="-mthumb -mcpu=cortex-m0"
+       CPPFLAGS=""
+       LDFLAGS=""
        LIBS="--specs=picolibc.specs"
        AC_LANG_PUSH([C])
 
@@ -300,6 +304,8 @@
        AC_LANG_POP([C])
        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"
+       CPPFLAGS="$save_CPPFLAGS"
+       LDFLAGS="$save_LDFLAGS"
        CC="$save_CC"
 else
        HAVE_ARM_M3_CC=no

Reply via email to