* Re: 05/06: gnu: rust: Don't build for "native" arch on ARM.
[not found] ` <20180416175952.9458420373@vcs0.savannah.gnu.org>
@ 2018-04-16 20:05 ` Mark H Weaver
2018-04-17 7:17 ` Danny Milosavljevic
2018-04-17 20:49 ` Joshua Branson
0 siblings, 2 replies; 4+ messages in thread
From: Mark H Weaver @ 2018-04-16 20:05 UTC (permalink / raw)
To: Efraim Flashner, Danny Milosavljevic; +Cc: guix-devel
Hi Efraim and Danny,
dannym@scratchpost.org (Danny Milosavljevic) writes:
> dannym pushed a commit to branch master
> in repository guix.
>
> commit 67ca98ec7818f5b63fe041bfee4ef10826635685
> Author: Efraim Flashner <efraim@flashner.co.il>
> Date: Thu Mar 22 09:14:53 2018 +0200
>
> gnu: rust: Don't build for "native" arch on ARM.
>
> * gnu/packages/rust.scm (rust-1.23)<#:phases>[dont-build-native]: New phase.
> ---
> gnu/packages/rust.scm | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
> index 8c5abfc..0df649c 100644
> --- a/gnu/packages/rust.scm
> +++ b/gnu/packages/rust.scm
> @@ -351,6 +351,12 @@ safety and thread safety guarantees.")
> (substitute-keyword-arguments (package-arguments rust-1.19)
> ((#:phases phases)
> `(modify-phases ,phases
> + (add-after 'unpack 'dont-build-native
> + (lambda _
> + ;; XXX: Revisit this when we use gcc 6.
> + (substitute* "src/binaryen/CMakeLists.txt"
> + (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
> + #t))
> (add-after 'patch-tests 'patch-cargo-tests
> (lambda _
> (substitute* "src/tools/cargo/tests/build.rs"
If it would be beneficial, you might consider using gcc-7 to compile
'rust', by adding 'gcc-7' to native-inputs. We're already using gcc-7
to compile a few other packages, including linux-libre on x86_64.
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 05/06: gnu: rust: Don't build for "native" arch on ARM.
2018-04-16 20:05 ` 05/06: gnu: rust: Don't build for "native" arch on ARM Mark H Weaver
@ 2018-04-17 7:17 ` Danny Milosavljevic
2018-04-17 7:45 ` Efraim Flashner
2018-04-17 20:49 ` Joshua Branson
1 sibling, 1 reply; 4+ messages in thread
From: Danny Milosavljevic @ 2018-04-17 7:17 UTC (permalink / raw)
To: Mark H Weaver; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
Hi Mark,
On Mon, 16 Apr 2018 16:05:04 -0400
Mark H Weaver <mhw@netris.org> wrote:
> If it would be beneficial, you might consider using gcc-7 to compile
> 'rust', by adding 'gcc-7' to native-inputs. We're already using gcc-7
> to compile a few other packages, including linux-libre on x86_64.
Yeah, it would be possible.
Rust right now has only limited C++ FFI - so I guess the risk of having
a gcc-7 Rust dlopen'ing a gcc-4 library with incompatible C++ classes/
templates in it is low. (that stuff has been a nightmare to debug in
my working life and I'd rather not repeat it)
I had no compatibility problems with C FFI - so we are covered here.
So all in all we can do it - and let's do it. But I've just pushed
a large update for Rust. Let's have it built and see what else
breaks on other architectures first - before we change more.
Also, AFAIK "-march=native" autodetects the CPU in the build machine
and then optimizes for exactly that CPU. Arguably that's not what
we want in general.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 05/06: gnu: rust: Don't build for "native" arch on ARM.
2018-04-17 7:17 ` Danny Milosavljevic
@ 2018-04-17 7:45 ` Efraim Flashner
0 siblings, 0 replies; 4+ messages in thread
From: Efraim Flashner @ 2018-04-17 7:45 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]
On Tue, Apr 17, 2018 at 09:17:12AM +0200, Danny Milosavljevic wrote:
> Hi Mark,
>
> On Mon, 16 Apr 2018 16:05:04 -0400
> Mark H Weaver <mhw@netris.org> wrote:
>
> > If it would be beneficial, you might consider using gcc-7 to compile
> > 'rust', by adding 'gcc-7' to native-inputs. We're already using gcc-7
> > to compile a few other packages, including linux-libre on x86_64.
>
> Yeah, it would be possible.
>
<snip>
>
> Also, AFAIK "-march=native" autodetects the CPU in the build machine
> and then optimizes for exactly that CPU. Arguably that's not what
> we want in general.
This was my original intent with commenting out the '-march=native', it
just seemed that it cropped up as a build error more often with arm*
processors.
As far as aarch64 goes, it doesn't build fully in either case, but the
error I experienced with '-march=native' is gone when I add gcc-7 as a
native-input.
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 05/06: gnu: rust: Don't build for "native" arch on ARM.
2018-04-16 20:05 ` 05/06: gnu: rust: Don't build for "native" arch on ARM Mark H Weaver
2018-04-17 7:17 ` Danny Milosavljevic
@ 2018-04-17 20:49 ` Joshua Branson
1 sibling, 0 replies; 4+ messages in thread
From: Joshua Branson @ 2018-04-17 20:49 UTC (permalink / raw)
To: guix-devel
Mark H Weaver <mhw@netris.org> writes:
> Hi Efraim and Danny,
>
> dannym@scratchpost.org (Danny Milosavljevic) writes:
>
>> dannym pushed a commit to branch master
>> in repository guix.
>>
>> commit 67ca98ec7818f5b63fe041bfee4ef10826635685
>> Author: Efraim Flashner <efraim@flashner.co.il>
>> Date: Thu Mar 22 09:14:53 2018 +0200
>>
>> gnu: rust: Don't build for "native" arch on ARM.
>>
>> * gnu/packages/rust.scm (rust-1.23)<#:phases>[dont-build-native]: New phase.
>> ---
>> gnu/packages/rust.scm | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
>> index 8c5abfc..0df649c 100644
>> --- a/gnu/packages/rust.scm
>> +++ b/gnu/packages/rust.scm
>> @@ -351,6 +351,12 @@ safety and thread safety guarantees.")
>> (substitute-keyword-arguments (package-arguments rust-1.19)
>> ((#:phases phases)
>> `(modify-phases ,phases
>> + (add-after 'unpack 'dont-build-native
>> + (lambda _
>> + ;; XXX: Revisit this when we use gcc 6.
>> + (substitute* "src/binaryen/CMakeLists.txt"
>> + (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
>> + #t))
>> (add-after 'patch-tests 'patch-cargo-tests
>> (lambda _
>> (substitute* "src/tools/cargo/tests/build.rs"
>
> If it would be beneficial, you might consider using gcc-7 to compile
> 'rust', by adding 'gcc-7' to native-inputs. We're already using gcc-7
> to compile a few other packages, including linux-libre on x86_64.
Maybe this is a silly question, but I thought that gcc couldn't compile
rust code? I thought LLVM was the only compiler that could compile rust?
>
> Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-17 20:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180416175951.28242.65069@vcs0.savannah.gnu.org>
[not found] ` <20180416175952.9458420373@vcs0.savannah.gnu.org>
2018-04-16 20:05 ` 05/06: gnu: rust: Don't build for "native" arch on ARM Mark H Weaver
2018-04-17 7:17 ` Danny Milosavljevic
2018-04-17 7:45 ` Efraim Flashner
2018-04-17 20:49 ` Joshua Branson
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).