Closed Bug 1338809 Opened 8 years ago Closed 8 years ago

Attempting to run xpcshell tests on Android 5+ fails with "error: only position independent executables (PIE) are supported."

Categories

(Firefox for Android Graveyard :: Testing, defect, P1)

All
Android
defect

Tracking

(firefox54 wontfix, firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: JanH, Assigned: gbrown)

References

Details

Attachments

(1 file, 1 obsolete file)

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: → 1238611
Priority: -- → P3
Assignee: nobody → gbrown
Priority: P3 → P1
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."
Attached patch build Android xpcshell as PIE (obsolete) — Splinter Review
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.
Attachment #8844921 - Flags: review?(mh+mozilla)
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.
Attachment #8844921 - Flags: review?(mh+mozilla)
:snorp - Can you comment on dropping support for < 4.1?
Flags: needinfo?(snorp)
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+.
Attachment #8844921 - Attachment is obsolete: true
Attachment #8845529 - Flags: review?(mh+mozilla)
Yeah I think we can unconditionally build xpcshell wth PIE, but let's hold off on the other stuff for now.
Flags: needinfo?(snorp)
Attachment #8845529 - Flags: review?(mh+mozilla) → review+
Pushed by gbrown@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/9632421756fa Build android xpcshell as position independent executable; r=glandium
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
See Also: → 1425381
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: