mirror of
https://github.com/devkitPro/buildscripts.git
synced 2026-04-18 16:37:21 -05:00
*** empty log message ***
This commit is contained in:
parent
377282629e
commit
03132ddc18
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
BINUTILS_VER=2.15
|
||||
GCC_VER=3.4.3
|
||||
NEWLIB_VER=1.13.0
|
||||
NEWLIB_VER=1.12.0
|
||||
LIBOGC_VER=20050419
|
||||
|
||||
BINUTILS="binutils-$BINUTILS_VER.tar.bz2"
|
||||
|
|
@ -186,10 +186,10 @@ else
|
|||
SRCDIR=`pwd`
|
||||
fi
|
||||
|
||||
BINUTILS_SRCDIR="binutils-$BINUTILS_VER/"
|
||||
GCC_SRCDIR="gcc-$GCC_VER/"
|
||||
NEWLIB_SRCDIR="newlib-$NEWLIB_VER/"
|
||||
LIBOGC_SRCDIR="libogc-$LIBOGC_VER/"
|
||||
BINUTILS_SRCDIR="binutils-$BINUTILS_VER"
|
||||
GCC_SRCDIR="gcc-$GCC_VER"
|
||||
NEWLIB_SRCDIR="newlib-$NEWLIB_VER"
|
||||
LIBOGC_SRCDIR="libogc-$LIBOGC_VER"
|
||||
|
||||
echo
|
||||
echo 'Ready to install '$package' in '$INSTALLDIR
|
||||
|
|
@ -289,6 +289,14 @@ rm -fr $INSTALLDIR/include/c++/$GCC_VER/$target/bits/stdc++.h.gch
|
|||
# Clean up temporary files and source directories
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
echo "Removing patched sources and build directories"
|
||||
|
||||
rm -fr $target
|
||||
rm -fr $BINUTILS_SRCDIR
|
||||
rm -fr $NEWLIB_SRCDIR
|
||||
rm -fr $GCC_SRCDIR
|
||||
rm -fr $LIBOGC_SRCDIR
|
||||
|
||||
echo
|
||||
echo "Would you like to delete the source packages? [y/N]"
|
||||
read answer
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export AR := $(PREFIX)ar
|
|||
export OBJCOPY := $(PREFIX)objcopy
|
||||
|
||||
all:
|
||||
$(CC) -marm -c $(CRT).s -o$(CRT).o
|
||||
$(CC) -marm -mthumb-interwork -c $(CRT).s -o interwork/$(CRT).o
|
||||
$(CC) -mthumb -c $(CRT).s -o thumb/$(CRT).o
|
||||
$(CC) -mthumb -mthumb-interwork -c $(CRT).s -o thumb/interwork/$(CRT).o
|
||||
$(CC) -x assembler-with-cpp -marm -c $(CRT)_crt0.s -o$(CRT)_crt0.o
|
||||
$(CC) -x assembler-with-cpp -marm -mthumb-interwork -c $(CRT)_crt0.s -o interwork/$(CRT)_crt0.o
|
||||
$(CC) -x assembler-with-cpp -mthumb -c $(CRT)_crt0.s -o thumb/$(CRT)_crt0.o
|
||||
$(CC) -x assembler-with-cpp -mthumb -mthumb-interwork -c $(CRT)_crt0.s -o thumb/interwork/$(CRT)_crt0.o
|
||||
|
|
|
|||
|
|
@ -5,15 +5,21 @@ ENTRY(_start)
|
|||
MEMORY {
|
||||
|
||||
rom : ORIGIN = 0x08000000, LENGTH = 32M
|
||||
iwram : ORIGIN = 0x03000000, LENGTH = 32K
|
||||
ewram : ORIGIN = 0x02040000, LENGTH = 4M
|
||||
iwram : ORIGIN = 0x037f8000, LENGTH = 32K
|
||||
ewram : ORIGIN = 0x02004000, LENGTH = (4M - 16K)
|
||||
dtcm : ORIGIN = 0x00800000, LENGTH = 16K
|
||||
}
|
||||
__iwram_start = 0x03000000;
|
||||
|
||||
__sp_svc = 0x3081000 - 0x60;
|
||||
__iwram_start = 0x037f8000;
|
||||
__iwram_end = 0x03800000;
|
||||
__ewram_end = 0x02400000;
|
||||
__eheap_end = 0x02400000;
|
||||
__dtcm_start = 0x00800000;
|
||||
|
||||
__sp_svc = __iwram_end - 0x60;
|
||||
__sp_irq = __sp_svc - 0x100;
|
||||
__sp_usr = __sp_irq - 0x100;
|
||||
__eheap_end = 0x02080000;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.init :
|
||||
|
|
@ -93,9 +99,18 @@ SECTIONS
|
|||
.jcr : { KEEP (*(.jcr)) } >ewram = 0
|
||||
.got : { *(.got.plt) *(.got) } >ewram = 0
|
||||
|
||||
.sbss ALIGN(4):
|
||||
{
|
||||
__sbss_start = ABSOLUTE(.);
|
||||
*(.sbss)
|
||||
. = ALIGN(4);
|
||||
}
|
||||
__sbss_end = . ;
|
||||
|
||||
_end = . ;
|
||||
__end__ = . ;
|
||||
PROVIDE (end = _end);
|
||||
|
||||
__iwram_lma = . ;
|
||||
|
||||
.iwram __iwram_start : AT (__iwram_lma)
|
||||
|
|
@ -120,8 +135,6 @@ SECTIONS
|
|||
} >iwram = 0xff
|
||||
|
||||
__data_end = . ;
|
||||
__appended_data = __data_lma + SIZEOF(.data) ;
|
||||
|
||||
|
||||
.bss ALIGN(4) :
|
||||
{
|
||||
|
|
@ -136,6 +149,20 @@ SECTIONS
|
|||
__bss_end = . ;
|
||||
__bss_end__ = . ;
|
||||
|
||||
__dtcm_lma = __data_lma + SIZEOF(.data);
|
||||
|
||||
.dtcm __dtcm_start : AT (__dtcm_lma)
|
||||
{
|
||||
__dtcm_start = ABSOLUTE(.);
|
||||
*(.dtcm)
|
||||
*(.dtcm.*)
|
||||
. = ALIGN(4);
|
||||
} >dtcm = 0xff
|
||||
__dtcm_end = . ;
|
||||
|
||||
__appended_data = __dtcm_lma + SIZEOF(.dtcm) ;
|
||||
|
||||
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
|
|
|
|||
|
|
@ -1,128 +1,136 @@
|
|||
.section ".init"
|
||||
.global _start
|
||||
@---------------------------------------------------------------------------------
|
||||
.section ".init"
|
||||
.global _start
|
||||
@---------------------------------------------------------------------------------
|
||||
.align 4
|
||||
.arm
|
||||
@---------------------------------------------------------------------------------
|
||||
_start:
|
||||
@---------------------------------------------------------------------------------
|
||||
mov r0, #0x04000000 @ IME = 0;
|
||||
add r0, r0, #208
|
||||
strh r0, [r0]
|
||||
|
||||
ldr r1, =0x00002078 @ disable DTCM and protection unit
|
||||
mcr p15, 0, r1, c1, c0
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
ldr r0, =0x0080000A
|
||||
mcr p15, 0, r0, c9, c1 @ TCM base = 0x00800*4096, size = 16 KB
|
||||
mrc p15, 0, r0, c1, c0 @ throw-away read of cp15.c1
|
||||
orr r1, r1, #0x10000
|
||||
mcr p15, 0, r1, c1, c0 @ cp15.c1 = 0x00012078;
|
||||
|
||||
.align 4
|
||||
.arm
|
||||
mov r0, #0x12 @ Switch to IRQ Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_irq @ Set IRQ stack
|
||||
|
||||
_start:
|
||||
mov r0, #0x04000000 @ IME = 0;
|
||||
add r0, r0, #0x208
|
||||
strh r0, [r0]
|
||||
mov r0, #0x13 @ Switch to SVC Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_svc @ Set SVC stack
|
||||
|
||||
ldr r1, =0x00002078 @ disable DTCM and protection unit
|
||||
mcr p15, 0, r1, c1, c0
|
||||
|
||||
ldr r0, =0x0080000A
|
||||
mcr p15, 0, r0, c9, c1 @ TCM base = 0x00800*4096, size = 16 KB
|
||||
mrc p15, 0, r0, c1, c0 @ throw-away read of cp15.c1
|
||||
orr r1, r1, #0x10000
|
||||
mcr p15, 0, r1, c1, c0 @ cp15.c1 = 0x00012078;
|
||||
|
||||
mov r0, #0x12 @ Switch to IRQ Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_irq @ Set IRQ stack
|
||||
|
||||
mov r0, #0x13 @ Switch to SVC Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_svc @ Set SVC stack
|
||||
|
||||
mov r0, #0x1F @ Switch to System Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_usr @ Set user stack
|
||||
|
||||
ldr r0, =__bss_start @ Clear BSS section to 0x00
|
||||
ldr r1, =__bss_end
|
||||
sub r1, r1, r0
|
||||
bl ClearMem
|
||||
|
||||
ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA (ROM to RAM)
|
||||
ldr r2, =__data_start
|
||||
ldr r4, =__data_end
|
||||
bl CopyMemCheck
|
||||
|
||||
ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM)
|
||||
ldr r2, =__iwram_start
|
||||
ldr r4, =__iwram_end
|
||||
bl CopyMemCheck
|
||||
|
||||
ldr r1, =fake_heap_end @ set heap end
|
||||
ldr r0, =__eheap_end
|
||||
str r0, [r1]
|
||||
|
||||
ldr r3, =_init @ global constructors
|
||||
bl _call_via_r3
|
||||
|
||||
mov r0, #0 @ int argc
|
||||
mov r1, #0 @ char *argv[]
|
||||
ldr r3, =main
|
||||
bl _call_via_r3 @ jump to user code
|
||||
|
||||
@ If the user ever returns, go to an infinte loop
|
||||
ldr r0, =ILoop
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x027FFE78
|
||||
str r0, [r1]
|
||||
bx r1
|
||||
ILoop: b ILoop
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@
|
||||
mov r0, #0x1F @ Switch to System Mode
|
||||
msr cpsr, r0
|
||||
ldr sp, =__sp_usr @ Set user stack
|
||||
|
||||
ldr r0, =__bss_start @ Clear BSS section to 0x00
|
||||
ldr r1, =__bss_end
|
||||
sub r1, r1, r0
|
||||
bl ClearMem
|
||||
|
||||
ldr r0, =__sbss_start @ Clear SBSS section to 0x00
|
||||
ldr r1, =__sbss_end
|
||||
sub r1, r1, r0
|
||||
bl ClearMem
|
||||
|
||||
ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA
|
||||
ldr r2, =__data_start
|
||||
ldr r4, =__data_end
|
||||
bl CopyMemCheck
|
||||
|
||||
ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA
|
||||
ldr r2, =__iwram_start
|
||||
ldr r4, =__iwram_end
|
||||
bl CopyMemCheck
|
||||
|
||||
ldr r1, =__dtcm_lma @ Copy data tightly coupled memory from LMA to VMA
|
||||
ldr r2, =__dtcm_start
|
||||
ldr r4, =__dtcm_end
|
||||
bl CopyMemCheck
|
||||
|
||||
ldr r1, =fake_heap_end @ set heap end
|
||||
ldr r0, =__eheap_end
|
||||
str r0, [r1]
|
||||
|
||||
@ldr r3, =_init @ global constructors
|
||||
@bx r3
|
||||
|
||||
mov r0, #0 @ int argc
|
||||
mov r1, #0 @ char *argv[]
|
||||
ldr r3, =main
|
||||
bx r3
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
@ If the user ever returns, go to an infinte loop
|
||||
@---------------------------------------------------------------------------------
|
||||
ldr r0, =ILoop
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x027FFE78
|
||||
str r0, [r1]
|
||||
bx r1
|
||||
ILoop:
|
||||
b ILoop
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Clear memory to 0x00 if length != 0
|
||||
@ r0 = Start Address
|
||||
@ r1 = Length
|
||||
@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
ClearMem: mov r2, #3 @ Round down to nearest word boundary
|
||||
add r1, r1, r2 @ Shouldn't be needed
|
||||
bics r1, r1, r2 @ Clear 2 LSB (and set Z)
|
||||
bxeq lr @ Quit if copy size is 0
|
||||
|
||||
mov r2, #0
|
||||
ClrLoop: stmia r0!, {r2}
|
||||
subs r1, r1, #4
|
||||
bne ClrLoop
|
||||
|
||||
bx lr
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@
|
||||
@ Copy memory if length != 0
|
||||
@ r1 = Source Address
|
||||
@ r0 = Start Address
|
||||
@ r1 = Length
|
||||
@---------------------------------------------------------------------------------
|
||||
ClearMem:
|
||||
@---------------------------------------------------------------------------------
|
||||
mov r2, #3 @ Round down to nearest word boundary
|
||||
add r1, r1, r2 @ Shouldn't be needed
|
||||
bics r1, r1, r2 @ Clear 2 LSB (and set Z)
|
||||
bxeq lr @ Quit if copy size is 0
|
||||
|
||||
mov r2, #0
|
||||
ClrLoop:
|
||||
stmia r0!, {r2}
|
||||
subs r1, r1, #4
|
||||
bne ClrLoop
|
||||
|
||||
bx lr
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Copy memory if length != 0
|
||||
@ r1 = Source Address
|
||||
@ r2 = Dest Address
|
||||
@ r4 = Dest Address + Length
|
||||
@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
CopyMemCheck:
|
||||
sub r3, r4, r2 @ Is there any data to copy?
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@
|
||||
@ Copy memory
|
||||
@ r1 = Source Address
|
||||
@ r4 = Dest Address + Length
|
||||
@---------------------------------------------------------------------------------
|
||||
CopyMemCheck:
|
||||
@---------------------------------------------------------------------------------
|
||||
sub r3, r4, r2 @ Is there any data to copy?
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Copy memory
|
||||
@ r1 = Source Address
|
||||
@ r2 = Dest Address
|
||||
@ r3 = Length
|
||||
@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
CopyMem: mov r0, #3 @ These commands are used in cases where
|
||||
add r3, r3, r0 @ the length is not a multiple of 4,
|
||||
bics r3, r3, r0 @ even though it should be.
|
||||
bxeq lr @ Length is zero, so exit
|
||||
|
||||
CIDLoop: ldmia r1!, {r0}
|
||||
stmia r2!, {r0}
|
||||
subs r3, r3, #4
|
||||
bne CIDLoop
|
||||
|
||||
bx lr
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
.align
|
||||
.pool
|
||||
|
||||
.end
|
||||
@ r3 = Length
|
||||
@---------------------------------------------------------------------------------
|
||||
CopyMem:
|
||||
@---------------------------------------------------------------------------------
|
||||
mov r0, #3 @ These commands are used in cases where
|
||||
add r3, r3, r0 @ the length is not a multiple of 4,
|
||||
bics r3, r3, r0 @ even though it should be.
|
||||
bxeq lr @ Length is zero, so exit
|
||||
CIDLoop:
|
||||
ldmia r1!, {r0}
|
||||
stmia r2!, {r0}
|
||||
subs r3, r3, #4
|
||||
bne CIDLoop
|
||||
|
||||
bx lr
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
.align
|
||||
.pool
|
||||
.end
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ DEVKITARM=$INSTALLDIR
|
|||
|
||||
cp $(pwd)/dka-crtls/* $DEVKITARM/arm-elf/lib/
|
||||
cd $DEVKITARM/arm-elf/lib/
|
||||
$MAKE CRT=gba_crt0
|
||||
$MAKE CRT=gp32_crt0
|
||||
$MAKE CRT=er_crt0
|
||||
$MAKE CRT=gp32_gpsdk_crt0
|
||||
$MAKE CRT=ds_arm7_crt0
|
||||
$MAKE CRT=ds_arm9_crt0
|
||||
$MAKE CRT=ds_cart_crt0
|
||||
$MAKE CRT=gba
|
||||
$MAKE CRT=gp32
|
||||
$MAKE CRT=er
|
||||
$MAKE CRT=gp32_gpsdk
|
||||
$MAKE CRT=ds_arm7
|
||||
$MAKE CRT=ds_arm9
|
||||
$MAKE CRT=ds_cart
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ cd $BUILDSCRIPTDIR
|
|||
mkdir -p $target/newlib
|
||||
cd $target/newlib
|
||||
|
||||
../../$NEWLIB_SRCDIR/configure --target=$target --prefix=$prefix | tee newlib_configure.log 2>&1
|
||||
$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure --target=$target \
|
||||
--prefix=$prefix \
|
||||
| tee newlib_configure.log 2>&1
|
||||
|
||||
$MAKE all | tee newlib_make.log 2>&1
|
||||
$MAKE install | tee newlib_install.log 2>&1
|
||||
|
|
|
|||
325
patches/devkit-gcc-3.3.3.patch
Normal file
325
patches/devkit-gcc-3.3.3.patch
Normal file
|
|
@ -0,0 +1,325 @@
|
|||
diff -Naurb gcc-3.3.3.orig/gcc/c-aux-info.c gcc-3.3.3/gcc/c-aux-info.c
|
||||
--- gcc-3.3.3.orig/gcc/c-aux-info.c Sun Sep 22 03:03:14 2002
|
||||
+++ gcc-3.3.3/gcc/c-aux-info.c Fri Mar 5 21:41:20 2004
|
||||
@@ -581,7 +581,7 @@
|
||||
|
||||
/* Write the actual line of auxiliary info. */
|
||||
|
||||
- fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;",
|
||||
+ fprintf (aux_info_file, "/* %s(%d):%c%c */ %s;",
|
||||
DECL_SOURCE_FILE (fndecl),
|
||||
DECL_SOURCE_LINE (fndecl),
|
||||
(is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O',
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/collect2.c gcc-3.3.3/gcc/collect2.c
|
||||
--- gcc-3.3.3.orig/gcc/collect2.c Mon Dec 8 19:02:40 2003
|
||||
+++ gcc-3.3.3/gcc/collect2.c Fri Mar 5 21:41:20 2004
|
||||
@@ -161,6 +161,63 @@
|
||||
#define SCAN_LIBRARIES
|
||||
#endif
|
||||
|
||||
+#ifdef __MINGW32__
|
||||
+/* We are being compiled with mingw32 as host, so we should prepare some
|
||||
+ win32 replaces for pipe(), kill(getpid(),...) and vfork() + execv()
|
||||
+*/
|
||||
+#include <io.h>
|
||||
+#include <fcntl.h>
|
||||
+
|
||||
+#define pipe(fildes) _pipe((fildes),1024*16,_O_BINARY)
|
||||
+
|
||||
+#define WIN32_LEAN_AND_MEAN
|
||||
+#include <windows.h>
|
||||
+
|
||||
+int vfork_execv(char *cmdname, char **argv, int fdout);
|
||||
+
|
||||
+/* Helper function for vfork() + execv() replacement. */
|
||||
+int vfork_execv(char *cmdname, char **argv, int fdout)
|
||||
+{
|
||||
+ STARTUPINFO SI;
|
||||
+ PROCESS_INFORMATION PI;
|
||||
+ char *params;
|
||||
+ int plen = 0;
|
||||
+ int i;
|
||||
+ BOOL bRes;
|
||||
+
|
||||
+ /* Prepare one line with arguments */
|
||||
+ for(i=0;argv[i];i++) plen += strlen(argv[i]) + 1;
|
||||
+ plen++;
|
||||
+ params = xmalloc(plen);
|
||||
+ strcpy(params,argv[0]);
|
||||
+ for(i=1;argv[i];i++) strcat(strcat(params," "),argv[i]);
|
||||
+
|
||||
+ /* Prepare startup info -- for pipes redirection */
|
||||
+ memset(&SI,0,sizeof(SI));
|
||||
+ SI.cb = sizeof(SI);
|
||||
+ SI.dwFlags = STARTF_USESTDHANDLES;
|
||||
+ SI.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
+ SI.hStdOutput = (HANDLE)_get_osfhandle(fdout);
|
||||
+ SI.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
+
|
||||
+ /* Create new process in same console, with redirected (piped) stdout */
|
||||
+ bRes = CreateProcess(cmdname,params,
|
||||
+ NULL,NULL, /* Security attributes */
|
||||
+ FALSE, /* Handle inheritance */
|
||||
+ 0, /* Flags -- default, in this console, etc */
|
||||
+ NULL, /* Invironment */
|
||||
+ NULL, /* CWD */
|
||||
+ &SI, /* Startup info */
|
||||
+ &PI); /* Process info */
|
||||
+ if(!bRes) return -1;
|
||||
+ CloseHandle(PI.hProcess);
|
||||
+ CloseHandle(PI.hThread);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* END-OF-WIN32-SECTION */
|
||||
+#endif
|
||||
+
|
||||
#ifdef USE_COLLECT2
|
||||
int do_collecting = 1;
|
||||
#else
|
||||
@@ -444,7 +501,11 @@
|
||||
#endif
|
||||
|
||||
signal (signo, SIG_DFL);
|
||||
+#ifndef __MINGW32__
|
||||
kill (getpid (), signo);
|
||||
+#else
|
||||
+ ExitProcess(signo);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2111,6 +2172,7 @@
|
||||
fflush (stderr);
|
||||
|
||||
/* Spawn child nm on pipe */
|
||||
+#ifndef __MINGW32__
|
||||
pid = vfork ();
|
||||
if (pid == -1)
|
||||
fatal_perror (VFORK_STRING);
|
||||
@@ -2130,6 +2192,11 @@
|
||||
execv (nm_file_name, real_nm_argv);
|
||||
fatal_perror ("execv %s", nm_file_name);
|
||||
}
|
||||
+#else
|
||||
+ if(vfork_execv(nm_file_name, real_nm_argv, pipe_fd[1])) {
|
||||
+ fatal_perror ("vfork+execv %s", nm_file_name);
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
/* Parent context from here on. */
|
||||
int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN);
|
||||
@@ -2552,6 +2619,7 @@
|
||||
fflush (stderr);
|
||||
|
||||
/* Spawn child ldd on pipe */
|
||||
+#ifndef __MINGW32__
|
||||
pid = vfork ();
|
||||
if (pid == -1)
|
||||
fatal_perror (VFORK_STRING);
|
||||
@@ -2571,6 +2639,11 @@
|
||||
execv (ldd_file_name, real_ldd_argv);
|
||||
fatal_perror ("execv %s", ldd_file_name);
|
||||
}
|
||||
+#else
|
||||
+ if(vfork_execv(ldd_file_name, real_ldd_argv, pipe_fd[1])) {
|
||||
+ fatal_perror ("vfork+execv %s", nm_file_name);
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
/* Parent context from here on. */
|
||||
int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN);
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/arm/arm.h gcc-3.3.3/gcc/config/arm/arm.h
|
||||
--- gcc-3.3.3.orig/gcc/config/arm/arm.h Fri Nov 15 11:21:36 2002
|
||||
+++ gcc-3.3.3/gcc/config/arm/arm.h Fri Mar 5 21:41:21 2004
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Definitions of target machine for GNU compiler, for ARM.
|
||||
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
- 2001, 2002 Free Software Foundation, Inc.
|
||||
+ 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
|
||||
and Martin Simmons (@harleqn.co.uk).
|
||||
More major hacks by Richard Earnshaw (rearnsha@arm.com)
|
||||
@@ -2180,6 +2180,7 @@
|
||||
goto WIN; \
|
||||
} \
|
||||
else if (GET_MODE_CLASS (MODE) != MODE_FLOAT \
|
||||
+ && GET_MODE_SIZE (mode) == 4 \
|
||||
&& GET_CODE (X) == SYMBOL_REF \
|
||||
&& CONSTANT_POOL_ADDRESS_P (X) \
|
||||
&& ! (flag_pic \
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/arm/arm.md gcc-3.3.3/gcc/config/arm/arm.md
|
||||
--- gcc-3.3.3.orig/gcc/config/arm/arm.md Sun Jun 15 22:11:32 2003
|
||||
+++ gcc-3.3.3/gcc/config/arm/arm.md Fri Mar 5 21:41:21 2004
|
||||
@@ -1,6 +1,6 @@
|
||||
;;- Machine description for ARM for GNU compiler
|
||||
;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000,
|
||||
-;; 2001, 2002 Free Software Foundation, Inc.
|
||||
+;; 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
|
||||
;; and Martin Simmons (@harleqn.co.uk).
|
||||
;; More major hacks by Richard Earnshaw (rearnsha@arm.com).
|
||||
@@ -4585,8 +4585,8 @@
|
||||
)
|
||||
|
||||
(define_insn "*thumb_movhi_insn"
|
||||
- [(set (match_operand:HI 0 "nonimmediate_operand" "=l,l, m,*r,*h,l")
|
||||
- (match_operand:HI 1 "general_operand" "l,mn,l,*h,*r,I"))]
|
||||
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=l,l,m,*r,*h,l")
|
||||
+ (match_operand:HI 1 "general_operand" "l,m,l,*h,*r,I"))]
|
||||
"TARGET_THUMB
|
||||
&& ( register_operand (operands[0], HImode)
|
||||
|| register_operand (operands[1], HImode))"
|
||||
@@ -4618,8 +4618,7 @@
|
||||
return \"ldrh %0, %1\";
|
||||
}"
|
||||
[(set_attr "length" "2,4,2,2,2,2")
|
||||
- (set_attr "type" "*,load,store1,*,*,*")
|
||||
- (set_attr "pool_range" "*,64,*,*,*,*")]
|
||||
+ (set_attr "type" "*,load,store1,*,*,*")]
|
||||
)
|
||||
|
||||
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/arm/t-arm-elf gcc-3.3.3/gcc/config/arm/t-arm-elf
|
||||
--- gcc-3.3.3.orig/gcc/config/arm/t-arm-elf Wed May 8 16:01:14 2002
|
||||
+++ gcc-3.3.3/gcc/config/arm/t-arm-elf Fri Mar 5 21:41:21 2004
|
||||
@@ -38,9 +38,9 @@
|
||||
# MULTILIB_DIRNAMES += 32bit 26bit
|
||||
# MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26*
|
||||
#
|
||||
-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
|
||||
-# MULTILIB_DIRNAMES += normal interwork
|
||||
-# MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*
|
||||
+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
|
||||
+MULTILIB_DIRNAMES += normal interwork
|
||||
+MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*
|
||||
#
|
||||
# MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
|
||||
# MULTILIB_DIRNAMES += elf under
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/i386/mingw32-1.c gcc-3.3.3/gcc/config/i386/mingw32-1.c
|
||||
--- gcc-3.3.3.orig/gcc/config/i386/mingw32-1.c Thu Jan 1 00:00:00 1970
|
||||
+++ gcc-3.3.3/gcc/config/i386/mingw32-1.c Sat Mar 6 10:03:08 2004
|
||||
@@ -0,0 +1,44 @@
|
||||
+/* This replaces the use of stat and struct stat.st_ino to determine if
|
||||
+ files are different in gcc.c (do_spec_1) handling of --save-temps
|
||||
+ switch.
|
||||
+ Contributed by Danny Smith (dannysmith@users.sourceforge.net)
|
||||
+ Copyright 2003 Free Software Foundation, Inc.
|
||||
+
|
||||
+This file is part of GNU CC.
|
||||
+
|
||||
+GNU CC is free software; you can redistribute it and/or modify
|
||||
+it under the terms of the GNU General Public License as published by
|
||||
+the Free Software Foundation; either version 2, or (at your option)
|
||||
+any later version.
|
||||
+
|
||||
+GNU CC is distributed in the hope that it will be useful,
|
||||
+but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+GNU General Public License for more details.
|
||||
+
|
||||
+You should have received a copy of the GNU General Public License
|
||||
+along with GNU CC; see the file COPYING. If not, write to
|
||||
+the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
+Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#define WIN32_LEAN_AND_MEAN
|
||||
+#include <windows.h>
|
||||
+
|
||||
+/* Return non-zero if src and dst filenames do not refer to same files. */
|
||||
+
|
||||
+int w32_file_id_cmp (const char *, const char *);
|
||||
+
|
||||
+int
|
||||
+w32_file_id_cmp (src, dst)
|
||||
+ const char * src;
|
||||
+ const char * dst;
|
||||
+{
|
||||
+ char fullpath_src[MAX_PATH];
|
||||
+ char fullpath_dst[MAX_PATH];
|
||||
+ char* pfilename;
|
||||
+
|
||||
+ /* Just compare full pathnames, without regard to case. */
|
||||
+ GetFullPathName (src,MAX_PATH,fullpath_src,&pfilename);
|
||||
+ GetFullPathName (dst,MAX_PATH,fullpath_dst,&pfilename);
|
||||
+ return (lstrcmpi (fullpath_src, fullpath_dst));
|
||||
+}
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/i386/x-mingw32 gcc-3.3.3/gcc/config/i386/x-mingw32
|
||||
--- gcc-3.3.3.orig/gcc/config/i386/x-mingw32 Thu Jan 1 00:00:00 1970
|
||||
+++ gcc-3.3.3/gcc/config/i386/x-mingw32 Sat Mar 6 09:42:12 2004
|
||||
@@ -0,0 +1,11 @@
|
||||
+#
|
||||
+# For HOST_FILE_ID_CMP for mingw32.
|
||||
+#
|
||||
+EXTRA_GCC_OBJS = mingw32-1.o
|
||||
+
|
||||
+mingw32-1.o: $(srcdir)/config/i386/mingw32-1.c
|
||||
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $?
|
||||
+
|
||||
+
|
||||
+local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include
|
||||
+STMP_FIXINC =
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config/i386/xm-mingw32.h gcc-3.3.3/gcc/config/i386/xm-mingw32.h
|
||||
--- gcc-3.3.3.orig/gcc/config/i386/xm-mingw32.h Thu Jan 10 22:21:40 2002
|
||||
+++ gcc-3.3.3/gcc/config/i386/xm-mingw32.h Sat Mar 6 09:44:41 2004
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Configuration for GNU C-compiler for hosting on Windows32.
|
||||
using GNU tools and the Windows32 API Library.
|
||||
- Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@@ -31,3 +31,10 @@
|
||||
|
||||
#undef PATH_SEPARATOR
|
||||
#define PATH_SEPARATOR ';'
|
||||
+
|
||||
+/* This replaces the use of stat to determine if files are different
|
||||
+ in gcc.c (do_spec_1) handling of --save-temps switch. */
|
||||
+
|
||||
+extern int
|
||||
+w32_file_id_cmp PARAMS((const char *, const char *));
|
||||
+#define HOST_FILE_ID_CMP(SRC,DST) w32_file_id_cmp (SRC, DST)
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/config.gcc gcc-3.3.3/gcc/config.gcc
|
||||
--- gcc-3.3.3.orig/gcc/config.gcc Wed Jan 21 06:06:00 2004
|
||||
+++ gcc-3.3.3/gcc/config.gcc Fri Mar 5 21:41:21 2004
|
||||
@@ -1352,6 +1352,7 @@
|
||||
xm_defines=POSIX
|
||||
xm_file=i386/xm-mingw32.h
|
||||
tmake_file="i386/t-cygwin i386/t-mingw32"
|
||||
+ xmake_file=i386/x-mingw32
|
||||
extra_objs=winnt.o
|
||||
if test x$enable_threads = xyes; then
|
||||
thread_file='win32'
|
||||
diff -Naurb gcc-3.3.3.orig/gcc/gcc.c gcc-3.3.3/gcc/gcc.c
|
||||
--- gcc-3.3.3.orig/gcc/gcc.c Sat Dec 6 03:53:02 2003
|
||||
+++ gcc-3.3.3/gcc/gcc.c Sat Mar 6 09:44:14 2004
|
||||
@@ -4075,7 +4075,9 @@
|
||||
static int suffixed_basename_length;
|
||||
static const char *input_basename;
|
||||
static const char *input_suffix;
|
||||
+#ifndef HOST_FILE_ID_CMP
|
||||
static struct stat input_stat;
|
||||
+#endif
|
||||
static int input_stat_set;
|
||||
|
||||
/* The compiler used to process the current input file. */
|
||||
@@ -4540,6 +4542,9 @@
|
||||
*((char *) temp_filename + temp_filename_length) = '\0';
|
||||
if (strcmp (temp_filename, input_filename) != 0)
|
||||
{
|
||||
+#if defined HOST_FILE_ID_CMP
|
||||
+ if (HOST_FILE_ID_CMP(input_filename, temp_filename) != 0)
|
||||
+#else
|
||||
struct stat st_temp;
|
||||
|
||||
/* Note, set_input() resets input_stat_set to 0. */
|
||||
@@ -4559,6 +4564,7 @@
|
||||
|| stat (temp_filename, &st_temp) < 0
|
||||
|| input_stat.st_dev != st_temp.st_dev
|
||||
|| input_stat.st_ino != st_temp.st_ino)
|
||||
+#endif
|
||||
{
|
||||
temp_filename = save_string (temp_filename,
|
||||
temp_filename_length + 1);
|
||||
Loading…
Reference in New Issue
Block a user