http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58507

            Bug ID: 58507
           Summary: Incorrect parsing of `-mmcu=msp430*`
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: errordeveloper at gmail dot com
                CC: dj at redhat dot com, nickc at redhat dot com

% cat test.c
#include <msp430fr5739.h>

int main() { return 0; };

% msp430-elf-gcc -mmcu=msp430fr5739 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
error: /tmp/cc5edjEZ.o uses MSP430X instructions but
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/lib/crt0.o
uses MSP430
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
failed to merge target specific data of file /tmp/cc5edjEZ.o
collect2: error: ld returned 1 exit status


Checking this reviles a dull parameter parsing bug:

% msp430-elf-gcc -mmcu=msp430 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:11, flags 0x00000010:

% msp430-elf-gcc -mmcu=msp430x test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:430X, flags 0x00000010:

% msp430-elf-gcc -mmcu=msp430fr5739 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:430X, flags 0x00000010:

Here are the revision ID's for your reference:

gcc 25bd6b06e5c81ff8c97d6671651442305a2cbbb2
newlib 090b27c6ed560767408293f185aa313eeef23d74
binutils e1926926db9154828b02a83c3d094ba6c39247e0
gdb 7.6.50.20130921
msp430mcu d5dd733e674dfd80781669a98ef85fd57526ce47
mspdebug 0.22

The compilation was done according to:
http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Install:redhat

A x86 binary can be found here:
https://s3.amazonaws.com/com.xively.packages/msp430-elf-21092013-0.txz

Reply via email to