unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Milind Kamble <milind.b.kamble@gmail.com>, help-guix@gnu.org
Subject: Re: microscheme fails to assemble BLINK.ms due to avr-gcc search path issue
Date: Fri, 28 Oct 2022 16:29:56 +0200	[thread overview]
Message-ID: <871qqshvh7.fsf@gmail.com> (raw)
In-Reply-To: <CAJpe+QJFTh0JCqzp-XnX83V94-xeN7Sqke98-+9rgW1ufqhFyw@mail.gmail.com>

Hi,

Sorry for the late reply.

On sam., 24 sept. 2022 at 18:53, Milind Kamble <milind.b.kamble@gmail.com> wrote:

> ~/tmp> microscheme -v -m UNO -d /dev/ttyACM0 -a ./BLINK.ms
> Microscheme 0.9.3, (C) Ryan Suchocki
>>> './BLINK.ms' found.
>>> Treeshaker: After 4 rounds: 89 globals purged! 22 bytes will be reserved.
>>> Remaining globals: [forever arduino-ports arduino-pins set-ddr set-pin high? output low? toggle led-pin loop ]
>>> 21 lines compiled OK
>>> Assembling...
> avr-ld: cannot find crtatmega328p.o: No such file or directory
> avr-ld: cannot find -lm
> avr-ld: cannot find -lc
> avr-ld: cannot find -latmega328p
> collect2: error: ld returned 1 exit status
>>> Warning: Command may have failed. (Exit code 256)
> avr-objcopy: 'BLINK.elf': No such file
>>> Warning: Command may have failed. (Exit code 256)
>>> Finished.
>
> To debug the issue, I cloned the microscheme from github and built the
> tool . Running that version also gave the exact same error. So after
> combing for hints online, I realized that perhaps the "-B" flag needs
> to be provided in the avr-gcc command launched by microscheme. And
> that worked.
> So the hack needed to make it work was
> avr-gcc -mmcu=atmega328p -B ~/.guix-profile/avr/lib/avr5 -o BLINK.elf BLINK.s
>
>
>  ~/.guix-profile/avr/lib/avr5 is a link to
> /gnu/store/r7kn43jwf4qj9lagj0pr4irzrwbvls0b-avr-libc-2.0.0/avr/lib/avr5
>   -- the key point being it points to a subdirectory of avr-libc
> But the default search path of avr-gcc does not include avr-libc in
> the store. Hence the -B hack works.
>
> The question is why do we need to specify -B explicitly. avr-libs
> should be included in the search path for avr-gcc.
> What am I missing?

Just a naive question because I know nothing about this topic, does it
work if more than lib/avr5 (e.g., avr25, avr, avr31, etc.) is provided
in the search path?


Cheers,
simon


      reply	other threads:[~2022-10-28 14:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 23:53 microscheme fails to assemble BLINK.ms due to avr-gcc search path issue Milind Kamble
2022-10-28 14:29 ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qqshvh7.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=milind.b.kamble@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).