Closed Bug 1656725 Opened 4 years ago Closed 4 years ago

MinGW build error: /builds/worker/workspace/obj-build/dist/include/mozilla/mozalloc.h:146:30: error: no member named 'tl' in namespace 'mozilla'

Categories

(Core :: MFBT, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- unaffected
firefox81 --- fixed

People

(Reporter: cpeterson, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

@ froydnj, I believe this MinGW build error is a regression from MOZ_RAII bug 1223932.

While fixing my MinGW build break (fseeko bug 1656285), I found a second MinGW build break (nsTAutoString bug 1656185). Applying fixes for both those bugs, I hit a third MinGW build break:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4438f8a2c8a006b2c086653d08b1a3ee6474634d&selectedTaskRun=Rhzb07CyRCGvmfzYe_z7sA.0

INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/x86_64-w64-mingw32-clang++ -std=gnu++17 -o TelemetryEvent.o -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DOS_WIN=1 -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN '-DMOZ_APP_VERSION="81.0a1"' -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/toolkit/components/telemetry -I/builds/worker/workspace/obj-build/toolkit/components/telemetry -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -I/builds/worker/checkouts/gecko/xpcom/build -I/builds/worker/checkouts/gecko/xpcom/threads -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wno-unknown-pragmas -Wno-unused-function -Wno-conversion-null -Wno-switch -Wno-enum-compare -Wno-gnu-zero-variadic-macro-arguments -Werror=implicit-function-declaration -Wno-unknown-warning-option -fno-sized-deallocation -fno-aligned-new -fms-extensions -fcrash-diagnostics-dir=/builds/worker/artifacts -D_HAS_EXCEPTIONS=0 -fno-exceptions -fno-strict-aliasing -Wno-incompatible-ms-struct -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -gcodeview -O2 -fno-omit-frame-pointer -funwind-tables -Wno-error=shadow -fexperimental-new-pass-manager  -MD -MP -MF .deps/TelemetryEvent.o.pp   /builds/worker/checkouts/gecko/toolkit/components/telemetry/core/TelemetryEvent.cpp
INFO -  In file included from /builds/worker/checkouts/gecko/toolkit/components/telemetry/core/TelemetryEvent.cpp:7:
INFO -  In file included from /builds/worker/checkouts/gecko/toolkit/components/telemetry/core/Telemetry.h:10:
INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/TelemetryHistogramEnums.h:7:
INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/TemplateLib.h:22:
INFO -  In file included from /builds/worker/workspace/obj-build/dist/stl_wrappers/type_traits:59:
[task 2020-08-01T20:18:53.693Z] 20:18:53    ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/mozalloc.h:146:30: error: no member named 'tl' in namespace 'mozilla'
INFO -      if (aNumElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value) {
INFO -                      ~~~~~~~~~^
[task 2020-08-01T20:18:53.693Z] 20:18:53    ERROR -  /builds/worker/workspace/obj-build/dist/include/mozilla/mozalloc.h:159:29: error: no member named 'tl' in namespace 'mozilla'
INFO -      if (aNewSize & mozilla::tl::MulOverflowMask<sizeof(T)>::value) {
INFO -                     ~~~~~~~~~^
INFO -  2 errors generated.

I bisected MinGW builds to find this pushlog with MOZ_RAII bug 1223932:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=daf848d43d89ec50340516ab362474719d1da28d&tochange=d9daf481f520ad61960773b15a3c1c44e28b8675

Flags: needinfo?(nfroyd)
No longer regressed by: 1656185
See Also: → 1656185
Has Regression Range: --- → yes

I can totally see how the regressing patch changes the #include sequence for some files, but I'm not quite sure what to do about this particular instance (maybe there are others, too?).

To explain the error in English: We're including <type_traits>, which, because of our system header wrapping, means that we first include the real type_traits and then we include mozilla/mozalloc.h. mozilla/mozalloc.h includes mozilla/TemplateLib.h, which it expects to define MulOverflowMask and friends...but higher up in the include stack, we already included mozilla/TemplateLib.h and are in the process of including it, so we can't include it again, and therefore the relevant code is not defined for mozilla/mozalloc.h's usage of it.

TelemetryHistogramEnums.h includes mozilla/TemplateLib.h for no obvious reason as far as I can see; it looks like TelemetryHistogramEnums.h really wants <type_traits>, but <type_traits> got cargo-culted in with some other stuff at some point. So maybe if we changed that generated file (and other telemetry headers...), that would fix things?

Flags: needinfo?(nfroyd)
Depends on: 1656945

Fixed by bug 1656945.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Blocks: mingw-clang
You need to log in before you can comment on or make changes to this bug.