-
Notifications
You must be signed in to change notification settings - Fork 30k
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, tools, win: add .S files support to GYP #24553
Conversation
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89
Tentative CI on top of Edit: rebase cannot work ofc. Let me apply it manually... Edit: https://ci.nodejs.org/job/node-test-commit-windows-fanned/22589/ (on https://github.com/targos/node/commits/test-24553) |
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.
LGTM % nit
@@ -2171,6 +2171,9 @@ def _MapFileToMsBuildSourceType(source, rule_dependencies, | |||
elif ext == '.asm': | |||
group = 'masm' | |||
element = 'MASM' | |||
elif ext == '.S': |
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.
I'd suggest doing it like this
elif ext == '.S': | |
elif ext.lower() in ['.asm', '.s']: |
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 that equivalent? On Unices the convention is that .S should be run through cpp whereas .s should not. I don't know if that's applicable to usually-case-insensitive Windows.
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.
AFAICT .s
nor .S
are standard for MSVS. It's more common to see .asm
.
And in this case while the file indeed has .S
semantics on Unices, cl.exe
doesn't except it.
Seems like we have the same bug in ninja.py
, so maybe the fix should be in v8.gyp
, changing the extension to .asm
iff Windows.
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.
node/tools/gyp/pylib/gyp/generator/ninja.py
Lines 1038 to 1047 in 0c64816
elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): | |
command = 'cc' | |
elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. | |
command = 'cc_s' | |
elif (self.flavor == 'win' and ext == 'asm' and | |
not self.msvs_settings.HasExplicitAsmRules(spec)): | |
command = 'asm' | |
# Add the _asm suffix as msvs is capable of handling .cc and | |
# .asm files of the same name without collision. | |
obj_ext = '_asm.obj' |
The canary CI failed on 32bit but maybe it's unrelated? https://ci.nodejs.org/job/node-compile-windows/22547/label=win-vs2017-x86/console |
Error seems unrelated as it refers to an
|
Updated to support both lower and upper cases, PTAL. |
Failures are unrelated. |
Landed in 9920dbc |
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89 PR-URL: nodejs#24553 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89 PR-URL: #24553 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89 PR-URL: nodejs#24553 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89 PR-URL: #24553 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Makes GYP properly handle .S files. Fixes: nodejs/node-v8#89 PR-URL: #24553 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Makes GYP properly handle .S files.
Fixes: nodejs/node-v8#89
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes