Your message dated Sun, 03 Sep 2023 11:40:55 +0000
with message-id <e1qcltl-001ncm...@fasolo.debian.org>
and subject line Bug#1050991: fixed in linux 6.5.1-1~exp1
has caused the Debian Bug report #1050991,
regarding FTCBFS amd64 -> arm64 due to using host-arch flags for native builds 
and vice-versa
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1050991: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050991
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: linux
Version: 6.4.11-1
Severity: normal

Hi,

starting with dpkg 1.22.0, linux fails to cross-build with build=amd64 and
host=arm64 like this:

# HOSTCC  scripts/basic/fixdep
  gcc -Wp,-MMD,scripts/basic/.fixdep.d -g -O2 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong 
-fstack-clash-protection -Wformat -Werror=format-security 
-mbranch-protection=standard -Wdate-time -D_FORTIFY_SOURCE=2   -I 
./scripts/basic -Wl,-z,relro -o scripts/basic/fixdep 
/<<PKGBUILDDIR>>/scripts/basic/fixdep.c   
gcc: error: unrecognized command-line option '-mbranch-protection=standard'

This is because starting with dpkg 1.22.0, CFLAGS includes architecture
specific flags (in this case branch-protection=standard) which will not work on
amd64 (the above is a native gcc as part of a cross-build). So we are now able
to easily find a new class of bugs that was hidden before where flags meant for
the host architecture are passed to the build architecture compiler and
vice-versa. In the future, dpkg will fix this by setting flags like
CFLAGS_FOR_BUILD which should be used for native gcc invocations. Until then,
these variables can be set manually. Setting these manually is only a crutch
because they get side-effects from DEB_<flags>_MAINT_<op> DEB_<flags>_<op> and
thus the following patch uses ?= to not override the variables as set by dpkg:

diff -Nru linux-6.4.11/debian/rules.real linux-6.4.11/debian/rules.real
--- linux-6.4.11/debian/rules.real      2023-08-17 09:05:43.000000000 +0200
+++ linux-6.4.11/debian/rules.real      2023-09-01 06:43:41.000000000 +0200
@@ -43,7 +43,10 @@
 setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" 
DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE)" 
KBUILD_BUILD_VERSION_TIMESTAMP="$(DISTRIBUTOR) $(SOURCEVERSION) 
($(SOURCE_DATE_UTC_ISO))" KBUILD_BUILD_USER="$(word 1,$(subst @, 
,$(MAINTAINER)))" KBUILD_BUILD_HOST="$(word 2,$(subst @, ,$(MAINTAINER)))"
 setup_env += KBUILD_VERBOSE=$(if $(filter terse,$(DEB_BUILD_OPTIONS)),0,1)
 
-MAKE_CLEAN = $(setup_env) $(MAKE) KCFLAGS=-fdebug-prefix-map=$(CURDIR)/= 
KBUILD_HOSTCFLAGS='$(CFLAGS) $(CPPFLAGS)' HOSTCFLAGS='$(CFLAGS) $(CPPFLAGS)' 
KBUILD_HOSTLDFLAGS='$(LDFLAGS)'
+CFLAGS_FOR_BUILD   ?= $(shell dpkg-architecture --host-arch $(DEB_BUILD_ARCH) 
--force --command dpkg-buildflags --get CFLAGS)
+CPPFLAGS_FOR_BUILD ?= $(shell dpkg-architecture --host-arch $(DEB_BUILD_ARCH) 
--force --command dpkg-buildflags --get CPPFLAGS)
+LDFLAGS_FOR_BUILD  ?= $(shell dpkg-architecture --host-arch $(DEB_BUILD_ARCH) 
--force --command dpkg-buildflags --get LDFLAGS)
+MAKE_CLEAN = $(setup_env) $(MAKE) KCFLAGS=-fdebug-prefix-map=$(CURDIR)/= 
KBUILD_HOSTCFLAGS='$(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)' 
HOSTCFLAGS='$(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)' 
KBUILD_HOSTLDFLAGS='$(LDFLAGS_FOR_BUILD)'
 MAKE_SELF := $(MAKE) -f debian/rules.real $(MAKEOVERRIDES)
 MAKEOVERRIDES =

This makes the error from above disappear and the build proceeds nicely but a
new error will be triggered later on:

make[5]: Entering directory '/tmp/linux-6.4.11/tools/lib/subcmd'
  aarch64-linux-gnu-gcc 
-Wp,-MD,/tmp/linux-6.4.11/debian/build/build-tools/tools/objtool/powerpc/libsubcmd/.exec-cmd.o.d
 
-Wp,-MT,/tmp/linux-6.4.11/debian/build/build-tools/tools/objtool/powerpc/libsubcmd/exec-cmd.o
 -ggdb3 -Wall -Wextra -std=gnu99 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/tmp/linux-6.4.11/tools/include/ 
-Wbad-function-cast -Wdeclaration-after-statement -Wformat-security 
-Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes 
-Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked 
-Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef 
-Wwrite-strings -Wformat -Wno-type-limits -Wstrict-aliasing=3 -Wshadow -Werror 
-Wbad-function-cast -Wdeclaration-after-statement -Wformat-security 
-Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes 
-Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked 
-Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef 
-Wwrite-strings -Wformat -Wno-type-limits -Wstrict-aliasing=3 -Wshadow 
-Wno-switch-default -Wno-switch-enum -Wno-packed -Wno-nested-externs -g -O2 
-ffile-prefix-map=/tmp/linux-6.4.11=. -fstack-protector-strong 
-fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
-Wdate-time -D_FORTIFY_SOURCE=2 -g -I/tmp/linux-6.4.11/tools/include 
-I/tmp/linux-6.4.11/tools/arch/arm64/include/uapi 
-I/tmp/linux-6.4.11/tools/arch/powerpc/include 
-I/tmp/linux-6.4.11/tools/objtool/include 
-I/tmp/linux-6.4.11/tools/objtool/arch/powerpc/include 
-I/tmp/linux-6.4.11/debian/build/build-tools/tools/objtool/powerpc/libsubcmd/include
 -DLIBELF_USE_DEPRECATED -D"BUILD_STR(s)=#s" -c -o 
/tmp/linux-6.4.11/debian/build/build-tools/tools/objtool/powerpc/libsubcmd/exec-cmd.o
 exec-cmd.c
cc1: error: ‘-fcf-protection=full’ is not supported for this target

The flag cf-protection=full is amd64 specific but the above is a cross-build
for arm64 and thus it errors out again. So there is host-arch flags leaking
into a native-arch build (first problem) as well as build-arch flags leaking
into a foreign-arch build (second problem).

I had a look into debian/rules.d/tools/objtool/Makefile which seems to be
setting the flags for this but wasn't able to figure out a fitting solution but
maybe what is done with REALHOSTCC and REALHOSTLD has to be done with to CFLAGS
as well like REALHOSTCFLAGS? I need some advice here.

Also, could you turn the "mkdir $*" into "mkdir -p $*" in the rule for
objtool.real-% please? That would make it possible to do re-builds without
cleaning first and my machine is super slow, thanks! :)

An ugly workaround that fixes both issues is to use the following in
debian/rules.real:

MAKE_CLEAN = $(setup_env) $(MAKE) KCFLAGS=-fdebug-prefix-map=$(CURDIR)/= 
KBUILD_HOSTCFLAGS='' HOSTCFLAGS='' KBUILD_HOSTLDFLAGS=''

What do you think?

Thanks!

cheers, josch

--- End Message ---
--- Begin Message ---
Source: linux
Source-Version: 6.5.1-1~exp1
Done: Salvatore Bonaccorso <car...@debian.org>

We believe that the bug you reported is fixed in the latest version of
linux, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1050...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Salvatore Bonaccorso <car...@debian.org> (supplier of updated linux package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 03 Sep 2023 13:04:38 +0200
Source: linux
Architecture: source
Version: 6.5.1-1~exp1
Distribution: experimental
Urgency: medium
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Changed-By: Salvatore Bonaccorso <car...@debian.org>
Closes: 1050342 1050368 1050587 1050940 1050991
Changes:
 linux (6.5.1-1~exp1) experimental; urgency=medium
 .
   * New upstream release: https://kernelnewbies.org/Linux_6.5
   * New upstream stable update:
     https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.5.1
 .
   [ Diederik de Haas ]
   * [rt] Update to 6.5-rc7-rt4
   * [rt] Update to 6.5-rt6
 .
   [ Salvatore Bonaccorso ]
   * [rt] Update to 6.5-rt5
 .
   [ Aurelien Jarno ]
   * [riscv64] enable cpufreq support for Starfive JH7110: enable CPUFREQ_DT,
     MFD_AXP20X_I2C and REGULATOR_AXP20X as modules, and CPUFREQ_DT_PLATDEV as
     built-in.
   * [armel/rpi,armhf,arm64] enable CPUFREQ_DT_PLATDEV as built-in, as it does
     not get autoloaded as a module (Closes: #1050587)
 .
   [ Bastian Blank ]
   * Use pytest to test some of the code.
   * Re-add /usr/include/drm and /usr/include/scsi to linux-libc-dev; they
     don't longer conflict with other packages. (closes: #1050368)
   * Properly split host and build flags. (closes: #1050991)
 .
   [ Miguel Bernal Marin ]
   * [x86] drivers/hwtracing/intel_th: Enable INTEL_TH_ACPI Intel Trace Hub
     ACPI controller as module (Closes: #1050342)
   * [amd64] arch/x86/ras: Enable RAS_CEC (Correctable Errors Collector)
     (Closes: #1050940)
 .
   [ Antonio Terceiro ]
   * [arm64] sound/pci: Enable SND_CMIPCI as a module
Checksums-Sha1:
 bfeea5b2c73a7b1b1e38218e15f1204c541e5c31 288951 linux_6.5.1-1~exp1.dsc
 d075fc20ab8da7b89f9306fb9fc30662d0e78a5a 141430456 linux_6.5.1.orig.tar.xz
 a4779a9531266c66038815a48c0ebd8dde1af401 1492992 
linux_6.5.1-1~exp1.debian.tar.xz
 8243f4152a85a72a7e100a483c07cd709f565985 6869 
linux_6.5.1-1~exp1_source.buildinfo
Checksums-Sha256:
 002e0328103b9a9bc20d31c45307959463e54385b0e1ecd08232fc542d294753 288951 
linux_6.5.1-1~exp1.dsc
 15aca08e8a92a76fb650e7a34abce3b24ceecfa154abddd52d0bfde4fbf6b18d 141430456 
linux_6.5.1.orig.tar.xz
 0ca3f5f821ed31b7fc2ea8aa2521abff07eb80ce07e5651f9ca9777ca8d8e8f9 1492992 
linux_6.5.1-1~exp1.debian.tar.xz
 1f05fc674244cae82e4a59ee7e413a968339b4851be412849495af4acbaf5c07 6869 
linux_6.5.1-1~exp1_source.buildinfo
Files:
 819ae87846d34601dd9e14488615575b 288951 kernel optional linux_6.5.1-1~exp1.dsc
 ad9ca3aa5d7a4451733b2db75b5658ad 141430456 kernel optional 
linux_6.5.1.orig.tar.xz
 e32b97ca302b42c1c67521fcc494d409 1492992 kernel optional 
linux_6.5.1-1~exp1.debian.tar.xz
 0b83fdef58aa6c2083d2f56387860c6e 6869 kernel optional 
linux_6.5.1-1~exp1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQKmBAEBCgCQFiEERkRAmAjBceBVMd3uBUy48xNDz0QFAmT0bIlfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDQ2
NDQ0MDk4MDhDMTcxRTA1NTMxRERFRTA1NENCOEYzMTM0M0NGNDQSHGNhcm5pbEBk
ZWJpYW4ub3JnAAoJEAVMuPMTQ89EueQP/RJbLkk1gQ2u3k5oC6Dc1VRPq+uZRRsO
Zlca5F8koaXRfU4IF/IP5XtIiJpzeqTYjVz9yLp1Ro8jBGu4X/AKYkgBXTaux/j2
23nTgGUkEwS83M34eby0Lxr5v+f+hPcN5FRd7AKdZI7Pg3gqhPv3Es1BPfPjnyyC
a2G7RcJpzuXeO2KBrDOf4SObzwLMABZD7NydXJoOtBoGcKwYIqjenKHok44E1GUx
Ad89zqNr0ubVgnTgkje6cViYF56C8wYkh4TxWX1Rif2qZe36z1xUGMaDtqN6uGgg
72kVjxrj9q4yQ5O8guj1at8ICq8qVRP9DyGqBXUT1PPHHpB23NFsW2Vke6E+5Xjz
xKlZtHDGWWDNO3lOPxNySUiaSru3eQqp7MQFVqEZ6Vx5XPOd2nzCaZSF6KXtTU7U
CkxVxKfr40ngrIr4qfNvT9pGDh2utlZgMEoqgqZAjsxHgqnZEp1YrVXMSwGZs4ez
GRpMywfHcOwO50Hfo2dGfpiACW8+DCMNYG8tZp0tMJgNDxV7j9GS95fGqR+wtt+b
kIh2iqPWhy01OCdXtIjLywFauDjMUdozz+A72Zn0hMdd2gxUVNEYsJCEbhtJA2Vh
bPj8KO78rpEsVZQKdZajHgkZ0jxghnpRboBoZ0aYc0jq1V7EmkFCYUx7DmA7qESU
XTUlpRziBQgE
=N5CX
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to