]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
parisc: Show error if wrong 32/64-bit compiler is being used
authorHelge Deller <deller@gmx.de>
Sun, 13 Feb 2022 21:29:25 +0000 (22:29 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 7 Mar 2022 10:44:02 +0000 (11:44 +0100)
BugLink: https://bugs.launchpad.net/bugs/1963890
commit b160628e9ebcdc85d0db9d7f423c26b3c7c179d0 upstream.

It happens quite often that people use the wrong compiler to build the
kernel:

make ARCH=parisc   -> builds the 32-bit kernel
make ARCH=parisc64 -> builds the 64-bit kernel

This patch adds a sanity check which errors out with an instruction how
use the correct ARCH= option.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/parisc/include/asm/bitops.h

index aa4e883431c1af43252576a6032a4d2686de6f0a..5779d463b341f949cb4b1d8237f0a5b31c7bd9fb 100644 (file)
 #include <asm/barrier.h>
 #include <linux/atomic.h>
 
+/* compiler build environment sanity checks: */
+#if !defined(CONFIG_64BIT) && defined(__LP64__)
+#error "Please use 'ARCH=parisc' to build the 32-bit kernel."
+#endif
+#if defined(CONFIG_64BIT) && !defined(__LP64__)
+#error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
+#endif
+
 /* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
  * on use of volatile and __*_bit() (set/clear/change):
  *     *_bit() want use of volatile.