From c6bb361b8411132891bdbc816ceda6c147754cf6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 12 Jul 2012 16:29:43 +0200 Subject: [PATCH] build: partially fix configure on ARM V8 on ARM requires that armv7 is set. We don't have a good way to detect the CPU model right now so we pick a default and hope that it works okay for the majority of people. Non-scientific sampling - the ARM hardware I have lying around the house - suggests that ARMv5 and ARMv6 are still most common so armv7=0 it is. This obviously needs to be revisited sometime in the future. --- configure | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 6ce54b8b65..6c724111a8 100755 --- a/configure +++ b/configure @@ -250,19 +250,6 @@ def host_arch_win(): return matchup.get(arch, 'ia32') -def host_arch(): - """Host architecture. One of arm, ia32 or x64.""" - if os.name == 'nt': - arch = host_arch_win() - else: - arch = host_arch_cc() - return arch - - -def target_arch(): - return host_arch() - - def compiler_version(): try: proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE) @@ -278,17 +265,24 @@ def compiler_version(): def configure_node(o): - # TODO add gdb o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '') o['variables']['node_install_npm'] = b(not options.without_npm) o['variables']['node_install_waf'] = b(not options.without_waf) - o['variables']['host_arch'] = host_arch() - o['variables']['target_arch'] = options.dest_cpu or target_arch() o['default_configuration'] = 'Debug' if options.debug else 'Release' - cc_version, is_clang = compiler_version() + host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc() + target_arch = options.dest_cpu or host_arch + o['variables']['host_arch'] = host_arch + o['variables']['target_arch'] = target_arch + + # V8 on ARM requires that armv7 is set. We don't have a good way to detect + # the CPU model right now so we pick a default and hope that it works okay + # for the majority of users. + if target_arch == 'arm': + o['variables']['armv7'] = 0 # FIXME # clang has always supported -fvisibility=hidden, right? + cc_version, is_clang = compiler_version() if not is_clang and cc_version < (4,0,0): o['variables']['visibility'] = ''