Hi Bmentink,

Seems to be something with compiling gcc-3.2.3 with gcc-4.3.2 (which I'm also 
using).

Apply the attached patch, this should fix the problem something like

cd gcc-3.2.3
patch -p1 < patch-gcc-3.2.3-collect2.diff

Ill try and put a modified collect2.c into the msp430-gcc tree.

Hope that helps,

Peter Jansen



> Hi all,
> 
> I have been following a procedure to build all the cross compiler tools for
> the msp430 and have everything compiled except for the compiler itself.
> 
> The procedure I used to build gcc was:
> ---------------------------------------------------------------
> wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.2.3/gcc-core-3.2.3.tar.bz2
> tar xjvf gcc-core-3.2.3.tar.bz2
> [sudo apt-get install cvs ] -> to install a cvs client
> cvs -z3 -d:pserver:[email protected]:/cvsroot/mspgcc co
> gcc/gcc-3.3
> cp -r gcc/gcc-3.3/* gcc-3.2.3/
> cd gcc-3.2.3
> 
> 
> ./configure --prefix=/usr/local/msp430 --target=msp430
> make
> make install
> ------------------------------------------------------------------
> 
> However I am getting the following error:
> 
> ------------------------------------------------------------------    
> gcc -DIN_GCC -DCROSS_COMPILE   -g -O2 -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic
> -Wno-long-long  -DHAVE_CONFIG_H  gcov.o intl.o version.o  
> ../libiberty/libiberty.a -o gcov
> gcc -DIN_GCC -DCROSS_COMPILE   -g -O2 -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic
> -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I. -I./. -I./config
> -I./../include  \
>         -DTARGET_MACHINE=\"msp430\" \
>         -c ./collect2.c -o collect2.o
> ./collect2.c: In function ‘notice’:
> ./collect2.c:377: warning: traditional C rejects ISO C style function
> definitions
> ./collect2.c: In function ‘fatal_perror’:
> ./collect2.c:389: warning: traditional C rejects ISO C style function
> definitions
> ./collect2.c: In function ‘fatal’:
> ./collect2.c:407: warning: traditional C rejects ISO C style function
> definitions
> ./collect2.c: In function ‘error’:
> ./collect2.c:423: warning: traditional C rejects ISO C style function
> definitions
> In function ‘open’,
>     inlined from ‘collect_execute’ at ./collect2.c:1590:
> /usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared
> with attribute error: open with O_CREAT in second argument needs 3 arguments
> make[1]: *** [collect2.o] Error 1
> make[1]: Leaving directory `/home/bmentink/mspgcc/temp/gcc-3.2.3/gcc'
> make: *** [all-gcc] Error 2
> r...@laptop:~/mspgcc/temp/gcc-3.2.3#
> ----------------------------------------------------------------------------------------
> 
> I have tried adjusting the Makefile to use the 3.4 compiler instead of the
> version 4 one, but I just get other problems.
> 
> Does anyone know what the correct procedure is, or even if I have the
> correct core gcc code and patches.
> 
> Thanks. 


      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
*** gcc-3.2.3-orig/gcc/collect2.c	2003-03-31 11:14:02.000000000 +1000
--- gcc-3.2.3-msp/gcc/collect2.c	2008-11-13 19:17:20.000000000 +1100
***************
*** 1587,1593 ****
    if (redir)
      {
        /* Open response file.  */
!       redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
  
        /* Duplicate the stdout and stderr file handles
  	 so they can be restored later.  */
--- 1587,1593 ----
    if (redir)
      {
        /* Open response file.  */
!       redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
  
        /* Duplicate the stdout and stderr file handles
  	 so they can be restored later.  */

Reply via email to