#1140559 strace FTCBFS for arm64: passes -mbranch-protection=standard to a non-arm compiler

Package:
src:strace
Source:
src:strace
Submitter:
Helmut Grohne
Date:
2026-06-22 17:23:02 UTC
Severity:
normal
Tags:
#1140559#5
Date:
2026-06-22 17:05:16 UTC
From:
To:
strace fails to cross build from source when building for arm64 on
amd64. Many other architecture combinations just work. What is unique
about arm64 is CFLAGS containing -mbranch-protection=standard.
Unfortunately, this flag makes it into CFLAGS_FOR_BUILD and from there
it is used for compiling ioctlsort with CC_FOR_BUILD, which doesn't like
the flag. I traced this down to debian/rules assigning CFLAGS to
CFLAGS_FOR_BUILD with a comment "ioctlsort is compiled with *_FOR_BUILD
flags". I guess that in earlier times, dpkg's buildflags.mk was not
setting CFLAGS_FOR_BUILD and then blhc was complaining about missing
flags while compiling ioctlsort. Nowadays, buildflags.mk properly
initializes CFLAGS_FOR_BUILD. Hence, I propose to turn the = assignment
into a ?= assignment. You could also drop the assignment entirely and
just export the value from buildflags.mk. This is all that is needed for
making strace cross build for arm64.

Helmut