Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit b160628

Browse files
committed
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 <[email protected]> Cc: [email protected] # v5.15+
1 parent 18a1d5e commit b160628

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/parisc/include/asm/bitops.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
#include <asm/barrier.h>
1313
#include <linux/atomic.h>
1414

15+
/* compiler build environment sanity checks: */
16+
#if !defined(CONFIG_64BIT) && defined(__LP64__)
17+
#error "Please use 'ARCH=parisc' to build the 32-bit kernel."
18+
#endif
19+
#if defined(CONFIG_64BIT) && !defined(__LP64__)
20+
#error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
21+
#endif
22+
1523
/* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
1624
* on use of volatile and __*_bit() (set/clear/change):
1725
* *_bit() want use of volatile.

0 commit comments

Comments
 (0)