Ensure that cross compiler info is passed to GYP correctly #17449

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@mcoffin
Contributor
mcoffin commented Sep 22, 2014

Right now, libuv will always be built for the host system (at least when building on OSX) because the information about the cross compiler is never actually passed to GYP. I don't know how anybody has been managing to build cross compilers with this.

Note that, at least on OSX, there is a bug in GYP that will send clang flags to non-clang compilers and it will still attempt to use Xcode's libtool, so this doesn't completely fix the problem of cross-compiling on an OSX host, but it's a start.

mcoffin added some commits Sep 22, 2014
@mcoffin mcoffin Ensure that compiler environment is passed to gyp
this only affects libuv
650683f
@mcoffin mcoffin Copy GYP environment variables on iOS
bcc4ee0
@rust-highfive
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

@mcoffin
Contributor
mcoffin commented Sep 22, 2014

On second thought, it might be easier to switch over to using the autotools build system with something like this:
$(S)src/libuv/configure --disable-shared --enable-static --host=$(1) --disable-dtrace

Thoughts?

@alexcrichton
Member

We currently don't want to pick up a dependency on autotools, and libuv doesn't check in the configure script by default.

I'm curious, but what makes you think that libuv is always build for the host architecture? We have a number of cross-compiling bots which cross architectures quite frequently (even to android!). Is that because we "cross compile" with -m32 and -m64?

@mcoffin
Contributor
mcoffin commented Sep 22, 2014

Well, when I did configure with --target=arm-unknown-linux-gnueabi, then run a make, in the $BUILD_DIR/arm-unknown-linux-gnueabi/rt/libuv folder, in libuv.target.mk, CC.target = clang and CXX.target = clang++. After this edit, it correctly sets CC.target and CXX.target without harming CC.host and CXX.host.

EDIT: My host system is OSX, hence clang on the host, but my arm-linux-gnueabi toolchain is GNU.

@alexcrichton
Member

Ah interesting! Sounds good to me then, thanks!

@bors
Contributor
bors commented on bcc4ee0 Sep 23, 2014

saw approval from alexcrichton
at mcoffin@bcc4ee0

Contributor
bors replied Sep 23, 2014

merging mcoffin/rust/master = bcc4ee0 into auto

Contributor
bors replied Sep 23, 2014

mcoffin/rust/master = bcc4ee0 merged ok, testing candidate = b6ab780

Contributor
bors replied Sep 24, 2014

saw approval from alexcrichton
at mcoffin@bcc4ee0

Contributor
bors replied Sep 24, 2014

merging mcoffin/rust/master = bcc4ee0 into auto

Contributor
bors replied Sep 24, 2014

mcoffin/rust/master = bcc4ee0 merged ok, testing candidate = 9cce2b7

Contributor
bors replied Sep 24, 2014

fast-forwarding master to auto = 9cce2b7

@bors bors added a commit that referenced this pull request Sep 23, 2014
@bors bors auto merge of #17449 : mcoffin/rust/master, r=alexcrichton
Right now, libuv will **always** be built for the host system (at least when building on OSX) because the information about the cross compiler is never actually passed to GYP. I don't know how anybody has been managing to build cross compilers with this.

Note that, at least on OSX, there is a bug in GYP that will send clang flags to non-clang compilers and it will still attempt to use Xcode's libtool, so this doesn't completely fix the problem of cross-compiling on an OSX host, but it's a start.
b6ab780
@bors bors added a commit that referenced this pull request Sep 24, 2014
@bors bors auto merge of #17449 : mcoffin/rust/master, r=alexcrichton
Right now, libuv will **always** be built for the host system (at least when building on OSX) because the information about the cross compiler is never actually passed to GYP. I don't know how anybody has been managing to build cross compilers with this.

Note that, at least on OSX, there is a bug in GYP that will send clang flags to non-clang compilers and it will still attempt to use Xcode's libtool, so this doesn't completely fix the problem of cross-compiling on an OSX host, but it's a start.
9cce2b7
@bors bors closed this Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment