[Bug 936463] New: cross-avr-gcc5 seems to lack some required files
http://bugzilla.opensuse.org/show_bug.cgi?id=936463 Bug ID: 936463 Summary: cross-avr-gcc5 seems to lack some required files Classification: openSUSE Product: openSUSE Factory Version: 201505* Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: matz@suse.com Reporter: sbrabec@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- I just tried to use cross-avr-gcc5 to replace avr-gcc from CrossToolchain:avr. The package seems to be incomplete and it does not work well with cross-avr-binutils: 1) When trying to link, I get complain that as does not understand -mmcu=avr5. The reason is simple: avr-suse-linux-gcc-5 does not try to use avr-as, but it tries to use as from /usr/lib64/gcc/avr-suse-linux/5/as. It does not exist, and it tries standard /usr/bin/as. It surely does not understand -mmcu=avr5. The work-around is easy: ln -s /usr/bin/avr-as /usr/lib64/gcc/avr-suse-linux/5/as And the same for other binutils. 2) When I try to compile without arguments, I get: /usr/lib64/gcc/avr-suse-linux/5/ld: cannot find crtatmega168.o: Adresář nebo soubor neexistuje /usr/lib64/gcc/avr-suse-linux/5/ld: cannot find -lgcc /usr/lib64/gcc/avr-suse-linux/5/ld: cannot find -lm /usr/lib64/gcc/avr-suse-linux/5/ld: cannot find -lc /usr/lib64/gcc/avr-suse-linux/5/ld: cannot find -latmega168 When I try -nostdlib -nostdinc -B /opt/cross/avr/avr -L /opt/cross/avr/avr/lib, linker starts to work. But I get another problem: undefined reference to `__divmodhi4' Yes, avr-libc itself references __divmodhi4 in stdlib.h, but /usr/lib64/gcc/avr-suse-linux/5/cc1 seems to reference it as well.
From the both problems, I assume that at least libgcc.a and crt*.o files are missing. Probably much more libraries are missing there.
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c3
Andreas Färber
Assigning to Andreas, he's the AVR interested person.
Nope, I have no AVR boards nor do I use icecream. (I was working on non-icecream cross-compilers in home:a_faerber:epiphany and home:a_faerber:rx projects.) Isn't avr an 8-bit microcontroller, whereas Linux only runs on avr32? In that case avr-suse-linux might indeed be wrong, as Richard suggests. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c16
--- Comment #16 from Andreas Färber
Do I understand correctly, that we need a multi-stage cross build for the standard cross platform:
1) Native compiler. 2) Cross binutils. 3) Cross compiler stage 1. It can compile and link with -nostd*. 4) Cross glibc. 5) Cross compiler final. It can compile and link against glibc (either with -isystem or even without, depending on configuration).
As far as I understand, we are now trying to provide stage 1 compilers. It should already be able to link, otherwise cross-glibc could not be built.
Please take a look at my epiphany cross-compiler packages I pointed to earlier. They do exactly that, except that epiphany uses newlib. All the preparations for two-stage cross-compilers are already in gcc5; in my case I either need to review i686 newlib build or disable it so that we can submit Base:System newlib to openSUSE:Factory and only then can we enable it in devel:gcc. You'll run into a similar dependency issue if you build with avr-libc that I imagine is not in Factory today. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c20
--- Comment #20 from Andreas Färber
The problem is not AVR specific. ARM is affected as well.
1) When trying to link, I get complain: armv7hl-suse-linux-gnueabi-gcc-5 main.c -o main Assembler messages: Fatal error: invalid -march= option: `armv7-a'
Well, the problem is different here. Links are provided, but elsewhere.
For AVR, symlinks are missing completely. For ARMV7HL, symlinks exist, but they are in a directory that is not tested.
Provided: /usr/arm-suse-linux-gnueabi/bin/as
Expected: /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/5/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/5/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/5/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/5/../../../../armv7hl-suse-linux- gnueabi/bin/armv7hl-suse-linux-gnueabi/5/as /usr/lib64/gcc/armv7hl-suse-linux-gnueabi/5/../../../../armv7hl-suse-linux- gnueabi/bin/as
I've confirmed this in home:a_faerber:uclinux. My solution is to add symlinks /usr/<mytriplet>/bin/as -> /usr/bin/arm-suse-linux-gnueabi-as and /usr/bin/<mytriplet>-strip -> /usr/bin/arm-suse-linux-gnueabi-strip etc. The former is needed for cc1 not to fall back to literal "as", i.e. /usr/bin/as, whereas the latter seems to be for the -as to find its -strip tool. Will doing this conditionally be acceptable? %if "%{gcc_target_arch}" != "%{binutils_os}" ... %endif Unfortunately that still means we can have one sysroot only for multiple gcc toolchains reusing the same assembler. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c22
--- Comment #22 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c23
--- Comment #23 from Andreas Färber
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
Maine Rodger
http://bugzilla.opensuse.org/show_bug.cgi?id=936463
http://bugzilla.opensuse.org/show_bug.cgi?id=936463#c25
Stefan Brüns
As it works for me with some targets isn't it only a disconnect between the binutils and cross-gcc target triplets? There must be some configure magic to tell GCC not only about the build tools to use but about the tools to use in the installed system. --with-as/--with-ld might work here I guess? I really don't like the extra symlinks.
Or we want to forgo with the idea to have multiple cross toolchains for the "same" target (like armv6hl and armv7hl as they just differ in their set of default target options). Or we stop producing just a single cross-binutils package for them.
I also strongly prefer to have just one compiler for arm. Rationale: 1. cross-armv6hl-gcc and cross-armv7hl-gcc are essentially identical * same set of possible targets * both have "--with-float=hard" 2. everyone else uses an arm-<foo>-gnueabi triplet Only minor downside is a little bit of convenience, as one builds by default for the instruction set of the RPi1, the other one for everything else. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com