Closed Bug 1122111 Opened 8 years ago Closed 8 years ago

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


(Firefox Build System :: Android Studio and Gradle Integration, defect)

Not set


(Not tracked)



(Reporter: akiss, Assigned: akiss)



(1 file)

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 cannot cope with the "unknown-" part in the target string.

Original discussion:

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)
OS: Windows 7 → Android
Hardware: x86_64 → ARM
Note: Eventhough most of the user story is about a fork, the root cause exists/stems from here.
Component: Untriaged → Build Config & IDE Support
Product: Firefox → Firefox for Android
Attached patch Proposed patchSplinter Review
Attachment #8550210 - Flags: review?(mh+mozilla)
Attachment #8550210 - Flags: review?(mh+mozilla) → review+
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
Assignee: nobody → akiss
Flags: in-testsuite-
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 38 → mozilla38
You need to log in before you can comment on or make changes to this bug.