unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* rustc problem
@ 2017-01-09 10:21 Ben Woodcroft
  2017-01-09 11:27 ` David Craven
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Woodcroft @ 2017-01-09 10:21 UTC (permalink / raw)
  To: help-guix

Hi,

I thought I'd try out rust today, just because. So I fired up Guix's 
rustc and tried to compile the example on https://www.rust-lang.org but 
alas:


$ ./pre-inst-env guix environment -C --ad-hoc rustc
[env]# rustc a.rs
error: linking with 
`/gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/bin/gcc` failed: 
exit code: 1
   |
   = note: 
"/gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/bin/gcc" 
"-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib" 
"a.0.o" "-o" "a" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib" 
"-Wl,-Bstatic" "-Wl,-Bdynamic" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f5a209a9.rlib" 
"/gnu/store/cvvbiqz761ka2p3dhkc4ip94arlj710i-rustc-1.14.0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f5a209a9.rlib" 
"-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" 
"-l" "rt" "-l" "util"
   = note: collect2: fatal error: cannot find 'ld'
compilation terminated.


This can be worked around by the following, but this seems non-ideal.

$ ./pre-inst-env environment -C rustc --ad-hoc rustc


Any ideas? Apologies if this is a known issue.

Thanks, ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rustc problem
  2017-01-09 10:21 rustc problem Ben Woodcroft
@ 2017-01-09 11:27 ` David Craven
  2017-01-09 11:42   ` Ben Woodcroft
  0 siblings, 1 reply; 6+ messages in thread
From: David Craven @ 2017-01-09 11:27 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: help-guix

Hi Ben,

The problem is that binutils isn't retained. This is due to:

(string-append "--default-ar=" gcc "/bin/ar").

This is a bug in the rustc package, which I haven't fixed yet.

To work around this issue you should be able to do

guix environment --ad-hoc binutils rustc

Thanks!

David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rustc problem
  2017-01-09 11:27 ` David Craven
@ 2017-01-09 11:42   ` Ben Woodcroft
  2017-01-09 13:48     ` David Craven
  2017-01-09 14:20     ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Woodcroft @ 2017-01-09 11:42 UTC (permalink / raw)
  To: David Craven; +Cc: help-guix

On 09/01/17 21:27, David Craven wrote:
> Hi Ben,
>
> The problem is that binutils isn't retained. This is due to:
>
> (string-append "--default-ar=" gcc "/bin/ar").
>
> This is a bug in the rustc package, which I haven't fixed yet.
>
> To work around this issue you should be able to do
>
> guix environment --ad-hoc binutils rustc

Not quite I'm afraid, I get

/gnu/store/p8543gm372dyff5p8mcq0phb09mq548z-profile/bin/ld: cannot find 
crti.o: No such file or directory

But OK. Thanks for the quick response.
ben

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rustc problem
  2017-01-09 11:42   ` Ben Woodcroft
@ 2017-01-09 13:48     ` David Craven
  2017-01-10  9:52       ` Ben Woodcroft
  2017-01-09 14:20     ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: David Craven @ 2017-01-09 13:48 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: help-guix

> Not quite I'm afraid, I get

> /gnu/store/p8543gm372dyff5p8mcq0phb09mq548z-profile/bin/ld: cannot find crti.o: No such file or directory

I have gcc-toolchain installed in my profile, this problem didn't
show. I submitted a patch that works with

guix environment --pure --ad-hoc rustc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rustc problem
  2017-01-09 11:42   ` Ben Woodcroft
  2017-01-09 13:48     ` David Craven
@ 2017-01-09 14:20     ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-01-09 14:20 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: help-guix

Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:

> On 09/01/17 21:27, David Craven wrote:
>> Hi Ben,
>>
>> The problem is that binutils isn't retained. This is due to:
>>
>> (string-append "--default-ar=" gcc "/bin/ar").
>>
>> This is a bug in the rustc package, which I haven't fixed yet.
>>
>> To work around this issue you should be able to do
>>
>> guix environment --ad-hoc binutils rustc
>
> Not quite I'm afraid, I get
>
> /gnu/store/p8543gm372dyff5p8mcq0phb09mq548z-profile/bin/ld: cannot
> find crti.o: No such file or directory

Maybe you need to add glibc in the environment and have $glibc/lib in
LIBRARY_PATH?

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rustc problem
  2017-01-09 13:48     ` David Craven
@ 2017-01-10  9:52       ` Ben Woodcroft
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Woodcroft @ 2017-01-10  9:52 UTC (permalink / raw)
  To: David Craven; +Cc: help-guix

On 09/01/17 23:48, David Craven wrote:
>> Not quite I'm afraid, I get
>> /gnu/store/p8543gm372dyff5p8mcq0phb09mq548z-profile/bin/ld: cannot find crti.o: No such file or directory
> I have gcc-toolchain installed in my profile, this problem didn't
> show. I submitted a patch that works with
>
> guix environment --pure --ad-hoc rustc

And that patch works as advertised. Thanks, problem solved.
ben

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-10  9:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 10:21 rustc problem Ben Woodcroft
2017-01-09 11:27 ` David Craven
2017-01-09 11:42   ` Ben Woodcroft
2017-01-09 13:48     ` David Craven
2017-01-10  9:52       ` Ben Woodcroft
2017-01-09 14:20     ` Ludovic Courtès

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).