Skip to content

Cross compiling with --enable-ccache does not work #13562

Closed
@alexcrichton

Description

@alexcrichton

If you enable ccache when doing a cross compile, you get this error:

$ make VERBOSE=1    
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples i686-unknown-linux-gnu x86_64-unknown-linux-gnu
cfg: target triples i686-unknown-linux-gnu x86_64-unknown-linux-gnu
cfg: non-build host triples i686-unknown-linux-gnu
cfg: non-build target triples i686-unknown-linux-gnu
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for i686-unknown-linux-gnu is i386
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for i686-unknown-linux-gnu is unknown-linux-gnu
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: using ccache gcc
cfg: enabling valgrind (CFG_ENABLE_VALGRIND)
cfg: no pdflatex found, deferring to xelatex
cfg: no xelatex found, deferring to lualatex
cfg: no lualatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: no llnextgen found, omitting grammar-verification
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "warning: removing previous" \'liblibc-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "warning: removing previous" \'liblibc-*.rlib\' "libraries:" $MATCHES; rm $MATCHES ; fi
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/alex/code/rust4/x86_64-unknown-linux-gnu/stage1/lib"   x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1  -O --cfg rtopt --cfg debug -C prefer-dynamic --target=i686-unknown-linux-gnu -C linker=ccache g++ -C ar=ar   -D warnings -L "i686-unknown-linux-gnu/rt" -L "/home/alex/code/rust4/i686-unknown-linux-gnu/llvm/Release+Asserts/lib" -L "/usr/lib/gcc/x86_64-linux-gnu/4.8/" --out-dir x86_64-unknown-linux-gnu/stage1/lib/rustlib/i686-unknown-linux-gnu/lib /home/alex/code/rust4/src/liblibc/lib.rs
error: multiple input filenames provided

The reason for this is that the command line has -C linker=ccache g++ and rustc then interprets g++ as an input file. Note that quoting also doesn't solve the problem because "ccache g++" is not a binary on the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions