sMmapAccessScope; error: initializer for thread-local variable must be a constant expression
Categories
(Core :: Networking: JAR, defect, P3)
Tracking
()
People
(Reporter: stransky, Unassigned)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
8.20 KB,
patch
|
Details | Diff | Splinter Review |
Latest trunk fails to build on Fedora 32, I get:
0:09.17 media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_sse2_gn
0:09.82 In file included from Unified_cpp_modules_libjar0.cpp:2:
0:09.82 /home/komat/src-wayland/modules/libjar/MmapFaultHandler.cpp:18:43: error: initializer for thread-local variable must be a constant expression
0:09.82 static MOZ_THREAD_LOCAL(MmapAccessScope*) sMmapAccessScope;
0:09.82 ^~~~~~~~~~~~~~~~
0:09.82 /home/komat/src-wayland/modules/libjar/MmapFaultHandler.cpp:18:43: note: use 'thread_local' to allow this
Reporter | ||
Comment 1•5 years ago
|
||
I use mozilla build environment / clang to build it.
Comment 2•5 years ago
|
||
I think this belongs in Networking:JAR based upon other bugs that have touched MmapFaultHandler.cpp.
Comment 3•5 years ago
|
||
Michal, can you take a look?
I will put it to P3, feel free to change it.
Reporter | ||
Comment 4•5 years ago
|
||
That's on Fedora 32 / clang, I don't see that when I use gcc 10.0.
Comment 5•5 years ago
|
||
I don't understand the error. Anyway, I'm wondering why it doesn't fail on other similar usages like:
https://searchfox.org/mozilla-central/rev/13b081a62d3f3e3e3120f95564529257b0bf451c/dom/script/ScriptSettings.cpp#31
https://searchfox.org/mozilla-central/rev/13b081a62d3f3e3e3120f95564529257b0bf451c/tools/profiler/tasktracer/GeckoTaskTracer.cpp#51
Reporter | ||
Comment 6•5 years ago
|
||
Frankly I didn't test other cases, this is the first bug I hit.
As I use gcc now it does not block me...but I don't know why it affects Fedora 32 only with clang provided by Mozilla. I didn't see that on Fedora 31 with the same clang.
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
Martin, you can try if you hit the error with another MOZ_THREAD_LOCAL usages with the patch above which disables sigbus handling on linux in libjar. It seems like a bug in clang. I'm marking this as a dupe of 1619206.
(In reply to Martin Stránský [:stransky] from comment #6)
Fedora 32 only with clang provided by Mozilla.
What was the --version
on that clang? As far as I know, this bug was introduced in clang 10.0.0 trunk, and Mozilla has not yet provided one of those.
Reporter | ||
Comment 10•5 years ago
|
||
Ahh you're right, I have clang version 10.0.0 (Fedora 10.0.0-0.1.rc2.fc32)
Description
•