Skip to content

"ar" invocation failure for android build atop OS X #11229

Closed
@pnkfelix

Description

@pnkfelix

My best attempt today to try to build a rustc targetting Android, based on the instructions at building for android

This is using the OS X android-ndk-r9c

Configure invocation:
../configure --target=arm-linux-androideabi --android-cross-path=$HOME/opt/ndk_standalone --prefix=~/opt/rust-droid

Build invocation:
time remake -j1 --trace

Failing rustc invocation:

% x86_64-apple-darwin/stage2/bin/rustc --cfg stage2  -O --cfg rtopt --cfg debug -Z no-debug-borrows --target=arm-linux-androideabi --android-cross-path=/Users/fklock/opt/ndk_standalone -D warnings --out-dir x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib /Users/fklock/Dev/Mozilla/rust.git/src/libstd/lib.rs
error: ar r x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd-04ff901e-0.9-pre.rlib failed with: exit code: 1
note: stdout ---

note: stderr ---
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/lib.rs:441

More elaborate Failure Output from make invocation itself (when debugging via remake)

...
Invoking recipe from /Users/fklock/Dev/Mozilla/rust.git/mk/target.mk:188 to update target `x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so'.
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo  compile_and_link: x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
compile_and_link: x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
MATCHES=""; if [ -n "$MATCHES" ] ; then rm $MATCHES ; fi
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
MATCHES="x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib//libstd-04ff901e-0.9-pre.rlib"; if [ -n "$MATCHES" ] ; then rm $MATCHES ; fi
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
x86_64-apple-darwin/stage2/bin/rustc --cfg stage2  -O --cfg rtopt --cfg debug -Z no-debug-borrows --target=arm-linux-androideabi --android-cross-path=/Users/fklock/opt/ndk_standalone -D warnings --out-dir x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib /Users/fklock/Dev/Mozilla/rust.git/src/libstd/lib.rs && touch x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
error: ar r x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd-04ff901e-0.9-pre.rlib failed with: exit code: 1
note: stdout ---

note: stderr ---
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/lib.rs:441
/Users/fklock/Dev/Mozilla/rust.git/mk/target.mk:188: *** [x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so] Error 101

#0  x86_64-apple-darwin/stage2/lib/rustc/arm-linux-androideabi/lib/libstd.so at /Users/fklock/Dev/Mozilla/rust.git/mk/target.mk:188
#1  all-target-arm-linux-androideabi-host-x86_64-apple-darwin at /Users/fklock/Dev/Mozilla/rust.git/objdir-optdroid/Makefile:633
#2  all at /Users/fklock/Dev/Mozilla/rust.git/objdir-optdroid/Makefile:641
Command-line invocation:
    "/Users/fklock/opt/remake/bin/remake -j1 --trace"

real    6m20.398s
user    5m32.640s
sys 0m30.859s

Compilation exited abnormally with code 2 at Mon Dec 30 21:15:18

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-androidOperating system: AndroidO-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions