Hi, Sorry for the late reply.
On sam., 24 sept. 2022 at 18:53, Milind Kamble <milind.b.kam...@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