liballoc_malloc.rlib(lib_a-malloc.o): file class ELFCLASS32 incompatible with ELFCLASS64
Created by: ArrogantWombaticus
Reproduction: [describe how you are able to reproduce ("trigger") this bug/issue.] make all using ARCH?=x86_64 in the Makefile, I have tried to back trace through the repo but I can't find where this is being generated from that is making the output i386.
Expected behavior: [describe the behavior you would expect the repro to yield.] Would expect make all to create a working build and then to boot into Virtualbox using make Virtualbox.
Actual behavior: [describe the actual behavior, which is presented through the repro.].
make virtualbox
mkdir -p initfs/bin/
RUST_BACKTRACE=1 rustc --target=x86_64-unknown-redox.json -L build/x86_64-unknown-redox/debug -C no-prepopulate-passes -C no-stack-check -C opt-level=2 -Z no-landing-pads -A dead_code -C lto --crate-type bin -o initfs/bin/init crates/init/main.rs
error: linking with cc
failed: exit code: 1
note: "cc" "-m64" "-nostdlib" "-static" "-L" "/usr/local/lib/rustlib/x86_64-unknown-redox.json/lib" "initfs/bin/init.0.o" "-o" "initfs/bin/init" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "build/x86_64-unknown-redox/debug" "-L" "/usr/local/lib/rustlib/x86_64-unknown-redox.json/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/rustc.D7GHwEH7JShV/libstd.rlib" "/tmp/rustc.D7GHwEH7JShV/libsystem.rlib" "/tmp/rustc.D7GHwEH7JShV/libcollections.rlib" "/tmp/rustc.D7GHwEH7JShV/liballoc.rlib" "/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib" "/tmp/rustc.D7GHwEH7JShV/librand.rlib" "/tmp/rustc.D7GHwEH7JShV/librustc_unicode.rlib" "/tmp/rustc.D7GHwEH7JShV/libcore.rlib"
note: /usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-malloc.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-mallocr.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-memcmp.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-mlock.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-realloc.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-reallocr.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-sbrkr.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(process.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(common.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(file.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-calloc.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-callocr.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-execl.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-exit.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-freer.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-impure.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-memmove.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-memset.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-reent.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file
/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-__call_atexit.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-environ.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: /tmp/rustc.D7GHwEH7JShV/liballoc_malloc.rlib(lib_a-malloc.o): file class ELFCLASS32 incompatible with ELFCLASS64
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
error: aborting due to previous error Makefile:337: recipe for target 'initfs/bin/init' failed make: *** [initfs/bin/init] Error 101
Build information: [output of rustc -V
, git rev-parse HEAD
, qemu-i386 -version
, uname -a
, etc.]
rustc -V
rustc 1.11.0-dev (20183f498 2016-07-03)
git rev-parse HEAD
e2b5a299
uname -a
Linux masked 4.6.0-7-generic #8-Ubuntu SMP Fri Jun 3 15:08:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cargo --version
cargo 0.12.0-nightly (5716f32 2016-06-29)
virtualbox/yakkety,now 5.0.24-dfsg-2 amd64 [installed]
Blocking/related: [issues or PRs blocking or being related to this issue.]
Misc: [optional: for other relevant information that should be known or cannot be described in the other fields.] i386 build works fine but the x86_64 build keeps failing.
Sorry to keep submitting these issues, I have tried to backtrace the files to find where it is building i386 instead of x86_64 but I can't find it.
If the above does not fit the nature of the issue feel free to modify it.