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
Don't set definition flags for MSVC ARM targets #518
Conversation
Thanks for this! I'm wondering though if it's perhaps best to panic or error in these cases? It seems sort of bad to silently ignore user input? I'm not really sure of the best way to handle this unfortunately if it's a feature that's not supported by just one assembler... |
That's a good point, I guess it ultimately comes down to where one thinks this quirk should be taken into account (i.e. at the On the one hand someone that's writing assembly for this target presumably knows that they can't use these I think both viewpoints are valid, and would be happy to go the route of a panic or error in this (or a new) PR if you think that silently ignoring these flags isn't the right way to go.
I agree it doesn't help that it's just one (relatively niche) assembler that has this issue. Ideally I'd look at existing assembly code for this target to see how this change would affect people, but GitHub search doesn't make it easy to filter that granularly, and it's also unlikely that's there's much code for this target to start with. |
To be clear I have zero experience with this assembler, so I'm not sure what the best route is! Is the syntax different enough that you wouldn't try to shove multiple architectures/platforms into one file? If that's the case then if you're already not trying to rely on any |
Agree with everything that has been said here. This quite a niche case of someone wanting to compile assembler for ARM on windows, for windows, exclusively through an MSVC environment (where this would be the only assembler available to them). For context this came in because e.g.
(and that's almost the case of rustc and the psm crate rn :P ) I guess the slightly more "middle of the road" solution would be to emit a warning: If the user did try to use a -Dmacro in their armasm assembler, they would get an error anyway, either when assembling or a "symbol not found" when linking. Then they'd be able to see the warning and realise what's happening. |
Hm @Stammark if what you're saying is right then I don't think this PR will help that use case. This is only avoiding flags explicitly defined with |
Ah yes, having actually looked at this properly now, that's correct, my bad! The env var side would be a different topic entirely (and would be a niche case of a niche case), so ignore most of the above, sorry haha :') In light of that, I don't have any preference for how to handle this. All I can think of adding rn is: if we do choose to error, then we could do it gracefully rather than letting the tool derp out on us (but I wouldn't say this is a big deal either :D ) |
I'm personally ok with ignoring the |
@alexcrichton Yes, in the case that led me here assembly files are split by architecture and OS so this fixes that for MSVC ARM targets (the MSVC ARM assembler also seems to be in a superseded format, so is unlikely to ever be mixed with ARM assembly from other platforms). The solution I'm leaning towards at the moment is to ignore -D flags for these targets as this PR currently does, but also output a message to stderr warning that this is the case. That way projects will still build but also be made aware of potential issues. Would that be a satisfactory way forward? |
Seems reasonable to me! |
@alexcrichton Thanks, this should be good to go now. |
👍 |
This is a simple fix for #516