Skip to content

Make Rust cross-compiler for i686-unknown-linux-gnu target fails #15228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Virtlink opened this issue Jun 27, 2014 · 7 comments
Closed

Make Rust cross-compiler for i686-unknown-linux-gnu target fails #15228

Virtlink opened this issue Jun 27, 2014 · 7 comments

Comments

@Virtlink
Copy link

I'm trying to build Rust to cross-compile to i686-unknown-linux-gnu, but I keep running into errors.

On a fresh installation of Linux Mint 17 Qiana MATE 64-bit (in VirtualBox), I execute the following series of commands (from here):

sudo apt-get install g++
sudo apt-get install curl
cd
mkdir src
cd src
git clone https://github.com/rust-lang/rust.git
cd rust
./configure --target=i686-unknown-linux-gnu --llvm-root=/usr
make rustc-stage1

Then I get this error:

opening snapshot dl/rust-stage0-2014-06-21-db9af1d-linux-x86_64-bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae.tar.bz2
extracting rust-stage0/bin/rustc
make: *** No rule to make target `x86_64-unknown-linux-gnu/rt/arch/x86_64/morestack.o', needed by `x86_64-unknown-linux-gnu/rt/libmorestack.a'.  Stop.

I'm using:

  • g++ 4.8.2-19ubuntu
  • clang++ not installed
  • python 2.7.6
  • perl 5.18.2
  • make 3.81
  • curl 7.35.0
  • git 1.9.1

As kwantam pointed out, I needed to remove --llvm-root.

Then I got another error:

make[1]: Entering directory `/home/lennard/src/rust/src/compiler-rt'
  MKDIR:     /home/lennard/src/rust/i686-unknown-linux-gnu/rt/compiler-rt/triple/builtins/i386/SubDir.lib__builtins
  COMPILE:   triple/builtins/i386: /home/lennard/src/rust/src/compiler-rt/lib/builtins/absvdi2.c
In file included from /usr/include/limits.h:25:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:168,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:34,
                 from /home/lennard/src/rust/src/compiler-rt/lib/builtins/int_lib.h:44,
                 from /home/lennard/src/rust/src/compiler-rt/lib/builtins/absvdi2.c:15:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
                         ^
compilation terminated.
make[1]: *** [/home/lennard/src/rust/i686-unknown-linux-gnu/rt/compiler-rt/triple/builtins/i386/SubDir.lib__builtins/absvdi2.o] Error 1
make[1]: Leaving directory `/home/lennard/src/rust/src/compiler-rt'
make: *** [i686-unknown-linux-gnu/rt/libcompiler-rt.a] Error 2

To solve this, I had to do sudo apt-get install libc6-dev-i386.


Then I got another error:

checking whether utrace(2) is compilable... no
checking whether valgrind is compilable... no
checking whether a program using __builtin_ffsl is compilable... no
checking whether a program using ffsl is compilable... no
configure: error: Cannot build without ffsl(3) or __builtin_ffsl()
make: *** [i686-unknown-linux-gnu/rt/jemalloc/lib/libjemalloc_pic.a] Error 1

It is a mistake on my end? Or am I missing some other dependency?

@kwantam
Copy link
Contributor

kwantam commented Jun 27, 2014

You probably do not want to give the --llvm-root switch to the build system. At the very least, I'd try it without and confirm that this is still an issue.

@Virtlink
Copy link
Author

Right! I've removed --llvm-root and that particular error is gone. I still get other errors:

checking whether a program using __builtin_ffsl is compilable... no
checking whether a program using ffsl is compilable... no
configure: error: Cannot build without ffsl(3) or __builtin_ffsl()
make: *** [i686-unknown-linux-gnu/rt/jemalloc/lib/libjemalloc_pic.a] Error 1

From what I gather __builtin_ffsl() should be part of any GCC compiler. I haven't touched my compiler, it's the one that came with the fresh Linux installation. How do I solve this?

@alexcrichton
Copy link
Member

This looks like more of a jemalloc building bug than a rust bug, have you tried reporting it upstream to them?

@Virtlink
Copy link
Author

I created a jemalloc issue.

@xldenis
Copy link
Contributor

xldenis commented Aug 2, 2014

I've been getting a different, but related issue trying to compile the i686-unknown-linux-gnu on OS X.

rust/src/rt/arch/i386/morestack.S:93:18: error: unable to emit symbol attribute
 .private_extern ___morestack
                 ^
make: *** [i686-unknown-linux-gnu/rt/arch/i386/morestack.o] Error 1

@thestinger
Copy link
Contributor

This has been marked as fixed upstream and Rust is now using the jemalloc version with the relevant commit.

@cmsd2
Copy link

cmsd2 commented Jan 10, 2015

i think the symbol attribute error xldenis saw is bug #16259

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 17, 2023
Implement recursion in mir interpreter without recursion

This enables interpreting functions with deep stack + profiling. I also applied some changes to make it faster based on the profiling result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants