The way android_tool_prefix is determined for ARM in autoconf/android.m4 is not future-proof

RESOLVED FIXED in Firefox 38

Status

()

Firefox for Android
Build Config & IDE Support
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Akos Kiss, Assigned: Akos Kiss)

Tracking

Trunk
Firefox 38
ARM
Android
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141125180439

Steps to reproduce:

config.{guess,sub} were updated to 2015-01-01 versions in servo/mozjs (a fork updated now-and-then) and then servo's buildbot tried to configure it

/home/servo/.cargo/git/checkouts/mozjs-2284529523a8d467/master/js/src/configure --enable-gczeal --target=arm-linux-androideabi --with-android-ndk=/home/servo/android-ndk-r10c/ --with-android-toolchain=/home/servo/ndk-toolchain/


Actual results:

configure failed with the following messages:

checking for /home/servo/ndk-toolchain//bin/linux-androideabi-gcc... /home/servo/ndk-toolchain//bin/linux-androideabi-gcc
checking for gcc... /home/servo/ndk-toolchain//bin/linux-androideabi-gcc
checking whether the C compiler (/home/servo/ndk-toolchain//bin/linux-androideabi-gcc -mandroid -fno-short-enums -fno-exceptions  -mandroid -L/home/servo/android-ndk-r10c//platforms/android-5/arch-arm/usr/lib -Wl,-rpath-link=/home/servo/android-ndk-r10c//platforms/android-5/arch-arm/usr/lib --sysroot=/home/servo/android-ndk-r10c//platforms/android-5/arch-arm -llog -Wl,--allow-shlib-undefined ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

It turned out that as configure was running
- config.sub rewrote the target "arm-linux-androideabi" specified on command line to "arm-unknown-linux-androideabi", and
- configure tried to determine android_tool_prefix by matching the pattern "arm-linux*-android*" against the rewritten target string,
- which did not succeed, and thus it took a default branch, which afterwards caused the error.

Some digging in the scripts revealed that the code that determines android_tool_prefix is originating from autoconf/android.m4. The pattern at https://mxr.mozilla.org/mozilla-central/source/build/autoconf/android.m4#42 cannot cope with the "unknown-" part in the target string.

Original discussion: https://github.com/servo/mozjs/pull/23


Expected results:

android_tool_prefix="arm-linux-androideabi", which would have happened if the pattern was "arm-*linux*-android*" (one asterisk in front of linux)
(Assignee)

Updated

3 years ago
OS: Windows 7 → Android
Hardware: x86_64 → ARM
(Assignee)

Comment 1

3 years ago
Note: Eventhough most of the user story is about a fork, the root cause exists/stems from here.

Updated

3 years ago
Component: Untriaged → Build Config & IDE Support
Product: Firefox → Firefox for Android
(Assignee)

Comment 2

3 years ago
Created attachment 8550210 [details] [diff] [review]
Proposed patch
Attachment #8550210 - Flags: review?(mh+mozilla)
Attachment #8550210 - Flags: review?(mh+mozilla) → review+
(Assignee)

Updated

3 years ago
Attachment #8550210 - Flags: checkin?(mh+mozilla)
Attachment #8550210 - Flags: checkin?(mh+mozilla)
For the sheriff who'd land this: this is trivial enough that a try is unnecessary.
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/fb1945202023
Assignee: nobody → akiss
Flags: in-testsuite-
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Thanks!
https://hg.mozilla.org/mozilla-central/rev/fb1945202023
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
You need to log in before you can comment on or make changes to this bug.