Hi Bernard,
Yes I would agree compiling msp430-gcc is complex,
there are quite a few pieces that all need to hang together to make it
work, and many of the tools are changing also. A lot of the problem is
the support for the ever increasing number of devices in all parts of
the tool chain (binutils, gcc, msp430-libc, gdb and gdbproxy are all
affected by new devices).
I did also find that the patches for binutils 2.18 didn't work for 2.19,
although I think I have a working build for 2.19 now.
The
windows build is done using the makefiles and scrips in the packaging
directory, this way the source for the tools is controlled and its a
package we know works.
Yes there is a problem with binutils-2.18
and a modern compiler because its header files specify that the return
value should be checked, I found that this had been fixed in
bintuils-2.19. Attached is a patch that fixes this problem for
binutils-2.18
Looks like we have to roll some of this into the packaging directory, and get
patches working for 2.19.
I had to use make MAKEINFO=/usr/bin/makeinfo to get binutils-2.18 to find
makeinfo on ubuntu
Hope that helps,
Peter
________________________________
From: Bernard Mentink <[email protected]>
To: [email protected]; GCC for MSP430 - http://mspgcc.sf.net
<[email protected]>
Sent: Monday, 15 December, 2008 8:32:31 AM
Subject: Re: [Mspgcc-users] msp430-libc compile problems.
Hi Peter,
Compiling the tools is becoming a real pain. I have never had trouble like this
compiling mspgcc in the past ( a year or two ago..).
I have applied the patches fine to a fresh get of binutils-2.18 (these patches
would not work for 2.19).
However when I tried to compile 2.18 I now get this error.
---------------------------------- error
------------------------------------------
gcc -DHAVE_CONFIG_H -I. -I.././binutils -I. -D_GNU_SOURCE -I. -I.././binutils -I
../bfd -I.././binutils/../bfd -I.././binutils/../include -DLOCALEDIR="\"/usr/loc
al/msp430/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c .././binutils/objdu
mp.c
cc1: warnings being treated as errors
.././binutils/objdump.c: In function â?~print_lineâ?T:
.././binutils/objdump.c:1143: error: ignoring return value of â?~fwriteâ?T, decl
ared with attribute warn_unused_result
make[4]: *** [objdump.o] Error 1
make[4]: Leaving directory `/home/bmentink/mspgcc/temp/binutils-2.18/binutils'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/bmentink/mspgcc/temp/binutils-2.18/binutils'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/bmentink/mspgcc/temp/binutils-2.18/binutils'
make[1]: *** [all-binutils] Error 2
make[1]: Leaving directory `/home/bmentink/mspgcc/temp/binutils-2.18'
make: *** [all] Error 2
--------------------------------------------------------------------------------------------------------------------------------
Any further ideas? Do I also have to patch the msp430-gcc compiler with the
appropriate files from the packages/patches directory?
It seems pretty bad to me that you can't build the tools with "released"
versions because of the "released" msp430-libc !!..
Cheers,
Bernie
bment...@laptop:~/mspgcc/temp/binutils-2.18$
--------------------------------------------------------------------------------------------------------------------------
On Sat, Dec 13, 2008 at 5:03 PM, Peter Jansen <[email protected]> wrote:
Hi Bernard,
> ... <snip>
> I have built the latest 3.4 version of msp-gcc as the
> devices supported by
> by 3.3 were even more limited.
> I had a look in the makefile of msp430-libc and there are
> heaps of devices there that are not in the compiler list.
Ok If you use binutils 2.18 (or 2.19) then you need to apply the patches in
http://mspgcc.cvs.sourceforge.net/viewvc/mspgcc/packaging/patches to get
support for the 2001 device.
You get get these files from cvs by,
cvs -z3 -d:pserver:[email protected]:/cvsroot/mspgcc co
packaging
apply these to the binutils tree,
eg
cd binutils-2.18
export PATCHES=../packaging/patches
patch -p1 <
$(PATCHES)/binutils-2.18-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch
patch -p1 < $(PATCHES)/binutils-2.18-msp430x24x-msp430x26x.patch
patch -p1 < $(PATCHES)/binutils-ld_scripts.patch
patch -p1 < $(PATCHES)/binutils-2.18-430X.patch
> What is the story here, do I need an even later version of
> the compiler? I have tried to compile the 4.1.1 version of msp-gcc but
> I am getting compile errors ... looks like it is not quite
> ready yet.
The version of gcc to use is 3.2.3 (as on the web page), gcc-4.x does not work,
3.2.3 is the only choice and is the one that the latest devices have been added
too.
Peter Jansen
Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=taglinediff -r -U 3 binutils-2.18-msp/binutils/cxxfilt.c binutils-2.18-msp1/binutils/cxxfilt.c
--- binutils-2.18-msp/binutils/cxxfilt.c 2007-08-07 05:55:10.000000000 +1000
+++ binutils-2.18-msp1/binutils/cxxfilt.c 2008-12-15 21:19:39.000000000 +1100
@@ -63,12 +63,12 @@
result = cplus_demangle (mangled_name + skip_first, flags);
if (result == NULL)
- printf (mangled_name);
+ printf ("%s", mangled_name);
else
{
if (mangled_name[0] == '.')
putchar ('.');
- printf (result);
+ printf ("%s", result);
free (result);
}
}
diff -r -U 3 binutils-2.18-msp/binutils/objdump.c binutils-2.18-msp1/binutils/objdump.c
--- binutils-2.18-msp/binutils/objdump.c 2008-12-15 21:01:28.000000000 +1100
+++ binutils-2.18-msp1/binutils/objdump.c 2008-12-15 21:18:03.000000000 +1100
@@ -1135,13 +1135,16 @@
print_line (struct print_file_list *p, unsigned int line)
{
const char *l;
+ size_t len;
--line;
if (line >= p->maxline)
return;
l = p->linemap [line];
- fwrite (l, 1, strcspn (l, "\n\r"), stdout);
- putchar ('\n');
+ /* Test fwrite return value to quiet glibc warning. */
+ len = strcspn (l, "\n\r");
+ if (len == 0 || fwrite (l, len, 1, stdout) == 1)
+ putchar ('\n');
}
/* Print a range of source code lines. */
diff -r -U 3 binutils-2.18-msp/gas/read.c binutils-2.18-msp1/gas/read.c
--- binutils-2.18-msp/gas/read.c 2007-08-07 05:59:51.000000000 +1000
+++ binutils-2.18-msp1/gas/read.c 2008-12-15 21:21:59.000000000 +1100
@@ -5628,14 +5628,20 @@
if (*input_line_pointer != ',')
{
if (default_prefix)
- asprintf (&label, "%s%s", default_prefix, name);
+ {
+ if (asprintf (&label, "%s%s", default_prefix, name) == -1)
+ as_fatal ("%s", xstrerror (errno));
+ }
else
{
char leading_char = bfd_get_symbol_leading_char (stdoutput);
/* Missing entry point, use function's name with the leading
char prepended. */
if (leading_char)
- asprintf (&label, "%c%s", leading_char, name);
+ {
+ if (asprintf (&label, "%s%s", default_prefix, name) == -1)
+ as_fatal ("%s", xstrerror (errno));
+ }
else
label = name;
}
diff -r -U 3 binutils-2.18-msp/gas/stabs.c binutils-2.18-msp1/gas/stabs.c
--- binutils-2.18-msp/gas/stabs.c 2007-08-29 03:19:36.000000000 +1000
+++ binutils-2.18-msp1/gas/stabs.c 2008-12-15 21:23:49.000000000 +1100
@@ -667,8 +667,9 @@
}
as_where (&file, &lineno);
- asprintf (&buf, "\"%s:F1\",%d,0,%d,%s",
- funcname, N_FUN, lineno + 1, startlabname);
+ if (asprintf (&buf, "\"%s:F1\",%d,0,%d,%s",
+ funcname, N_FUN, lineno + 1, startlabname) == -1)
+ as_fatal ("%s", xstrerror (errno));
input_line_pointer = buf;
s_stab ('s');
free (buf);
@@ -693,7 +694,8 @@
++label_count;
colon (sym);
- asprintf (&buf, "\"\",%d,0,0,%s-%s", N_FUN, sym, startlabname);
+ if (asprintf (&buf, "\"\",%d,0,0,%s-%s", N_FUN, sym, startlabname) == -1)
+ as_fatal ("%s", xstrerror (errno));
input_line_pointer = buf;
s_stab ('s');
free (buf);