Discussion:
[rust-dev] Rust universal build issues
Aljaž Srebrnič
2014-07-17 08:17:16 UTC
Permalink
Hello list,
I?m ono of the maintainers of rust on MacPorts, and I found some issues with the build. The script in src/compiler-rt/make/platform/clang_darwin.mk has a comment on line 135:

# Forcibly strip off any -arch, as that totally breaks our universal support.

Now, it looks like that script strips any -arch flags and adds -arch flags for *all* the supported architectures by the host compiler. As a result, some of the files are compiled as x86_64 only (the original arch flags) and some as a fat binary (i386 and x86_64). In stage3, linking fails:

[?]
error: ar 'x' '/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a' failed with: exit code: 1
note: stdout ---

note: stderr ---
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a: Inappropriate file type or format
[?]

I saw a env variable, $RC_SUPPORTED_ARCHS and tried to set RC_SUPPORTED_ARCHS=?x86_64?, but to no avail. How can I instruct compiler-rt to build for my architecture only?

Thanks,
Alja?

--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
Brian Anderson
2014-07-17 18:08:12 UTC
Permalink
Thanks for your work on MacPorts. Did you use any flags to configure or
arguments to make? What version of OS X, clang/gcc?
Post by Aljaž Srebrnič
Hello list,
# Forcibly strip off any -arch, as that totally breaks our universal support.
I don't believe the build system is supposed to build stage3 on OS X.
Seems suspicious.
Post by Aljaž Srebrnič
[?]
error: ar 'x' '/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a' failed with: exit code: 1
note: stdout ---
note: stderr ---
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a: Inappropriate file type or format
[?]
I saw a env variable, $RC_SUPPORTED_ARCHS and tried to set RC_SUPPORTED_ARCHS=?x86_64?, but to no avail. How can I instruct compiler-rt to build for my architecture only?
Thanks,
Alja?
--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
Aljaž Srebrnič
2014-07-18 22:43:56 UTC
Permalink
Thanks for your work on MacPorts. Did you use any flags to configure or arguments to make? What version of OS X, clang/gcc?
Yes, sorry, I?m building this on OS X 10.9.4 with system clang (5.1). After further inspection, I can build it with target and host set to x86_64-apple-darwin, but when I try to add i686-apple-darwin to the target list, the build fails. Is compiling for 32 bit on 64 bit host still supported?
Post by Aljaž Srebrnič
Hello list,
# Forcibly strip off any -arch, as that totally breaks our universal support.
I don't believe the build system is supposed to build stage3 on OS X. Seems suspicious.
I could be wrong about the stage number, I just inferred because the stage3 directory had no files in it.
Post by Aljaž Srebrnič
[?]
error: ar 'x' '/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a' failed with: exit code: 1
note: stdout ---
note: stderr ---
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a: Inappropriate file type or format
[?]
I saw a env variable, $RC_SUPPORTED_ARCHS and tried to set RC_SUPPORTED_ARCHS=?x86_64?, but to no avail. How can I instruct compiler-rt to build for my architecture only?
Thanks,
Alja?
--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
Brian Anderson
2014-07-18 22:57:06 UTC
Permalink
Post by Aljaž Srebrnič
Thanks for your work on MacPorts. Did you use any flags to configure or arguments to make? What version of OS X, clang/gcc?
Yes, sorry, I?m building this on OS X 10.9.4 with system clang (5.1). After further inspection, I can build it with target and host set to x86_64-apple-darwin, but when I try to add i686-apple-darwin to the target list, the build fails. Is compiling for 32 bit on 64 bit host still supported?
Yes, it should work. I suspect there is some interaction with your
(relatively new) toolchain that nobody has seen before.
Post by Aljaž Srebrnič
Post by Aljaž Srebrnič
Hello list,
# Forcibly strip off any -arch, as that totally breaks our universal support.
I don't believe the build system is supposed to build stage3 on OS X. Seems suspicious.
I could be wrong about the stage number, I just inferred because the stage3 directory had no files in it.
Post by Aljaž Srebrnič
[?]
error: ar 'x' '/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a' failed with: exit code: 1
note: stdout ---
note: stderr ---
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_dports_lang_rust/rust/work/rust-0.11.0/i686-apple-darwin/rt/libjemalloc.a: Inappropriate file type or format
[?]
I saw a env variable, $RC_SUPPORTED_ARCHS and tried to set RC_SUPPORTED_ARCHS=?x86_64?, but to no avail. How can I instruct compiler-rt to build for my architecture only?
Thanks,
Alja?
--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
Rust-dev at mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
Alja? Srebrni? a.k.a g5pw
My public key: http://bit.ly/g5pw_pubkey
Loading...