Summary: | sys-devel/crossdev: msp430 target needs more work: extra headers and linker scripts | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ladislav Laska <ladislav.laska> |
Component: | Current packages | Assignee: | Gentoo Crossdev team <crossdev> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | cJ-gentoo, crossdev, pr.gentoo-acct |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 627914 | ||
Attachments: |
msptest.c
support files ebuild updated msp430 GCC support files crossdev patch for adding an ebuild of system headers not provided by a libc |
Description
Ladislav Laska
2015-03-06 21:00:24 UTC
Created attachment 398262 [details]
msptest.c
Comment on attachment 398262 [details] msptest.c >/****************************************************************************** > * Filename: msptest.c > * > * Created: 2015/03/06 21:07 > * Author: Ladislav Láska > * e-mail: laska@kam.mff.cuni.cz > * > ******************************************************************************/ > >#include <msp430.h> > >int main() { > WDTCTL = WDTPW + WDTHOLD; > P1DIR |= 0xff; > P1OUT |= 0xff; > for (;;) { > __delay_cycles(100000); > P1OUT ^= 0xff; > } >} Tim should let me know what i need to fix ;) however, you should post the crossdev summary when filing related bugs. what does this show: $ qlist -Iv msp430 krakonos@ibex ~ $ qlist -Iv msp430 cross-msp430-elf/binutils-2.25 cross-msp430-elf/gcc-4.9.2 I'm not sure how to get more info from crossdev, the options don't say much. Maybe this could help?: ibex krakonos # crossdev -t msp430 -p * crossdev version: 20141030 * Host Portage ARCH: amd64 * Target Portage ARCH: * * Target System: msp430-elf * Stage: 3 (C compiler & libc) * ABIs: default * binutils: >=binutils-2.24.90 * gcc: >=gcc-4.9.1 * libc: >=newlib-2.1.0 * CROSSDEV_OVERLAY: /var/crossdev-overlay * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: (In reply to Ladislav Laska from comment #4) why don't you have cross-msp430-elf/newlib installed ? if you don't have a C library, then trying to use headers from it isn't going to work. did you unmerge it ? how exactly did you run crossdev the first time ? (In reply to SpanKY from comment #3) > Tim should let me know what i need to fix ;) Ah yes, I should probably revive msp430mcu and toss TI's generic tarball dump into some sort of snapshot format and fix up crossdev a bit. URLs for reference: TI's msp430 gcc homepage: http://www.ti.com/tool/msp430-gcc-opensource Linker scripts are under support files (or at this url): http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gcc-support-files.zip Well, I just installed it and nothing changed. I originally found this out on a friend's laptop, and then installed it on my server to test, with a -s1 switch. I want to keep my old toolchain on desktop, for work. Now I have: krakonos@ibex ~ $ qlist -Iv msp430 cross-msp430-elf/binutils-2.25 cross-msp430-elf/gcc-4.9.2 cross-msp430-elf/newlib-2.2.0.20150225 (In reply to SpanKY from comment #5) > (In reply to Ladislav Laska from comment #4) > > why don't you have cross-msp430-elf/newlib installed ? if you don't have a > C library, then trying to use headers from it isn't going to work. > > did you unmerge it ? how exactly did you run crossdev the first time ? (In reply to Ladislav Laska from comment #7) > Well, I just installed it and nothing changed. I thought my reply was clear. If not, currently you'll need to take the linker scripts from the tarball in comment #6, and drop them somewhere like /usr/msp430-elf/lib. I'll toss them in an ebuild soon to fix things. It was not. This fixes it, but I'll be looking forward for an ebuild. Thanks! (In reply to Ladislav Laska from comment #7) well, if you used the -s1 flag, you shouldn't be surprised when you don't have any C library headers. crossdev gave you what you asked for. i'll leave it to Tim whether he wants to punt this as INVALID or relabel it as generic msp430mcu support. Created attachment 419598 [details] support files ebuild indeed, I tried using crossdev to compile a msp430 target only to find that most of the header and ld files were missing. I installed the latest support files from the TI site (see ebuild) - the compiler worked but the linker borks up. >> Building proj.elf as target RELEASE qa.o: In function `.L23': qa.c:(.text.parse_user_input+0x246): warning: _stat is not implemented and will always fail /usr/libexec/gcc/msp430-elf/ld: proj.elf section `.text' will not fit in region `ROM' /usr/libexec/gcc/msp430-elf/ld: section __interrupt_vector_42 loaded at [000000000000ffd2,000000000000ffd3] overlaps section .text loaded at [00000000000087f0,000000000001299d] /usr/libexec/gcc/msp430-elf/ld: region `ROM' overflowed by 10984 bytes proj.o: In function `main': proj.c:(.text.startup.main+0x3a): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.startup.main+0x3e): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.o: In function `adc_read': proj.c:(.text.adc_read+0x6a): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.o: In function `.L41': proj.c:(.text.store_pkt+0x80): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.store_pkt+0xc4): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.store_pkt+0xda): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.store_pkt+0x106): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.o: In function `.L49': proj.c:(.text.store_pkt+0x340): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.o: In function `.L78': proj.c:(.text.schedule+0x3c): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.schedule+0x52): relocation truncated to fit: R_MSP430X_ABS16 against symbol `stat' defined in .text section in /usr/lib/gcc/msp430-elf/4.9.3/../../../../msp430-elf/lib/libnosys.a(stat.o) proj.c:(.text.schedule+0x5c): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status Makefile:89: recipe for target 'proj.elf' failed make: *** [proj.elf] Error 1 OK, I soon found out that default newlib generates code that is too big for most msp430 mcus out there. I will try to generate packages based on a tweaked 'nano' spec that resemble the mspgcc behaviour. http://pabigot.github.io/bsp430/msp430elf.html https://github.com/pabigot/bsp430/blob/next/maintainer/msp430-elf-build Re-assigning since I don't have any msp430 hardware on hand anymore. As of today, `crossdev -t msp430` doesn't finish successfully. I have a background task of taking a look at what crosstool-ng is doing (it works) to see what needs to be done for the toolchain to be viable. I saw that the FreeBSD port for the MSP430 toolchain: https://cgit.freebsd.org/ports/tree/devel/gcc-msp430-ti-toolchain/Makefile?id=1bf865fed5a69877b34d01b873ccac59a8ab9476 includes bits of newlib inside GCC's source tree when building GCC, but doing so doesn't seem mandatory. Of course, adding an msp430-gcc-support-files ebuild is part of the equation. (In reply to myself from comment #14) > As of today, `crossdev -t msp430` doesn't finish successfully. My bad, I hadn't noticed that newlib's ebuild is using the environment's CFLAGS for the cross-compiler, and it was quite populated due to my using distcc. Sorry for the noise. Will submit an updated ebuild for the TI support files. Created attachment 765321 [details]
updated msp430 GCC support files
Created attachment 765322 [details, diff]
crossdev patch for adding an ebuild of system headers not provided by a libc
Adding a patch for crossdev that installs the support files.
|