From 82697ca2a94c5935f8607b66c3e84344d904b0e4 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 28 May 2019 03:44:46 +0300 Subject: [PATCH] waflib: force_32bit: fix wrong DEST_SIZEOF_VOID_P when 64-bit build is allowed --- scripts/waflib/force_32bit.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/waflib/force_32bit.py b/scripts/waflib/force_32bit.py index efec6b11..c8be5a24 100644 --- a/scripts/waflib/force_32bit.py +++ b/scripts/waflib/force_32bit.py @@ -33,12 +33,11 @@ def check_32bit(ctx, msg): return True def configure(conf): - if getattr(conf.env, 'BIT32_ALLOW64'): - conf.env.DEST_SIZEOF_VOID_P = 8 + if check_32bit(conf, 'Checking if \'{0}\' can target 32-bit'.format(conf.env.COMPILER_CC)): + conf.env.DEST_SIZEOF_VOID_P = 4 else: - if check_32bit(conf, 'Checking if \'{0}\' can target 32-bit'.format(conf.env.COMPILER_CC)): - conf.env.DEST_SIZEOF_VOID_P = 4 - else: + conf.env.DEST_SIZEOF_VOID_P = 8 + if not conf.env.BIT32_ALLOW64: flags = ['-m32'] # Think different. if(conf.env.DEST_OS == 'darwin'): @@ -51,6 +50,6 @@ def configure(conf): conf.env.DEST_SIZEOF_VOID_P = 4 else: conf.env.DEST_SIZEOF_VOID_P = 8 - conf.env = env_stash - if getattr(conf.env, 'BIT32_MANDATORY') and conf.env.DEST_SIZEOF_VOID_P == 8: - conf.fatal('Compiler can\'t create 32-bit code!') + conf.env = env_stash + if conf.env.BIT32_MANDATORY and conf.env.DEST_SIZEOF_VOID_P == 8: + conf.fatal('Compiler can\'t create 32-bit code!')