mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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.
This commit is contained in:
28
configure
vendored
28
configure
vendored
@@ -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'] = ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user