aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-27 11:41:23 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-30 09:51:03 +0100
commit0a35fa5b1ce9be51c0a2f557fdfe75fabdf58a23 (patch)
tree291168e7651f9335be7619ccefa63dc17d720a44
parent34f4fefd6b9730bb6661dafff67da64cf73f1082 (diff)
downloadsparse-0a35fa5b1ce9be51c0a2f557fdfe75fabdf58a23.tar.gz
arch: change the arch when changing -m32/64
If the flag -m32 or -m64 is given in argument, we must insure that the corresponding architecture is changed as well. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--target.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target.c b/target.c
index 7829e8f9..90097818 100644
--- a/target.c
+++ b/target.c
@@ -58,6 +58,27 @@ int enum_alignment = 4;
void init_target(void)
{
switch (arch_mach) {
+ case MACH_I386:
+ case MACH_MIPS32:
+ case MACH_PPC32:
+ case MACH_RISCV32:
+ case MACH_SPARC32:
+ case MACH_S390:
+ if (arch_m64 == ARCH_LP64)
+ arch_mach++;
+ break;
+ case MACH_X86_64:
+ case MACH_MIPS64:
+ case MACH_PPC64:
+ case MACH_RISCV64:
+ case MACH_SPARC64:
+ case MACH_S390X:
+ if (arch_m64 == ARCH_LP32)
+ arch_mach--;
+ break;
+ }
+
+ switch (arch_mach) {
case MACH_X86_64:
if (arch_m64 == ARCH_LP64)
break;