aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/include
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-02-13 22:29:25 +0100
committerHelge Deller <deller@gmx.de>2022-02-13 22:45:53 +0100
commitb160628e9ebcdc85d0db9d7f423c26b3c7c179d0 (patch)
tree01a8abc1f566e4a5068042247c1e388cccdf8b9e /arch/parisc/include
parentparisc: Add ioread64_lo_hi() and iowrite64_lo_hi() (diff)
downloadlinux-dev-b160628e9ebcdc85d0db9d7f423c26b3c7c179d0.tar.xz
linux-dev-b160628e9ebcdc85d0db9d7f423c26b3c7c179d0.zip
parisc: Show error if wrong 32/64-bit compiler is being used
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+
Diffstat (limited to 'arch/parisc/include')
-rw-r--r--arch/parisc/include/asm/bitops.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 0ec9cfc5131f..56ffd260c669 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -12,6 +12,14 @@
#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.