-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: clean up arm build options #32704
Conversation
This comment has been minimized.
This comment has been minimized.
Marking this semver-major because it affects how add-ons are built (and that's intentional - see the discussion in #30786.) |
This comment has been minimized.
This comment has been minimized.
deps/zlib/zlib.gyp
Outdated
@@ -64,7 +64,7 @@ | |||
'USE_FILE32API' | |||
], | |||
}], | |||
['(target_arch in "ia32 x64 x32" and OS!="ios") or arm_fpu=="neon"', { | |||
['(target_arch in "ia32 x64 x32" and OS!="ios") or arm_version==7', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Is this a safe assumption that armv7 will have neon support?
- What about armv8 and newer (which always have neon)? Do they get detected as 7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Yes, see the commit log.
-
armv8 is
--dest-cpu=arm64
, armv7 and armv6 are--dest-cpu=arm
.
common.gypi
Outdated
@@ -268,6 +269,10 @@ | |||
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin | |||
|
|||
'conditions': [ | |||
[ 'arm_version==7', { | |||
# Any Cortex-A that can run V8 supports at least armv7-a+neon-vfpv3. | |||
'cflags': [ '-march=armv7-a+neon-vfpv3' ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I did a brief search and at least Tegra 2-based (Cortex-A9 -- armv7-a) devices do not include neon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, such SoCs exist but they aren't able to run V8 in ARMv7 mode, according to V8:
node/deps/v8/src/codegen/arm/assembler-arm.cc
Lines 156 to 163 in c849f2d
// For cross compilation the preprocessor symbols such as | |
// CAN_USE_ARMV7_INSTRUCTIONS and CAN_USE_VFP3_INSTRUCTIONS can be used to | |
// enable ARMv7 and VFPv3 instructions when building the snapshot. However, | |
// these flags should be consistent with a supported ARM configuration: | |
// "armv6": ARMv6 + VFPv2 | |
// "armv7": ARMv7 + VFPv3-D32 + NEON | |
// "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV | |
// "armv8": ARMv8 (+ all of the above) |
node/deps/v8/src/codegen/arm/assembler-arm.cc
Lines 218 to 222 in c849f2d
unsigned runtime = kArmv6; | |
// NEON and VFPv3 imply at least ARMv7-A. | |
if (cpu.has_neon() && cpu.has_vfp3_d32()) { | |
DCHECK(cpu.has_vfp3()); | |
runtime |= kArmv7; |
Tegra 2 specifically is pretty obsolete (we're talking 10 year old smartphones and tablets) but if someone wanted to build node for it, they can with ./configure -- -Darm_version=6
.
Is there a more recent SoC where this is an issue?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🤦- fortunately |
* default to `-march=armv7` and `-mfpu=neon` when targeting armv7. Any Cortex-A capable of running V8 supports at least that. * remove the `--arm-fpu=...` configure option. It was added to support Debian's armel port (armv5, for the purpose of this discussion) but V8 (and therefore Node.js) dropped support for armv5 in early 2016. * remove the `--arm-float-abi=...` configure option. There should never be a reason to build in soft or softp mode; armv6 is the bare minimum nowadays and supports VFP. Fixes: nodejs#30786
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm running out of patience with this PR. Test failures because of weird floating-point issues...
(That's just one example.) If someone wants to pick this up again, be my guest. |
default to
-march=armv7-a+neon-vfp3
when targeting armv7. AnyCortex-A capable of running V8 supports at least that.
remove the
--arm-fpu=...
configure option. It was added to supportDebian's armel port (armv5, for the purpose of this discussion) but
V8 (and therefore Node.js) dropped support for armv5 in early 2016.
remove the
--arm-float-abi=...
configure option. There should neverbe a reason to build in soft or softp mode; armv6 is the bare minimum
and supports VFP.
Fixes: #30786