Skip to content

Commit

Permalink
parisc: Show error if wrong 32/64-bit compiler is being used
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
Helge Deller committed Feb 13, 2022
1 parent 18a1d5e commit b160628
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/parisc/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b160628

Please sign in to comment.