aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-27 10:45:53 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-30 17:43:06 +0200
commitdf8a5fa4dc6b604e457fe5e8bac82974d752036b (patch)
treee99d27d3e6337f6bc1e7dc9faf54e0074d594af2
parent551b85c8a241bd45b267db152eca4cb01eddce39 (diff)
downloadsparse-dev-df8a5fa4dc6b604e457fe5e8bac82974d752036b.tar.gz
default to LP64 for all and only for 64 bit ABIs
Currently sparse assumes LP64 only for x86-64. This requires to always use the flag '-m64' for the other 64 bit archs like arm64 or ppc64. There is also another problem on machines using the x32 ABI on x86_64, which is, of course, not LP64. So, change this by using LP64 by default if __LP64__ is defined on the build machine. This will solve the current problem with x32 but will also give the correct default on all 64 bit archs. Reported-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index f7fdac96..a4791da8 100644
--- a/lib.c
+++ b/lib.c
@@ -280,7 +280,7 @@ static enum { STANDARD_C89,
#define ARCH_LP64 1
#define ARCH_LLP64 2
-#ifdef __x86_64__
+#ifdef __LP64__
#define ARCH_M64_DEFAULT ARCH_LP64
#else
#define ARCH_M64_DEFAULT ARCH_LP32