_M_X64 definition is not consistent between regular builds and mingwclang x64 builds
Categories
(Firefox Build System :: General: Unsupported Platforms, defect)
Tracking
(firefox122 fixed)
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: yannis, Assigned: yannis)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Assignee | ||
Comment 2•5 months ago
•
|
||
I initially misunderstood my actual problem, so here it is. This code results in successful regular builds but failed MinGW builds:
#if defined(_M_X64)
constexpr bool kInitiallyTargetingX64 = true;
#else
constexpr bool kInitiallyTargetingX64 = false;
#endif
#include <stdint.h>
#if defined(_M_X64)
constexpr bool kFinallyTargetingX64 = true;
#else
constexpr bool kFinallyTargetingX64 = false;
#endif
static_assert(kInitiallyTargetingX64 == kFinallyTargetingX64);
In regular builds, _M_X64
is defined directly by the compiler if targeting x64. When you compile something _M_X64
will be available from the start of the C++ file. However in mingwclang builds, _M_X64
is not directly defined like this. It only appears after including some header files, such as windows.h
or stdint.h
(the list in unclear to me), likely because they end up including _mingw_mac.h
. (Including stddef.h
does not result in defining _M_X64
, for example.)
Assignee | ||
Comment 3•5 months ago
|
||
This patch makes mingwclang build compile with -include _mingw.h so that
MSVC-style constants are defined from the start of C++ files rather than
at the point where they start including files. This makes mingwclang
builds behave more closely to regular builds, thus potentially avoiding
future backouts for mingwclang build failures and/or successful but
incorrect mingwclang builds.
Assignee | ||
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Pushed by yjuglaret@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9d5244ee58a6 Make MSVC-style architecture constants consistent in mingwclang builds. r=tjr
Comment 5•5 months ago
|
||
bugherder |