[opensuse-factory] avr-gcc cannot find avr-as
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_Tumbl... 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@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
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_Tumbl... 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@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 08.12.2017 00:04, Simon Heimbach wrote:
Hi Frank,
this is a common problem on opensuse for years and maybe the maintainer will step up and solve it.
You are welcome to subit a fix to the packages. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am Freitag, 8. Dezember 2017, 00:04:01 CET schrieb Simon Heimbach:
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.
That workaround works for me, at least it compiles. Br, Frank -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* 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_Tumbl... repository.
When I try to compile a simple main.c with avr-gcc:
int main(void) { for(;;); }
Frank, thanks for bringing this up. I am in the process of fixing this for CrossToolchain:avr and the following symlink helped to work around this issue ln -sf /usr/avr/bin /usr/avr The actual bug is in cross-avr-binutils or cross-avr-gcc who couldn't agree on install pathes. Klaus -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Klaus Kaempf
I am in the process of fixing this for CrossToolchain:avr and the following symlink helped to work around this issue
ln -sf /usr/avr/bin /usr/avr
Argh, nonsense. The correct sequence is: # mkdir /opt/cross/avr # ln -sf /usr/avr/bin /opt/cross/avr Klaus -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am Freitag, 8. Dezember 2017, 09:13:01 CET schrieb Klaus Kaempf:
The correct sequence is:
# mkdir /opt/cross/avr # ln -sf /usr/avr/bin /opt/cross/avr
Not sure if that is ok since /opt/cross/avr/bin exists already. I tried the workaround from Simon and that works for me. Br, Frank -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Frank Kunz
[Dec 07. 2017 22:03]: 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_Tumbl... repository.
When I try to compile a simple main.c with avr-gcc:
int main(void) { for(;;); }
Frank, thanks for bringing this up.
I am in the process of fixing this for CrossToolchain:avr and the following symlink helped to work around this issue
ln -sf /usr/avr/bin /usr/avr
The actual bug is in cross-avr-binutils or cross-avr-gcc who couldn't agree on install pathes.
Maybe simply try cross-avr-gcc from Tumbleweed instead? That works fine for me, eventually CrossToolchain:avr is dead? Note that Tumbleweed lacks avr-libc (and eventually integration with cross-avr-gcc, didn't try pulling avr-libc from CrossToolchain:avr and mating with cross-avr-gcc). Richard.
Klaus
--
Richard Biener
* Richard Biener
Maybe simply try cross-avr-gcc from Tumbleweed instead?
I see cross-avr-gcc7 available in Tumbleweed. However, this fails compilation of avr-libc with ../../../libc/stdlib/strtol.c:33:10: fatal error: limits.h: No such file or directory Want a bug report ? ;-) Klaus -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Richard Biener
[Dec 08. 2017 09:14]: Maybe simply try cross-avr-gcc from Tumbleweed instead?
I see cross-avr-gcc7 available in Tumbleweed. However, this fails compilation of avr-libc with
../../../libc/stdlib/strtol.c:33:10: fatal error: limits.h: No such file or directory
Want a bug report ? ;-)
Well. cross-avr-gcc7 doesn't have a libc and limits.h is from libc so this is an issue in avr-libc. Or you need to set up a "proper" cross compilation staging with a -bootstrap package, see existing examples in the gcc7 package that use newlib (newlib also lives in devel:gcc so I'm fine with putting avr-libc into devel:gcc as well). I suppose cross-avr-gcc in CrossToolchain:avr sets up things in a "proper" way already. Richard.
Klaus
--
Richard Biener
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Richard Biener
[Dec 08. 2017 09:14]: Maybe simply try cross-avr-gcc from Tumbleweed instead?
I see cross-avr-gcc7 available in Tumbleweed. However, this fails compilation of avr-libc with
../../../libc/stdlib/strtol.c:33:10: fatal error: limits.h: No such file or directory
Want a bug report ? ;-)
Ok, it might be because we prune include-fixed: %if 0%{?gcc_icecream:1} # with the gcc_icecream setup fixincludes are for the build includes which # is wrong - get rid of them rm -rf $RPM_BUILD_ROOT/%{targetlibsubdir}/include-fixed %endif this prunes the gcc provided limits.h which ends up in include-fixed for some reason ... Richard.
Klaus
--
Richard Biener
On Fri, 8 Dec 2017, Richard Biener wrote:
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Richard Biener
[Dec 08. 2017 09:14]: Maybe simply try cross-avr-gcc from Tumbleweed instead?
I see cross-avr-gcc7 available in Tumbleweed. However, this fails compilation of avr-libc with
../../../libc/stdlib/strtol.c:33:10: fatal error: limits.h: No such file or directory
Want a bug report ? ;-)
Ok, it might be because we prune include-fixed:
%if 0%{?gcc_icecream:1} # with the gcc_icecream setup fixincludes are for the build includes which # is wrong - get rid of them rm -rf $RPM_BUILD_ROOT/%{targetlibsubdir}/include-fixed %endif
this prunes the gcc provided limits.h which ends up in include-fixed for some reason ...
Ok, it's not so easy. We would have a limits.h that would get substituted for a broken system ones but that won't work unless the system provides its own. So it really boils down to a "bootstrap" issue. avr-libc has to provide limits.h (and find it) during its build. Richard.
Richard.
Klaus
--
Richard Biener
* Richard Biener
Ok, it's not so easy. We would have a limits.h that would get substituted for a broken system ones but that won't work unless the system provides its own.
So it really boils down to a "bootstrap" issue. avr-libc has to provide limits.h (and find it) during its build.
Thanks for the investigation. But where would avr-libc get this file from ? It is not included in the avr-libc tarball. For cross-avr-gcc-5.4.0, it is provided by cross-avr-gcc. Neither cross-avr-gcc6 nor cross-avr-gcc7 seem to provide it. Klaus -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Richard Biener
[Dec 08. 2017 10:12]: Ok, it's not so easy. We would have a limits.h that would get substituted for a broken system ones but that won't work unless the system provides its own.
So it really boils down to a "bootstrap" issue. avr-libc has to provide limits.h (and find it) during its build.
Thanks for the investigation.
But where would avr-libc get this file from ?
It is not included in the avr-libc tarball.
Where does avr-libc get its "includes" from? Does it end up installing a limits.h file in include/? Maybe it just generates it somehow?
For cross-avr-gcc-5.4.0, it is provided by cross-avr-gcc.
Yeah, but it's based on a "fixed" host one...
Neither cross-avr-gcc6 nor cross-avr-gcc7 seem to provide it.
... because we now remove those "fixed" host header files from the target include/ Richard.
Klaus
--
Richard Biener
* Richard Biener
Where does avr-libc get its "includes" from?
http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/include/
Does it end up installing a limits.h file in include/? Maybe it just generates it somehow?
I couldn't find any indication in this direction.
Neither cross-avr-gcc6 nor cross-avr-gcc7 seem to provide it.
... because we now remove those "fixed" host header files from the target include/
Can you please re-enable this for cross-avr-gcc ? Klaus -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 8 Dec 2017, Klaus Kaempf wrote:
* Richard Biener
[Dec 08. 2017 10:52]: Where does avr-libc get its "includes" from?
http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/include/
Does it end up installing a limits.h file in include/? Maybe it just generates it somehow?
I couldn't find any indication in this direction.
Neither cross-avr-gcc6 nor cross-avr-gcc7 seem to provide it.
... because we now remove those "fixed" host header files from the target include/
Can you please re-enable this for cross-avr-gcc ?
I have committed a candidate fix for gcc7 to devel:gcc, let's see
how things go ...
Note that for a fully functional avr toolchain we still need a
bootstrap package to be able to build avr-libc and then with
headers available build the avr gcc runtime (cross-avr-gcc doesn't have
any libgcc or libstdc++ or such).
Richard.
--
Richard Biener
participants (5)
-
Frank Kunz
-
Klaus Kaempf
-
Richard Biener
-
Simon Heimbach
-
Stefan Seyfried