remove c++ standard library-detecting code from Compiler.h
Categories
(Core :: MFBT, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: shravanrn, Assigned: froydnj)
References
Details
Attachments
(1 file)
Building android on arm64 seems to break on try servers with some of the rlbox changes... It is not fully clear why this is the case yet.
Reporter | ||
Comment 1•5 years ago
|
||
Nathan: Any thoughts on the below?
It seems that using the std=c++17 flag on lib thebes is what triggers the build breaks with the following error messages
/builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc_abort.h:23:5: error: unknown type name 'MOZ_NORETURN'
/builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc_abort.h:25:5: error: expected unqualified-id
/builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/throw_gcc.h:51:37: error: unknown type name 'MOZ_ALWAYS_INLINE'
/builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/throw_gcc.h:51:54: error: expected unqualified-id
![]() |
Assignee | |
Comment 2•5 years ago
|
||
The secret here is the include stack:
...
[task 2019-08-27T18:27:21.853Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Attributes.h:12:
[task 2019-08-27T18:27:21.853Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Compiler.h:43:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers/cstddef:3:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/fetches/android-ndk/sources/cxx-stl/llvm-libc++/include/cstddef:87:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers/type_traits:50:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:29:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers/new:44:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers/new:3:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/fetches/android-ndk/sources/cxx-stl/llvm-libc++/include/new:89:
[task 2019-08-27T18:27:21.854Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers/exception:3:
[task 2019-08-27T18:27:21.855Z] 18:27:21 INFO - In file included from /builds/worker/fetches/android-ndk/sources/cxx-stl/llvm-libc++/include/exception:82:
[task 2019-08-27T18:27:21.855Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers/cstdlib:64:
[task 2019-08-27T18:27:21.855Z] 18:27:21 INFO - In file included from /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/throw_gcc.h:20:
[task 2019-08-27T18:27:21.855Z] 18:27:21 ERROR - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc_abort.h:23:5: error: unknown type name 'MOZ_NORETURN'
[task 2019-08-27T18:27:21.855Z] 18:27:21 INFO - MOZ_NORETURN
We're in Attributes.h -> Compiler.h
, and Attributes.h is what defines MOZ_NO_RETURN
. Unfortunately, we're including Compiler.h prior to the point where MOZ_NORETURN
is defined, and we're winding up in a maze of system wrappers and STL headers...until we eventually arrive at mozalloc_abort.h, which wants to include Attributes.h to get at the definition of MOZ_NORETURN
...but we've already included that header (or rather, we've started processing the header for inclusion, which is not quite the same thing). And so the symbol we thought was going to get defined doesn't get defined.
The rationale for including cstddef
from Compiler.h is past its sell-by date, so I'll just delete that code so you can have an easier time of things.
Reporter | ||
Comment 3•5 years ago
•
|
||
Thanks!
Also, feel free to change this bug's title and ownership etc. if you want to use it for the commit title
![]() |
Assignee | |
Updated•5 years ago
|
![]() |
Assignee | |
Comment 4•5 years ago
|
||
We don't support stlport anymore, We don't use any of these macros, and
even if we did, there are probably better ways to do what we want than
by depending on the subtleties of how C++ standard libraries version
themselves.
![]() |
Assignee | |
Comment 5•5 years ago
|
||
It's not totally clear to me that the above patch will completely fix things, but ideally you should get a little farther in your adventure.
Reporter | ||
Comment 6•5 years ago
|
||
It did get me a little further :)
Now we fail with this
builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/rlbox/rlbox_helpers.hpp:157:27: error: no template named 'invoke_result_t' in namespace 'std'
So invoke_result_t is a C++ 17 standard library function and i am passing "-std=c++17"... Also, this is a template only function, so not sure why there is an issue here...
![]() |
Assignee | |
Comment 7•5 years ago
|
||
It's entirely possible that the version of libc++ that we're using on Android is too old and didn't have invoke_result_t
. We can fix that.
Reporter | ||
Comment 8•5 years ago
|
||
Sounds good. I imagine this will take some time? If so, I guess we are temporarily blocked on landing the rlbox library code (which needs c++ 17 support) until this is resolved...
![]() |
Assignee | |
Comment 10•5 years ago
|
||
(In reply to Shravan Narayan from comment #8)
Sounds good. I imagine this will take some time? If so, I guess we are temporarily blocked on landing the rlbox library code (which needs c++ 17 support) until this is resolved...
It ought not to be that difficult. We just need to bump our NDK version and deal with any fallout.
(Spoiler: there is fallout from how libc++ decided to change their visibility macros: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d3630beca44a1061589011a9d749b8f2dc47cf40&selectedJob=263882694)
Comment 11•5 years ago
|
||
bugherder |
Description
•