Mailinglist Archive: opensuse-factory (454 mails)

< Previous Next >
Re: [opensuse-factory] avr-gcc cannot find avr-as
Hi Frank,

this is a common problem on opensuse for years and maybe the maintainer
will step up and solve it.

This is a workaround:
place a script "avr-gcc" in ~/bin, chmod +x and paste:
-----------------------
#!/bin/sh

echo "avr-gcc wrapper..."
PATH=/usr/avr/bin:${PATH}
/opt/cross/bin/avr-gcc "$@"
-----------------------

You can leave out the echo of course. And maybe you have to vary the
location of avr-gcc (unlikely).

Let us know if it helps you.

Greetings, Simon




Am 07.12.2017 um 22:01 schrieb Frank Kunz:
Sorry, I'm not sure if that is the correct list for this issue, but I haven't
found a proper one.

I have installed the packages avr-libc, cross-avr-binutils and cross-avr-gcc
from the
http://download.opensuse.org/repositories/CrossToolchain:/avr/openSUSE_Tumbleweed/
repository.

When I try to compile a simple main.c with avr-gcc:

int main(void)
{
for(;;);
}

I get a
avr-gcc -o file main.c
as: unrecognized option '-mmcu=avr2'

when I run the command with strace I get:

stat("/opt/cross/libexec/gcc/avr/5.4.0/as", 0x7ffe2ea0b150) = -1 ENOENT (No
such file or directory)
stat("/opt/cross/libexec/gcc/avr/5.4.0/as", 0x7ffe2ea0b150) = -1 ENOENT (No
such file or directory)
stat("/opt/cross/libexec/gcc/avr/as", 0x7ffe2ea0b150) = -1 ENOENT (No such
file or directory)
stat("/opt/cross/lib/gcc/avr/5.4.0/as", 0x7ffe2ea0b150) = -1 ENOENT (No such
file or directory)
stat("/opt/cross/lib/gcc/avr/as", 0x7ffe2ea0b150) = -1 ENOENT (No such file
or directory)
stat("/opt/cross/lib/gcc/avr/5.4.0/../../../../avr/bin/avr/5.4.0/as",
0x7ffe2ea0b150) = -1 ENOENT (No such file or directory)
stat("/opt/cross/lib/gcc/avr/5.4.0/../../../../avr/bin/as", 0x7ffe2ea0b150) =
-1 ENOENT (No such file or directory)

then the PATH is searched for an "as" executable and finally it ends up at
/usr/bin/as, which is the host assembler that does not understand the
'-mmcu=avr2' option.

The problem seems to be that the avr-binutils are installed under /usr/avr,
but the avr-gcc is under /opt/cross-avr. The "avr-" binaries are in the PATH,
but avr-gcc is not searching for them.

Is this a bug? Or is there a configuration to get that working?

Br,
Frank

--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
References