diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2005-08-11 20:03:56 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-08-11 20:03:56 +0000 |
commit | 122c43cb0589c423749b9f046ceed1ab53bee9f6 (patch) | |
tree | f4381920fc7e84bf5eabd3cd37bf6adeee33fbec /packages/uclibc/uclibc-0.9.27 | |
parent | 5f016dabf20ee6196f7e141e7f499a09b7342f91 (diff) |
This set of changes ensures that TARGET_CC_ARCH is passed reliably to all
packages in a build. The change fixes problems in the following packages:
binutils{,-cross}_2.15.94.0.1
HOST_CC_ARCH was not being passed to HOST_CC. The problem does
not seem to be present in binutils* 2.16, however this version
is still used for uClibc builds.
gcc{,-cross,-cross-initial}_3.4.4
HOST/TARGET_CC_ARCH was not used in the appropriate places, plus
this was not sufficient - FLAGS_FOR_TARGET (a gcc make variable)
is now preloaded with the target CC_ARCH values, which causes all
the builds (gcc, g++, gcj, fortran) to get the correct values.
gcc OTHER
*NOT* fixed - other versions of gcc will still need the _CC_ARCH
fix in the same lines (CC_FOR_TARGET, GCC_FOR_TARGET, CXX_FOR_TARGET),
however so long as these builds use gcc3-*.inc the FLAGS_FOR_TARGET
fixx will be there.
uclibc{,-initial}_0.9.27
TARGET_CC_ARCH added to the do_compile. For the do_stage step the
build actually compiles target code (make utils), but this will not
accept a CC with whitespace. The TARGET_CC_ARCH flags have therefore
been added to CFLAGS (a bit ugly, but it works).
These changes have been tested for both cross and target builds, the changes
should be fine on self-hosted (i.e. target-hosted) builds, if anyone actually
does these, but note that the gcc build specifically tests for build==host and
does *not* do certain _FOR_TARGET settings in this case (this was the case
before this change too) - if you are seeing strange settings on self-hosted
gcc builds (before and after this change) check the do_compile environment
variable settings.
Diffstat (limited to 'packages/uclibc/uclibc-0.9.27')
-rw-r--r-- | packages/uclibc/uclibc-0.9.27/arm-thumb-defined.patch | 84 | ||||
-rw-r--r-- | packages/uclibc/uclibc-0.9.27/thumb-swi.patch | 82 | ||||
-rw-r--r-- | packages/uclibc/uclibc-0.9.27/thumb-swp.patch | 102 |
3 files changed, 268 insertions, 0 deletions
diff --git a/packages/uclibc/uclibc-0.9.27/arm-thumb-defined.patch b/packages/uclibc/uclibc-0.9.27/arm-thumb-defined.patch new file mode 100644 index 0000000000..675ab6f5c0 --- /dev/null +++ b/packages/uclibc/uclibc-0.9.27/arm-thumb-defined.patch @@ -0,0 +1,84 @@ +--- uClibc-0.9.27/ldso/include/dl-string.h.orig 2005-08-09 18:16:50.618935711 -0700 ++++ uClibc-0.9.27/ldso/include/dl-string.h 2005-08-09 18:17:02.279669474 -0700 +@@ -250,7 +250,7 @@ + } + + +-#if defined(mc68000) || defined(__arm__) || defined(__mips__) || defined(__sh__) || defined(__powerpc__) ++#if defined(mc68000) || defined(__arm__) || defined(__mips__) || defined(__sh__) || defined(__powerpc__) || defined(__thumb__) + /* On some arches constant strings are referenced through the GOT. */ + /* XXX Requires load_addr to be defined. */ + #define SEND_STDERR(X) \ +--- uClibc-0.9.27/ldso/ldso/dl-startup.c.orig 2005-08-09 18:17:02.307671237 -0700 ++++ uClibc-0.9.27/ldso/ldso/dl-startup.c 2005-08-09 18:19:40.633634061 -0700 +@@ -137,7 +137,7 @@ + /* First obtain the information on the stack that tells us more about + what binary is loaded, where it is loaded, etc, etc */ + GET_ARGV(aux_dat, args); +-#if defined (__arm__) || defined (__mips__) || defined (__cris__) ++#if defined (__arm__) || defined (__mips__) || defined (__cris__) || defined(__thumb__) + aux_dat += 1; + #endif + argc = *(aux_dat - 1); +@@ -200,7 +200,7 @@ + __asm__("movel %%a5,%0":"=g"(got)); + #elif defined(__sparc__) + __asm__("\tmov %%l7,%0\n\t":"=r"(got)); +-#elif defined(__arm__) ++#elif defined(__arm__) || defined(__thumb__) + __asm__("\tmov %0, r10\n\t":"=r"(got)); + #elif defined(__powerpc__) + __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t":"=l"(got)); +--- uClibc-0.9.27/libc/sysdeps/linux/common/create_module.c.orig 2005-08-09 18:19:40.769642620 -0700 ++++ uClibc-0.9.27/libc/sysdeps/linux/common/create_module.c 2005-08-09 18:19:58.442754719 -0700 +@@ -31,7 +31,7 @@ + + #ifdef __NR_create_module + +-#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__cris__) || defined(__i960__) ++#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__cris__) || defined(__i960__) || defined(__thumb__) + #define __NR___create_module __NR_create_module + #ifdef __STR_NR_create_module + #define __STR_NR___create_module __STR_NR_create_module +--- uClibc-0.9.27/libc/sysdeps/linux/common/iopl.c.orig 2005-08-09 18:20:02.302997628 -0700 ++++ uClibc-0.9.27/libc/sysdeps/linux/common/iopl.c 2005-08-09 18:20:12.327628439 -0700 +@@ -9,7 +9,7 @@ + + #include "syscalls.h" + /* For arm there is a totally different implementation */ +-#if !defined(__arm__) ++#if !defined(__arm__) && !defined(__thumb__) + /* Tuns out the m68k unistd.h kernel header is broken */ + # if defined __ARCH_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__)) + _syscall1(int, iopl, int, level); +--- uClibc-0.9.27/libm/math_private.h.orig 2005-08-09 18:20:18.584022129 -0700 ++++ uClibc-0.9.27/libm/math_private.h 2005-08-09 18:21:26.280281986 -0700 +@@ -40,7 +40,7 @@ + * For VFP, floats words follow the memory system mode. + */ + +-#if (__BYTE_ORDER == __BIG_ENDIAN) || defined(__arm__) && !defined(__VFP_FP__) ++#if (__BYTE_ORDER == __BIG_ENDIAN) || (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) + + typedef union + { +@@ -54,7 +54,7 @@ + + #endif + +-#if (__BYTE_ORDER == __LITTLE_ENDIAN) && (!defined(__arm__) || defined(__VFP_FP__)) ++#if (__BYTE_ORDER == __LITTLE_ENDIAN) && ((!defined(__arm__) && !defined(__thumb__)) || defined(__VFP_FP__)) + + typedef union + { +--- uClibc-0.9.27/utils/ldd.c.orig 2005-08-09 18:21:27.724372857 -0700 ++++ uClibc-0.9.27/utils/ldd.c 2005-08-09 18:23:13.018998630 -0700 +@@ -51,7 +51,7 @@ + #include <dmalloc.h> + #endif + +-#if defined(__arm__) ++#if defined(__arm__) || defined(__thumb__) + #define MATCH_MACHINE(x) (x == EM_ARM) + #define ELFCLASSM ELFCLASS32 + #endif diff --git a/packages/uclibc/uclibc-0.9.27/thumb-swi.patch b/packages/uclibc/uclibc-0.9.27/thumb-swi.patch new file mode 100644 index 0000000000..a6929a9fc5 --- /dev/null +++ b/packages/uclibc/uclibc-0.9.27/thumb-swi.patch @@ -0,0 +1,82 @@ +--- uClibc-0.9.27/.pc/thumb-swi.patch/libc/sysdeps/linux/arm/bits/syscalls.h 2005-01-11 23:59:21.000000000 -0800 ++++ uClibc-0.9.27/libc/sysdeps/linux/arm/bits/syscalls.h 2005-08-08 21:04:11.081932985 -0700 +@@ -97,6 +97,7 @@ + #define INTERNAL_SYSCALL_DECL(err) do { } while (0) + + #undef INTERNAL_SYSCALL ++#if !defined(__thumb__) + #define INTERNAL_SYSCALL(name, err, nr, args...) \ + ({ unsigned int _sys_result; \ + { \ +@@ -109,6 +110,21 @@ + _sys_result = _a1; \ + } \ + (int) _sys_result; }) ++#else ++#define INTERNAL_SYSCALL(name, err, nr, args...) \ ++ ({ unsigned int _sys_result; \ ++ { \ ++ register int _a1 asm ("a1"); \ ++ LOAD_ARGS_##nr (args) \ ++ register int _r7 asm ("r7") = (int) (SYS_ify(name)); \ ++ asm volatile ("swi 0 @ syscall " #name \ ++ : "=r" (_a1) \ ++ : "r" (_r7) ASM_ARGS_##nr \ ++ : "memory"); \ ++ _sys_result = _a1; \ ++ } \ ++ (int) _sys_result; }) ++#endif + + #undef INTERNAL_SYSCALL_ERROR_P + #define INTERNAL_SYSCALL_ERROR_P(val, err) \ +--- uClibc-0.9.27/libc/sysdeps/linux/arm/brk.c.orig 2005-01-11 23:59:21.000000000 -0800 ++++ uClibc-0.9.27/libc/sysdeps/linux/arm/brk.c 2005-08-09 12:44:56.000000000 -0700 +@@ -26,14 +26,7 @@ + + int brk (void *addr) + { +- void *newbrk; +- +- asm ("mov a1, %1\n" /* save the argment in r0 */ +- "swi %2\n" /* do the system call */ +- "mov %0, a1;" /* keep the return value */ +- : "=r"(newbrk) +- : "r"(addr), "i" (__NR_brk) +- : "a1"); ++ void *newbrk = (void*)INTERNAL_SYSCALL(brk, , 1, addr); + + __curbrk = newbrk; + +--- uClibc-0.9.27/libc/sysdeps/linux/arm/syscall.c.orig 2005-08-09 12:51:10.681364959 -0700 ++++ uClibc-0.9.27/libc/sysdeps/linux/arm/syscall.c 2005-08-09 12:52:43.371197563 -0700 +@@ -26,6 +26,7 @@ + + long syscall(long sysnum, long a, long b, long c, long d, long e, long f) + { ++#if !defined(__thumb__) + register long _r0 asm("r0")=(long)(sysnum); + register long _r6 asm("r6")=(long)(f); + register long _r5 asm("r5")=(long)(e); +@@ -40,6 +41,21 @@ + "r"(_r2), "r"(_r3), "r"(_r4), "r"(_r5), + "r"(_r6) + : "memory"); ++#else ++ register long _r7 asm("r7")=(long)(sysnum); ++ register long _r5 asm("r5")=(long)(f); ++ register long _r4 asm("r4")=(long)(e); ++ register long _r3 asm("r3")=(long)(d); ++ register long _r2 asm("r2")=(long)(c); ++ register long _r1 asm("r1")=(long)(b); ++ register long _r0 asm("r0")=(long)(a); ++ asm volatile( ++ "swi 0" ++ : "=r"(_r0) ++ : "r"(_r0), "r"(_r1), "r"(_r2), "r"(_r3), ++ "r"(_r4), "r"(_r5), "r"(_r7) ++ : "memory"); ++#endif + if(_r0 >=(unsigned long) -4095) { + long err = _r0; + (*__errno_location())=(-err); diff --git a/packages/uclibc/uclibc-0.9.27/thumb-swp.patch b/packages/uclibc/uclibc-0.9.27/thumb-swp.patch new file mode 100644 index 0000000000..89171f735d --- /dev/null +++ b/packages/uclibc/uclibc-0.9.27/thumb-swp.patch @@ -0,0 +1,102 @@ +--- uClibc-0.9.27/libc/sysdeps/linux/arm/bits/atomicity.h.orig 2005-08-09 13:12:59.663734027 -0700 ++++ uClibc-0.9.27/libc/sysdeps/linux/arm/bits/atomicity.h 2005-08-09 17:54:14.581605661 -0700 +@@ -31,12 +31,23 @@ + int tmp2; + int result; + __asm__ ("\n" ++#if defined(__thumb__) ++ "\t.align 0\n" ++ "\tbx pc\n" ++ "\tnop\n" ++ "\t.arm\n" ++#endif + "0:\tldr\t%0,[%3]\n\t" + "add\t%1,%0,%4\n\t" + "swp\t%2,%1,[%3]\n\t" + "cmp\t%0,%2\n\t" + "swpne\t%1,%2,[%3]\n\t" + "bne\t0b" ++#if defined(__thumb__) ++ "\torr %1, pc, #1\n" ++ "\tbx %1\n" ++ "\t.force_thumb" ++#endif + : "=&r" (result), "=&r" (tmp1), "=&r" (tmp2) + : "r" (mem), "r"(val) + : "cc", "memory"); +@@ -51,12 +62,23 @@ + int tmp2; + int tmp3; + __asm__ ("\n" ++#if defined(__thumb__) ++ "\t.align 0\n" ++ "\tbx pc\n" ++ "\tnop\n" ++ "\t.arm\n" ++#endif + "0:\tldr\t%0,[%3]\n\t" + "add\t%1,%0,%4\n\t" + "swp\t%2,%1,[%3]\n\t" + "cmp\t%0,%2\n\t" + "swpne\t%1,%2,[%3]\n\t" + "bne\t0b" ++#if defined(__thumb__) ++ "\torr %1, pc, #1\n" ++ "\tbx %1\n" ++ "\t.force_thumb" ++#endif + : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) + : "r" (mem), "r"(val) + : "cc", "memory"); +@@ -68,6 +90,12 @@ + { + int result, tmp; + __asm__ ("\n" ++#if defined(__thumb__) ++ "\t.align 0\n" ++ "\tbx pc\n" ++ "\tnop\n" ++ "\t.arm\n" ++#endif + "0:\tldr\t%1,[%2]\n\t" + "mov\t%0,#0\n\t" + "cmp\t%1,%4\n\t" +@@ -78,6 +106,11 @@ + "bne\t0b\n\t" + "mov\t%0,#1\n" + "1:" ++#if defined(__thumb__) ++ "\torr %1, pc, #1\n" ++ "\tbx %1\n" ++ "\t.force_thumb" ++#endif + : "=&r" (result), "=&r" (tmp) + : "r" (p), "r" (newval), "r" (oldval) + : "cc", "memory"); +--- uClibc-0.9.27/libpthread/linuxthreads/sysdeps/arm/pt-machine.h.orig 2005-08-09 14:16:50.204774778 -0700 ++++ uClibc-0.9.27/libpthread/linuxthreads/sysdeps/arm/pt-machine.h 2005-08-09 17:55:54.027863420 -0700 +@@ -39,9 +39,24 @@ + { + register unsigned int ret; + ++#if defined(__thumb__) ++ void *pc; ++ __asm__ __volatile__( ++ ".align 0\n" ++ "\tbx pc\n" ++ "\tnop\n" ++ "\t.arm\n" ++ "\tswp %0, %2, [%3]\n" ++ "\torr %1, pc, #1\n" ++ "\tbx %1\n" ++ "\t.force_thumb" ++ : "=r"(ret), "=r"(pc) ++ : "0"(1), "r"(spinlock)); ++#else + __asm__ __volatile__("swp %0, %1, [%2]" + : "=r"(ret) + : "0"(1), "r"(spinlock)); ++#endif + + return ret; + } |