Skip to content
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 define __x86_64__ in microsoft mode? #21270

Closed
nico opened this issue Sep 10, 2014 · 4 comments
Closed

Don't define __x86_64__ in microsoft mode? #21270

nico opened this issue Sep 10, 2014 · 4 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema" wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@nico
Copy link
Contributor

nico commented Sep 10, 2014

Bugzilla Link 20896
Resolution WONTFIX
Resolved on Sep 10, 2014 12:51
Version unspecified
OS All
CC @zmodem,@rnk

Extended Description

v8 uses this technique to check for x32:

#if defined(x86_64) && !defined(LP64)
...
#endif

With cl.exe, this works as cl.exe doesn't define x86_64. With clang-cl, this fails since clang-cl does define x86_64 but doesn't define LP64 (because Windows is LLP64).

clang-cl probably shouldn't define x86_64? It already defines the cl-equivalent _M_X64.

https://codereview.chromium.org/18014003/diff/161001/src/base/build_config.h

@nico
Copy link
Contributor Author

nico commented Sep 10, 2014

Opinions?

@nico
Copy link
Contributor Author

nico commented Sep 10, 2014

After talking to Hans, it seems better to change v8 to check SIZEOF_POINTER instead. That works with gcc and clang, and is less brittle than what they currently do.

@rnk
Copy link
Collaborator

rnk commented Sep 10, 2014

Sounds good, here's the comment I wrote before you closed it. :)


This came up in discussion for r212753:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140707/109607.html
http://reviews.llvm.org/D4419

Basically, I think things will be even more confusing if we stop defining the Unix / GCC / Clang style target macros. We can change Clang's *mmintrin.h headers to look for MSVC-style macros, but I expect there is other code out there that has similar checks. I'm open to being wrong, though.

Win64 is clearly a non-LP64 x86_64 target, so I don't think that is the correct way to test for x32. According to the x32 glibc wiki page, they should test for ILP32:
https://sourceware.org/glibc/wiki/x32

@nico
Copy link
Contributor Author

nico commented Sep 10, 2014

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema" wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants