[rust-dev] Rust universal build issues

Aljaž Srebrnič g5pw at macports.org
Fri Jul 18 15:43:56 PDT 2014


On 17/lug/2014, at 20:08, Brian Anderson <banderson at mozilla.com> wrote:

> 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?

> 
> On 07/17/2014 01:17 AM, Aljaž Srebrnič wrote:
>> 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:
> 
> 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.

> 
>> 
>> […]
>> 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



More information about the Rust-dev mailing list