Linker errors when building for Android under higher optimization levels
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: acreskey, Assigned: acreskey)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
In Bug 1591725 we're looking at building on Android with different optimization flags such as -O2.
I noticed a number of linker errors in accessibility for Android when building with -Os, -O2, and -O3 instead the default, -Oz.
I'll put up a work-in-progress patch with what I've managed to resolve, but I think I'll need some help with two of the issues.
The errors I ran into:
.../mozilla-central/accessible/android/AccessibleWrap.cpp:361: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::SetCaretOffset(int)'
.../mozilla-central/accessible/android/AccessibleWrap.cpp:369: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::SetCaretOffset(int)'
.../mozilla-central/accessible/android/AccessibleWrap.cpp:384: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::CutText(int, int)'
.../mozilla-central/accessible/android/AccessibleWrap.cpp:392: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::CopyText(int, int)'
.../mozilla-central/accessible/android/AccessibleWrap.cpp:406: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::DeleteText(int, int)'
.../mozilla-central/accessible/android/AccessibleWrap.cpp:408: error: undefined reference to 'mozilla::a11y::HyperTextAccessible::PasteText(int)'
These I fixed by adding the include "HyperTextAccessible-inl.h" to accessible/android/AccessibleWrap.cpp
.../mozilla-central/accessible/android/AccessibleWrap.cpp:770:47: error: expected unqualified-id
java::sdk::Boolean::TRUE());
.../obj-release-android/dist/include/unicode/umachine.h:265:18: note: expanded from macro 'TRUE'
# define TRUE 1
Here icuTRUE
is conflicting with java::sdk::Boolean::TRUE()
https://searchfox.org/mozilla-central/rev/ce02064d8afc8673cef83c92896ee873bd35e7ae/intl/icu/source/common/unicode/umachine.h#265
https://searchfox.org/mozilla-central/source/__GENERATED__/widget/android/bindings/JavaBuiltins.h#78
I've crudely #undef'ed icu's TRUE
but I'm not sure the best way to resolve this -- perhaps the TRUE
symbol in java::sdk::Boolean::
is too problematic and could be renamed to True
?
.../mozilla-central/accessible/android/ProxyAccessibleWrap.cpp:157: error: undefined reference to 'mozilla::a11y::Accessible::HasNumericValue() const'
Here I added the #include "Accessible-inl.h" to ProxyAccessibleWrap.cpp
.../mozilla-central/accessible/android/TraversalRule.cpp:135: error: undefined reference to 'mozilla::a11y::Accessible::Role() const'
.../mozilla-central/accessible/android/TraversalRule.cpp:125: error: undefined reference to 'mozilla::a11y::Accessible::Role() const'
.../mozilla-central/accessible/android/TraversalRule.cpp:143: error: undefined reference to 'mozilla::a11y::Accessible::Role() const'
.../mozilla-central/accessible/android/TraversalRule.cpp:153: error: undefined reference to 'mozilla::a11y::Accessible::Role() const'
Here I also added the include inline header: #include "Accessible-inl.h"
And that's leaving me with these, which I haven't successfully found a solution to yet because their origin isn't clear.
.../mozilla-central/accessible/generic/Accessible.h:581: error: undefined reference to 'mozilla::a11y::Accessible::HasGenericType(mozilla::a11y::AccGenericType) const'
.../mozilla-central/accessible/generic/Accessible.h:581: error: undefined reference to 'mozilla::a11y::Accessible::HasGenericType(mozilla::a11y::AccGenericType) const'
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
The HasGenericType
issue also needs an include of "Accessible-inl.h"
; we're running into the same issues when building Android with ASan. You need the includes in SessionAccessibility.cpp and TraversalRule.cpp.
Assignee | ||
Comment 3•5 years ago
|
||
Thank you Nathan, that was it.
The patch is updated, the only question is the best way to deal with java::sdk::Boolean::TRUE
conflicting with ICU's TRUE
.
Eitan looks to be the most active here but is on leave at the moment.
Comment 4•5 years ago
|
||
The fuzzing patch just #undef
'd things in the appropriate .cpp.
Comment 5•5 years ago
|
||
(In reply to Andrew Creskey from comment #3)
The patch is updated, the only question is the best way to deal with
java::sdk::Boolean::TRUE
conflicting with ICU'sTRUE
.
Eitan looks to be the most active here but is on leave at the moment.
Neither of these "TRUE"s is in our module, so I'm not sure we can make the "right" decision here. To complicate things, AFAIK these are both in third party code. I think I'd just undef ICU's TRUE as you're doing.
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
Ok, then I think that patch is ready for review - James, can I put you down as reviewer, or is there someone else?
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 9•5 years ago
|
||
bugherder |
Description
•