I assume this happens when you try running xpcshell tests on a physical device running Android 5.0 or newer (my phone runs 6.0.1).
I think the issue is we don't build PIE versions of xpcshell (or cppunit tests).
See Also: → bug 1238611
In review, PIE is required on Android 5.0 and up. PIE will not work on Android 4.0 and earlier. It seems unlikely that anyone would be particularly interested in running xpcshell on Android 4.0, so the plan here is to just build xpcshell as PIE, dropping support for xpcshell on Android 4.0 and earlier.
Summary: Attempting to run xpcshell tests locally fails with "error: only position independent executables (PIE) are supported." → Attempting to run xpcshell tests on Android 5+ fails with "error: only position independent executables (PIE) are supported."
Created attachment 8844921 [details] [diff] [review] build Android xpcshell as PIE My intention here is to only affect xpcshell, and only on Android. The resulting executable works for me in local tests on Android 4.3 and Android 6.0, and continues to work on try.
Comment on attachment 8844921 [details] [diff] [review] build Android xpcshell as PIE Review of attachment 8844921 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/xpconnect/shell/moz.build @@ +50,5 @@ > 'xul.dll', > ] > > +if CONFIG['OS_TARGET'] == 'Android': > + LDFLAGS += ['-fPIE'] You don't need -fPIE, only -pie. With that said, considering https://developer.android.com/about/dashboards/index.html says there's only 2% of devices with < 4.1, is there a reason we simply don't enable pie globally for android builds (and drop support for < 4.1)? This would allow to get rid of the workaround we have in place to support both PIE and non-PIE for the plugin-container executable.
:snorp - Can you comment on dropping support for < 4.1?
Created attachment 8845529 [details] [diff] [review] build Android xpcshell as PIE Right you are - -fPIE is not needed here. Thanks. My read of bug 1316462 with respect to dropping support for < 4.1 is that we're thinking about it, but we're not there yet, and it might happen soon, but it might not. In case it doesn't happen soon, I'd like to proceed with this patch since a few people have complained to me recently about having trouble with xpcshell on Android 5+.
Yeah I think we can unconditionally build xpcshell wth PIE, but let's hold off on the other stuff for now.
Attachment #8845529 - Flags: review?(mh+mozilla) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/9632421756fa Build android xpcshell as position independent executable; r=glandium
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in before you can comment on or make changes to this bug.