summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/global.in11
-rw-r--r--config/target.in5
-rw-r--r--patches/uClibc/0.9.29/100-conditional-sched_affinity.patch53
-rw-r--r--patches/uClibc/0.9.29/200-uClibc-0.9.29-fix-fget_putc.patch.dont_apply396
-rw-r--r--patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch12
-rw-r--r--patches/uClibc/0.9.29/400-bits_sysnum_h.patch33
-rw-r--r--samples/armeb-unknown-linux-uclibc/crosstool.config16
-rw-r--r--samples/armeb-unknown-linux-uclibc/uClibc-0.9.29.config (renamed from samples/armeb-unknown-linux-uclibc/uClibc-0.9.28.3.config)77
-rw-r--r--scripts/build/libc_uClibc.sh34
-rw-r--r--scripts/build/libfloat.sh2
-rwxr-xr-xscripts/saveSample.sh10
11 files changed, 610 insertions, 39 deletions
diff --git a/config/global.in b/config/global.in
index fda034d..f487a8b 100644
--- a/config/global.in
+++ b/config/global.in
@@ -238,15 +238,16 @@ config LOG_LEVEL_MAX
config LOG_SEE_TOOLS_WARN
bool
- prompt "See warnings from the tool builds"
+ prompt "Warnings from the tool builds as CT warnings"
default n
depends on ! LOG_ERROR
help
- If you say Y here, then you will see the warning lines from the
- components builds.
+ Treat warnings fron the different tools as crosstool warnings.
+ If you say 'y' here, then those warnings will be prefixed with
+ '[WARN ]' instead of the default '[ALL ]'.
- It should suffice to say N here, as those will anyway be visible
- in the log file (if you want one).
+ You can safely say 'n' here. Those warnings will anyway be
+ recorded in the log file (provided you configured one).
config LOG_PROGRESS_BAR
bool
diff --git a/config/target.in b/config/target.in
index afce5b8..b192d85 100644
--- a/config/target.in
+++ b/config/target.in
@@ -205,6 +205,11 @@ config ARCH_FLOAT_SW_LIBFLOAT
You should check gcc before deciding to use libfloat.
+config LIBFLOAT_VERSION
+ string
+ default "990616.orig"
+ depends on ARCH_FLOAT_SW_LIBFLOAT
+
config TARGET_CFLAGS
string
prompt "Target CFLAGS"
diff --git a/patches/uClibc/0.9.29/100-conditional-sched_affinity.patch b/patches/uClibc/0.9.29/100-conditional-sched_affinity.patch
new file mode 100644
index 0000000..509c42a
--- /dev/null
+++ b/patches/uClibc/0.9.29/100-conditional-sched_affinity.patch
@@ -0,0 +1,53 @@
+diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
+--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c 2007-02-12 16:52:32.000000000 -0600
++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c 2007-05-09 18:05:09.397411811 -0500
+@@ -29,6 +29,7 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+
++#ifdef __NR_sched_getaffinity
+ libc_hidden_proto(memset)
+
+ #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
+@@ -48,5 +49,15 @@
+ }
+ return res;
+ }
++#else
++/*
++int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
++{
++ __set_errno(ENOSYS);
++ return -1;
++}
++*/
+ #endif
+ #endif
++
++#endif
+diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
+--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c 2007-02-12 16:52:32.000000000 -0600
++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c 2007-05-09 18:05:09.397411811 -0500
+@@ -31,6 +31,7 @@
+ #include <sys/types.h>
+ #include <alloca.h>
+
++#ifdef __NR_sched_setaffinity
+ libc_hidden_proto(getpid)
+
+ #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
+@@ -74,5 +75,14 @@
+
+ return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+ }
++#else
++/*
++int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
++{
++ __set_errno(ENOSYS);
++ return -1;
++}
++*/
++#endif
+ #endif
+ #endif
diff --git a/patches/uClibc/0.9.29/200-uClibc-0.9.29-fix-fget_putc.patch.dont_apply b/patches/uClibc/0.9.29/200-uClibc-0.9.29-fix-fget_putc.patch.dont_apply
new file mode 100644
index 0000000..15d6149
--- /dev/null
+++ b/patches/uClibc/0.9.29/200-uClibc-0.9.29-fix-fget_putc.patch.dont_apply
@@ -0,0 +1,396 @@
+diff -ur uClibc-0.9.29/libc/inet/rpc/rcmd.c uClibc-0.9.29-patched/libc/inet/rpc/rcmd.c
+--- uClibc-0.9.29/libc/inet/rpc/rcmd.c 2007-01-10 11:46:19.000000000 -0600
++++ uClibc-0.9.29-patched/libc/inet/rpc/rcmd.c 2007-05-09 18:05:21.638421151 -0500
+@@ -126,7 +126,7 @@
+ libc_hidden_proto(listen)
+ libc_hidden_proto(sigsetmask)
+ libc_hidden_proto(getc_unlocked)
+-libc_hidden_proto(__fgetc_unlocked)
++//libc_hidden_proto(fgetc_unlocked)
+ libc_hidden_proto(fopen)
+ libc_hidden_proto(fclose)
+ libc_hidden_proto(fprintf)
+diff -ur uClibc-0.9.29/libc/inet/rpc/ruserpass.c uClibc-0.9.29-patched/libc/inet/rpc/ruserpass.c
+--- uClibc-0.9.29/libc/inet/rpc/ruserpass.c 2006-03-23 05:14:16.000000000 -0600
++++ uClibc-0.9.29-patched/libc/inet/rpc/ruserpass.c 2007-05-09 18:05:21.638421151 -0500
+@@ -63,7 +63,7 @@
+ libc_hidden_proto(fopen)
+ libc_hidden_proto(fclose)
+ libc_hidden_proto(getc_unlocked)
+-libc_hidden_proto(__fgetc_unlocked)
++//libc_hidden_proto(__fgetc_unlocked)
+
+ #define _(X) (X)
+ /* #include "ftp_var.h" */
+diff -ur uClibc-0.9.29/libc/misc/error/error.c uClibc-0.9.29-patched/libc/misc/error/error.c
+--- uClibc-0.9.29/libc/misc/error/error.c 2006-05-04 09:44:13.000000000 -0500
++++ uClibc-0.9.29-patched/libc/misc/error/error.c 2007-05-09 18:05:21.646421810 -0500
+@@ -30,11 +30,14 @@
+ libc_hidden_proto(strerror)
+ libc_hidden_proto(fprintf)
+ libc_hidden_proto(exit)
++//#undef putc
+ libc_hidden_proto(putc)
++libc_hidden_proto(fputc)
+ libc_hidden_proto(vfprintf)
+ libc_hidden_proto(fflush)
+-libc_hidden_proto(fputc)
+-libc_hidden_proto(__fputc_unlocked)
++//#ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
++libc_hidden_proto(fputc_unlocked)
++//#endif
+
+ /* This variable is incremented each time `error' is called. */
+ unsigned int error_message_count = 0;
+diff -ur uClibc-0.9.29/libc/misc/ttyent/getttyent.c uClibc-0.9.29-patched/libc/misc/ttyent/getttyent.c
+--- uClibc-0.9.29/libc/misc/ttyent/getttyent.c 2006-12-07 17:24:02.000000000 -0600
++++ uClibc-0.9.29-patched/libc/misc/ttyent/getttyent.c 2007-05-09 18:05:21.646421810 -0500
+@@ -44,8 +44,10 @@
+ libc_hidden_proto(__fsetlocking)
+ libc_hidden_proto(rewind)
+ libc_hidden_proto(fgets_unlocked)
++//#undef getc_unlocked
+ libc_hidden_proto(getc_unlocked)
+-libc_hidden_proto(__fgetc_unlocked)
++//#undef fgetc_unlocked
++libc_hidden_proto(fgetc_unlocked)
+ libc_hidden_proto(fopen)
+ libc_hidden_proto(fclose)
+ libc_hidden_proto(abort)
+diff -ur uClibc-0.9.29/libc/pwd_grp/pwd_grp.c uClibc-0.9.29-patched/libc/pwd_grp/pwd_grp.c
+--- uClibc-0.9.29/libc/pwd_grp/pwd_grp.c 2007-04-13 03:32:18.000000000 -0500
++++ uClibc-0.9.29-patched/libc/pwd_grp/pwd_grp.c 2007-05-09 18:05:21.638421151 -0500
+@@ -43,11 +43,12 @@
+ libc_hidden_proto(strtoul)
+ libc_hidden_proto(rewind)
+ libc_hidden_proto(fgets_unlocked)
+-libc_hidden_proto(__fputc_unlocked)
+ libc_hidden_proto(sprintf)
+ libc_hidden_proto(fopen)
+ libc_hidden_proto(fclose)
+ libc_hidden_proto(fprintf)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ libc_hidden_proto(__ctype_b_loc)
+ #elif __UCLIBC_HAS_CTYPE_TABLES__
+@@ -801,7 +802,7 @@
+
+ do {
+ if (!*m) {
+- if (__fputc_unlocked('\n', f) >= 0) {
++ if (fputc_unlocked('\n', f) >= 0) {
+ rv = 0;
+ }
+ break;
+@@ -867,7 +868,7 @@
+ goto DO_UNLOCK;
+ }
+
+- if (__fputc_unlocked('\n', stream) > 0) {
++ if (fputc_unlocked('\n', stream) > 0) {
+ rv = 0;
+ }
+
+diff -ur uClibc-0.9.29/libc/stdio/_scanf.c uClibc-0.9.29-patched/libc/stdio/_scanf.c
+--- uClibc-0.9.29/libc/stdio/_scanf.c 2007-01-20 12:32:10.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/_scanf.c 2007-05-09 18:05:21.642421481 -0500
+@@ -86,7 +86,8 @@
+ libc_hidden_proto(vsscanf)
+ libc_hidden_proto(fclose)
+ libc_hidden_proto(getc_unlocked)
+-libc_hidden_proto(__fgetc_unlocked)
++//#undef fgetc_unlocked
++libc_hidden_proto(fgetc_unlocked)
+ #ifdef __UCLIBC_HAS_WCHAR__
+ libc_hidden_proto(wcslen)
+ libc_hidden_proto(vfwscanf)
+diff -ur uClibc-0.9.29/libc/stdio/fgetc.c uClibc-0.9.29-patched/libc/stdio/fgetc.c
+--- uClibc-0.9.29/libc/stdio/fgetc.c 2006-01-15 16:41:03.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/fgetc.c 2007-05-09 18:05:21.642421481 -0500
+@@ -13,13 +13,13 @@
+ #undef getc
+ #undef getc_unlocked
+
+-libc_hidden_proto(__fgetc_unlocked)
++libc_hidden_proto(fgetc_unlocked)
+
+ #ifdef __DO_UNLOCKED
+
+ libc_hidden_proto(fflush_unlocked)
+
+-int __fgetc_unlocked(FILE *stream)
++int fgetc_unlocked(FILE *stream)
+ {
+ __STDIO_STREAM_VALIDATE(stream);
+
+@@ -73,26 +73,22 @@
+
+ return EOF;
+ }
+-libc_hidden_def(__fgetc_unlocked)
+-
+-libc_hidden_proto(fgetc_unlocked)
+-strong_alias(__fgetc_unlocked,fgetc_unlocked)
+ libc_hidden_def(fgetc_unlocked)
+
+ //libc_hidden_proto(__getc_unlocked)
+-//strong_alias(__fgetc_unlocked,__getc_unlocked)
++//strong_alias(fgetc_unlocked,__getc_unlocked)
+ //libc_hidden_def(__getc_unlocked)
+
+ libc_hidden_proto(getc_unlocked)
+-strong_alias(__fgetc_unlocked,getc_unlocked)
++strong_alias(fgetc_unlocked,getc_unlocked)
+ libc_hidden_def(getc_unlocked)
+
+ #ifndef __UCLIBC_HAS_THREADS__
+ libc_hidden_proto(fgetc)
+-strong_alias(__fgetc_unlocked,fgetc)
++strong_alias(fgetc_unlocked,fgetc)
+ libc_hidden_def(fgetc)
+
+-strong_alias(__fgetc_unlocked,getc)
++strong_alias(fgetc_unlocked,getc)
+ #endif
+
+ #elif defined __UCLIBC_HAS_THREADS__
+diff -ur uClibc-0.9.29/libc/stdio/fgets.c uClibc-0.9.29-patched/libc/stdio/fgets.c
+--- uClibc-0.9.29/libc/stdio/fgets.c 2006-01-15 16:41:03.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/fgets.c 2007-05-09 18:05:21.638421151 -0500
+@@ -10,8 +10,7 @@
+ libc_hidden_proto(fgets_unlocked)
+
+ #ifdef __DO_UNLOCKED
+-
+-libc_hidden_proto(__fgetc_unlocked)
++libc_hidden_proto(fgetc_unlocked)
+
+ char *fgets_unlocked(char *__restrict s, int n,
+ register FILE * __restrict stream)
+@@ -38,7 +37,7 @@
+ break;
+ }
+ } else {
+- if ((c = __fgetc_unlocked(stream)) == EOF) {
++ if ((c = fgetc_unlocked(stream)) == EOF) {
+ if (__FERROR_UNLOCKED(stream)) {
+ goto ERROR;
+ }
+diff -ur uClibc-0.9.29/libc/stdio/fputc.c uClibc-0.9.29-patched/libc/stdio/fputc.c
+--- uClibc-0.9.29/libc/stdio/fputc.c 2007-04-14 12:03:18.000000000 -0500
++++ uClibc-0.9.29-patched/libc/stdio/fputc.c 2007-05-09 20:50:51.350629927 -0500
+@@ -16,7 +16,7 @@
+
+ #ifdef __DO_UNLOCKED
+
+-int __fputc_unlocked(int c, register FILE *stream)
++int fputc_unlocked(int c, register FILE *stream)
+ {
+ __STDIO_STREAM_VALIDATE(stream);
+
+@@ -70,22 +70,22 @@
+ BAD:
+ return EOF;
+ }
+-libc_hidden_def(__fputc_unlocked)
++libc_hidden_def(fputc_unlocked)
+
+ /* exposing these would be fundamentally *wrong*! fix you, instead! */
+ /* libc_hidden_proto(fputc_unlocked) */
+-strong_alias(__fputc_unlocked,fputc_unlocked)
++/* strong_alias(__fputc_unlocked,fputc_unlocked) */
+ /* exposing these would be fundamentally *wrong*! fix you, instead! */
+ /* libc_hidden_def(fputc_unlocked) */
+
+ libc_hidden_proto(putc_unlocked)
+-strong_alias(__fputc_unlocked,putc_unlocked)
++strong_alias(fputc_unlocked,putc_unlocked)
+ libc_hidden_def(putc_unlocked)
+ #ifndef __UCLIBC_HAS_THREADS__
+-strong_alias(__fputc_unlocked,fputc)
++strong_alias(fputc_unlocked,fputc)
+
+ libc_hidden_proto(putc)
+-strong_alias(__fputc_unlocked,putc)
++strong_alias(fputc_unlocked,putc)
+ libc_hidden_def(putc)
+ #endif
+
+diff -ur uClibc-0.9.29/libc/stdio/getchar.c uClibc-0.9.29-patched/libc/stdio/getchar.c
+--- uClibc-0.9.29/libc/stdio/getchar.c 2006-12-19 22:30:25.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/getchar.c 2007-05-09 18:05:21.642421481 -0500
+@@ -7,7 +7,8 @@
+
+ #include "_stdio.h"
+
+-libc_hidden_proto(__fgetc_unlocked)
++//#undef fgetc_unlocked
++libc_hidden_proto(fgetc_unlocked)
+
+ #undef getchar
+ #ifdef __DO_UNLOCKED
+diff -ur uClibc-0.9.29/libc/stdio/getdelim.c uClibc-0.9.29-patched/libc/stdio/getdelim.c
+--- uClibc-0.9.29/libc/stdio/getdelim.c 2006-02-13 02:52:46.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/getdelim.c 2007-05-09 18:05:21.642421481 -0500
+@@ -11,8 +11,8 @@
+ #include "_stdio.h"
+
+ libc_hidden_proto(getdelim)
+-
+-libc_hidden_proto(__fgetc_unlocked)
++//#undef fgetc_unlocked
++libc_hidden_proto(fgetc_unlocked)
+
+ /* Note: There is a defect in this function. (size_t vs ssize_t). */
+
+diff -ur uClibc-0.9.29/libc/stdio/old_vfprintf.c uClibc-0.9.29-patched/libc/stdio/old_vfprintf.c
+--- uClibc-0.9.29/libc/stdio/old_vfprintf.c 2006-01-22 13:35:08.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/old_vfprintf.c 2007-05-09 18:05:21.642421481 -0500
+@@ -149,7 +149,8 @@
+ libc_hidden_proto(strnlen)
+ libc_hidden_proto(memcpy)
+ libc_hidden_proto(putc_unlocked)
+-libc_hidden_proto(__fputc_unlocked)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+ libc_hidden_proto(__glibc_strerror_r)
+
+ /* #undef __UCLIBC_HAS_FLOATS__ */
+diff -ur uClibc-0.9.29/libc/stdio/putchar.c uClibc-0.9.29-patched/libc/stdio/putchar.c
+--- uClibc-0.9.29/libc/stdio/putchar.c 2006-01-13 18:58:03.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/putchar.c 2007-05-09 18:05:21.642421481 -0500
+@@ -7,7 +7,8 @@
+
+ #include "_stdio.h"
+
+-libc_hidden_proto(__fputc_unlocked)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+
+ #undef putchar
+ #ifdef __DO_UNLOCKED
+diff -ur uClibc-0.9.29/libc/stdio/puts.c uClibc-0.9.29-patched/libc/stdio/puts.c
+--- uClibc-0.9.29/libc/stdio/puts.c 2006-01-13 18:58:03.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/puts.c 2007-05-09 18:05:21.642421481 -0500
+@@ -7,7 +7,8 @@
+
+ #include "_stdio.h"
+
+-libc_hidden_proto(__fputc_unlocked)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+ libc_hidden_proto(fputs_unlocked)
+
+ int puts(register const char * __restrict s)
+@@ -25,7 +26,7 @@
+ /* Note: Nonportable as fputs need only return nonnegative on success. */
+ if ((n = fputs_unlocked(s, stream)) != EOF) {
+ ++n;
+- if (__fputc_unlocked('\n', stream) == EOF) {
++ if (fputc_unlocked('\n', stream) == EOF) {
+ n = EOF;
+ }
+ }
+diff -ur uClibc-0.9.29/libc/stdio/putwchar.c uClibc-0.9.29-patched/libc/stdio/putwchar.c
+--- uClibc-0.9.29/libc/stdio/putwchar.c 2006-01-14 14:16:19.000000000 -0600
++++ uClibc-0.9.29-patched/libc/stdio/putwchar.c 2007-05-09 18:05:21.642421481 -0500
+@@ -22,7 +22,8 @@
+
+ #elif defined __UCLIBC_HAS_THREADS__
+
+-libc_hidden_proto(__fputc_unlocked)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+ /* psm: should this be fputwc? */
+ libc_hidden_proto(fputc)
+
+diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/bits/uClibc_stdio.h uClibc-0.9.29-patched/libc/sysdeps/linux/common/bits/uClibc_stdio.h
+--- uClibc-0.9.29/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2007-01-28 07:16:58.000000000 -0600
++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2007-05-09 20:56:02.408110608 -0500
+@@ -381,33 +381,29 @@
+ # define __FEOF(__stream) __FEOF_UNLOCKED(__stream)
+ #endif
+
+-extern int __fgetc_unlocked(FILE *__stream);
+-extern int __fputc_unlocked(int __c, FILE *__stream);
+-
+ /* First define the default definitions.
+ They are overridden below as necessary. */
+-#define __FGETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
++#define __FGETC_UNLOCKED(__stream) (fgetc_unlocked)((__stream))
+ #define __FGETC(__stream) (fgetc)((__stream))
+-#define __GETC_UNLOCKED_MACRO(__stream) (__fgetc_unlocked)((__stream))
+-#define __GETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
++#define __GETC_UNLOCKED_MACRO(__stream) (fgetc_unlocked)((__stream))
++#define __GETC_UNLOCKED(__stream) (fgetc_unlocked)((__stream))
+ #define __GETC(__stream) (fgetc)((__stream))
+
+-#define __FPUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
++#define __FPUTC_UNLOCKED(__c, __stream) (fputc_unlocked)((__c),(__stream))
+ #define __FPUTC(__c, __stream) (fputc)((__c),(__stream))
+-#define __PUTC_UNLOCKED_MACRO(__c, __stream) (__fputc_unlocked)((__c),(__stream))
+-#define __PUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
++#define __PUTC_UNLOCKED_MACRO(__c, __stream) (fputc_unlocked)((__c),(__stream))
++#define __PUTC_UNLOCKED(__c, __stream) (fputc_unlocked)((__c),(__stream))
+ #define __PUTC(__c, __stream) (fputc)((__c),(__stream))
+
+
+ #ifdef __STDIO_GETC_MACRO
+-
+ extern FILE *__stdin; /* For getchar() macro. */
+
+ # undef __GETC_UNLOCKED_MACRO
+ # define __GETC_UNLOCKED_MACRO(__stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \
+ ? (*(__stream)->__bufpos++) \
+- : __fgetc_unlocked(__stream) )
++ : fgetc_unlocked(__stream) )
+
+ # if 0
+ /* Classic macro approach. getc{_unlocked} can have side effects. */
+@@ -453,20 +449,17 @@
+ # endif
+ # endif
+
+-#else
+-
+ #endif /* __STDIO_GETC_MACRO */
+
+
+ #ifdef __STDIO_PUTC_MACRO
+-
+ extern FILE *__stdout; /* For putchar() macro. */
+
+ # undef __PUTC_UNLOCKED_MACRO
+ # define __PUTC_UNLOCKED_MACRO(__c, __stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \
+ ? (*(__stream)->__bufpos++) = (__c) \
+- : __fputc_unlocked((__c),(__stream)) )
++ : (fputc_unlocked((__c),(__stream)) )
+
+ # if 0
+ /* Classic macro approach. putc{_unlocked} can have side effects.*/
+@@ -489,7 +482,8 @@
+ }) )
+
+ # undef __PUTC_UNLOCKED
+-# define __PUTC_UNLOCKED(__c, __stream) __FPUTC_UNLOCKED((__c), (__stream))
++# define __PUTC_UNLOCKED(__c, __stream) \
++ __FPUTC_UNLOCKED((__c), (__stream))
+
+ # ifdef __UCLIBC_HAS_THREADS__
+ # undef __FPUTC
+diff -ur uClibc-0.9.29/libc/unistd/getpass.c uClibc-0.9.29-patched/libc/unistd/getpass.c
+--- uClibc-0.9.29/libc/unistd/getpass.c 2006-07-05 05:58:38.000000000 -0500
++++ uClibc-0.9.29-patched/libc/unistd/getpass.c 2007-05-09 18:05:21.642421481 -0500
+@@ -36,7 +36,8 @@
+ libc_hidden_proto(fputs)
+ libc_hidden_proto(fputc)
+ libc_hidden_proto(putc)
+-libc_hidden_proto(__fputc_unlocked)
++//#undef fputc_unlocked
++libc_hidden_proto(fputc_unlocked)
+
+ /* It is desirable to use this bit on systems that have it.
+ The only bit of terminal state we want to twiddle is echoing, which is
diff --git a/patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch b/patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch
new file mode 100644
index 0000000..7b246c1
--- /dev/null
+++ b/patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch
@@ -0,0 +1,12 @@
+diff -ur uClibc-0.9.29/libc/inet/resolv.c uClibc-0.9.29-patched/libc/inet/resolv.c
+--- uClibc-0.9.29/libc/inet/resolv.c 2007-04-23 12:01:05.000000000 -0500
++++ uClibc-0.9.29-patched/libc/inet/resolv.c 2007-05-09 18:05:33.563404419 -0500
+@@ -1700,7 +1700,7 @@
+ int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
+ struct hostent **result, int *h_errnop)
+ {
+- int ret;
++ int ret = HOST_NOT_FOUND;
+
+ __UCLIBC_MUTEX_LOCK(mylock);
+ if (__gethostent_fp == NULL) {
diff --git a/patches/uClibc/0.9.29/400-bits_sysnum_h.patch b/patches/uClibc/0.9.29/400-bits_sysnum_h.patch
new file mode 100644
index 0000000..595a22e
--- /dev/null
+++ b/patches/uClibc/0.9.29/400-bits_sysnum_h.patch
@@ -0,0 +1,33 @@
+YEM-20070519:
+bits/sysnum.h needs a cross compiler to be built. Fortunately, this
+header is not needed to build gcc. Move generation of this header.
+
+Index: uClibc/Makefile.in
+===================================================================
+--- uClibc/Makefile.in (revision 18651)
++++ uClibc/Makefile.in (working copy)
+@@ -91,6 +91,11 @@
+ $(LN) -fs $$i .; \
+ done; \
+ fi
++ifeq ($(UCLIBC_HAS_LOCALE),y)
++ $(MAKE) locale_headers
++endif
++
++pregen: headers
+ $(Q)\
+ set -e; \
+ cd $(top_builddir); \
+@@ -102,12 +107,7 @@
+ else \
+ mv -f $$tmp include/bits/sysnum.h; \
+ fi
+-ifeq ($(UCLIBC_HAS_LOCALE),y)
+- $(MAKE) locale_headers
+-endif
+
+-pregen: headers
+-
+ install: install_runtime install_dev
+
+
diff --git a/samples/armeb-unknown-linux-uclibc/crosstool.config b/samples/armeb-unknown-linux-uclibc/crosstool.config
index 5757a80..ebce9de 100644
--- a/samples/armeb-unknown-linux-uclibc/crosstool.config
+++ b/samples/armeb-unknown-linux-uclibc/crosstool.config
@@ -1,13 +1,13 @@
#
# Automatically generated make config: don't edit
# crosstool-NG version: 0.0.3-svn
-# Fri May 18 10:40:49 2007
+# Sun May 20 00:00:02 2007
#
#
# Paths and misc options
#
-CT_EXPERIMENTAL=y
+# CT_EXPERIMENTAL is not set
# CT_OBSOLETE is not set
CT_PARALLEL_JOBS=1
CT_LOAD=0
@@ -78,6 +78,7 @@ CT_ARCH_FPU=""
# CT_ARCH_FLOAT_HW is not set
CT_ARCH_FLOAT_SW=y
CT_ARCH_FLOAT_SW_LIBFLOAT=y
+CT_LIBFLOAT_VERSION="990616.orig"
CT_TARGET_CFLAGS=""
#
@@ -236,13 +237,10 @@ CT_CC_LANG_OTHERS=""
#
# CT_LIBC_GLIBC is not set
CT_LIBC_UCLIBC=y
-CT_LIBC_VERSION="0.9.28.3"
+CT_LIBC_VERSION="0.9.29"
CT_LIBC="uClibc"
# CT_LIBC_SUPPORT_NPTL is not set
CT_LIBC_SUPPORT_LINUXTHREADS=y
-# CT_LIBC_THREADS_NPTL is not set
-CT_LIBC_THREADS_LINUXTHREADS=y
-# CT_LIBC_THREADS_NONE is not set
# CT_LIBC_V_snapshot is not set
# CT_LIBC_V_specific_date is not set
# CT_LIBC_V_0_9_26 is not set
@@ -250,8 +248,8 @@ CT_LIBC_THREADS_LINUXTHREADS=y
# CT_LIBC_V_0_9_28 is not set
# CT_LIBC_V_0_9_28_1 is not set
# CT_LIBC_V_0_9_28_2 is not set
-CT_LIBC_V_0_9_28_3=y
-# CT_LIBC_V_0_9_29 is not set
+# CT_LIBC_V_0_9_28_3 is not set
+CT_LIBC_V_0_9_29=y
CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y
# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set
# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set
@@ -263,6 +261,4 @@ CT_LIBC_UCLIBC_CONFIG_FILE="${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_L
# Debug facilities
#
# CT_DMALLOC is not set
-# CT_DMALLOC_V_5_4_3 is not set
-# CT_DMALLOC_V_5_5_2 is not set
# CT_GDB is not set
diff --git a/samples/armeb-unknown-linux-uclibc/uClibc-0.9.28.3.config b/samples/armeb-unknown-linux-uclibc/uClibc-0.9.29.config
index 92c4faf..d6448af 100644
--- a/samples/armeb-unknown-linux-uclibc/uClibc-0.9.28.3.config
+++ b/samples/armeb-unknown-linux-uclibc/uClibc-0.9.29.config
@@ -1,5 +1,6 @@
#
# Automatically generated make config: don't edit
+# Sat May 19 21:51:09 2007
#
# TARGET_alpha is not set
TARGET_arm=y
@@ -8,8 +9,10 @@ TARGET_arm=y
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
+# TARGET_hppa is not set
# TARGET_i386 is not set
# TARGET_i960 is not set
+# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
@@ -20,36 +23,49 @@ TARGET_arm=y
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
+# TARGET_vax is not set
# TARGET_x86_64 is not set
#
# Target Architecture Features and Options
#
-HAVE_ELF=y
-ARCH_SUPPORTS_LITTLE_ENDIAN=y
TARGET_ARCH="arm"
-ARCH_SUPPORTS_BIG_ENDIAN=y
+FORCE_OPTIONS_FOR_ARCH=y
+CONFIG_ARM_OABI=y
+# CONFIG_ARM_EABI is not set
+USE_BX=y
# CONFIG_GENERIC_ARM is not set
# CONFIG_ARM610 is not set
# CONFIG_ARM710 is not set
+# CONFIG_ARM7TDMI is not set
# CONFIG_ARM720T is not set
# CONFIG_ARM920T is not set
# CONFIG_ARM922T is not set
# CONFIG_ARM926T is not set
+# CONFIG_ARM10T is not set
# CONFIG_ARM1136JF_S is not set
+# CONFIG_ARM1176JZ_S is not set
+# CONFIG_ARM1176JZF_S is not set
# CONFIG_ARM_SA110 is not set
# CONFIG_ARM_SA1100 is not set
CONFIG_ARM_XSCALE=y
-# ARCH_LITTLE_ENDIAN is not set
+# CONFIG_ARM_IWMMXT is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
ARCH_BIG_ENDIAN=y
-# ARCH_HAS_NO_MMU is not set
+ARCH_WANTS_BIG_ENDIAN=y
+# ARCH_WANTS_LITTLE_ENDIAN is not set
ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
-# HAS_FPU is not set
+# UCLIBC_HAS_FPU is not set
UCLIBC_HAS_SOFT_FLOAT=y
DO_C99_MATH=y
-KERNEL_SOURCE="/usr/src/linux"
-C_SYMBOL_PREFIX=""
+KERNEL_HEADERS="/usr/include"
HAVE_DOT_CONFIG=y
#
@@ -58,28 +74,32 @@ HAVE_DOT_CONFIG=y
# HAVE_NO_PIC is not set
DOPIC=y
# HAVE_NO_SHARED is not set
-HAVE_SHARED=y
# ARCH_HAS_NO_LDSO is not set
-BUILD_UCLIBC_LDSO=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+HAVE_SHARED=y
+FORCE_SHAREABLE_TEXT_SEGMENTS=y
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
+UCLIBC_STATIC_LDCONFIG=y
# LDSO_RUNPATH is not set
-# DL_FINI_CRT_COMPAT is not set
UCLIBC_CTOR_DTOR=y
# HAS_NO_THREADS is not set
UCLIBC_HAS_THREADS=y
# PTHREADS_DEBUG_SUPPORT is not set
+LINUXTHREADS_OLD=y
UCLIBC_HAS_LFS=y
-UCLIBC_STATIC_LDCONFIG=y
# MALLOC is not set
# MALLOC_SIMPLE is not set
MALLOC_STANDARD=y
# MALLOC_GLIBC_COMPAT is not set
UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
+# COMPAT_ATEXIT is not set
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+UCLIBC_HAS_SHADOW=y
+# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
+# UCLIBC_HAS___PROGNAME is not set
UNIX98PTY_ONLY=y
ASSUME_DEVPTS=y
UCLIBC_HAS_TM_EXTENSIONS=y
@@ -89,11 +109,20 @@ UCLIBC_HAS_TZ_FILE=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
# Networking Support
#
# UCLIBC_HAS_IPV6 is not set
UCLIBC_HAS_RPC=y
UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+# UCLIBC_HAS_BSD_RES_CLOSE is not set
#
# String and Stdio Support
@@ -135,14 +164,19 @@ UCLIBC_HAS_ERRNO_MESSAGES=y
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
+# UCLIBC_HAS_GNU_GETSUBOPT is not set
#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
UCLIBC_HAS_WORDEXP=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_GLOB=y
+# UCLIBC_HAS_GNU_GLOB is not set
#
# Library Installation Options
@@ -152,18 +186,29 @@ RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/"
DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/"
#
-# uClibc security related options
+# Security options
#
-# UCLIBC_SECURITY is not set
+UCLIBC_BUILD_PIE=y
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+# UCLIBC_BUILD_RELRO is not set
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
#
# uClibc development/debugging options
#
CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DODEBUG_PT is not set
+# DOSTRIP is not set
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
# UCLIBC_MJN3_ONLY is not set
diff --git a/scripts/build/libc_uClibc.sh b/scripts/build/libc_uClibc.sh
index 1b8f99e..aaeb46c 100644
--- a/scripts/build/libc_uClibc.sh
+++ b/scripts/build/libc_uClibc.sh
@@ -142,32 +142,46 @@ mungeuClibcConfig() {
config_file="$1"
munge_file="${CT_BUILD_DIR}/munge-uClibc-config.sed"
+ # Hack our target in the config file.
+ # Also remove stripping: its the responsibility of the
+ # firmware builder to strip or not.
cat > "${munge_file}" <<-ENDSED
s/^(TARGET_.*)=y$/# \\1 is not set/
s/^# TARGET_${CT_KERNEL_ARCH} is not set/TARGET_${CT_KERNEL_ARCH}=y/
s/^TARGET_ARCH=".*"/TARGET_ARCH="${CT_KERNEL_ARCH}"/
+s/.*(DOSTRIP).*/# \\1 is not set/
ENDSED
+ # Accomodate for old and new uClibc versions, where the
+ # way to select between big/little endian has changed
case "${CT_ARCH_BE},${CT_ARCH_LE}" in
y,) cat >> "${munge_file}" <<-ENDSED
-s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
s/.*(ARCH_LITTLE_ENDIAN).*/# \\1 is not set/
+s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
+s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/# \\1 is not set/
+s/.*(ARCH_WANTS_BIG_ENDIAN).*/\\1=y/
ENDSED
;;
,y) cat >> "${munge_file}" <<-ENDSED
-s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
s/.*(ARCH_LITTLE_ENDIAN).*/\\1=y/
+s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
+s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/\\1=y/
+s/.*(ARCH_WANTS_BIG_ENDIAN).*/# \\1 is not set/
ENDSED
;;
esac
+ # Accomodate for old and new uClibc version, where the
+ # way to select between hard/soft float has changed
case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
y,) cat >> "${munge_file}" <<-ENDSED
s/.*(HAS_FPU).*/\\1=y/
+s/.*(UCLIBC_HAS_FPU).*/\\1=y/
ENDSED
;;
,y) cat >> "${munge_file}" <<-ENDSED
s/.*(HAS_FPU).*/\\# \\1 is not set/
+s/.*(UCLIBC_HAS_FPU).*/# \\1 is not set/
ENDSED
;;
esac
@@ -191,12 +205,19 @@ s/^KERNEL_HEADERS=".*"/KERNEL_HEADERS="${quoted_headers_dir}"/
s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/
ENDSED
- # Hack our -pipe into WARNINGS, which will be internally incorporated to
- # CFLAGS. This a dirty hack, but yet needed
if [ "${CT_USE_PIPES}" = "y" ]; then
- cat >> "${munge_file}" <<-ENDSED
+ if grep UCLIBC_EXTRA_CFLAGS extra/Configs/Config.in >/dev/null 2>&1; then
+ # Good, there is special provision for such things as -pipe!
+ cat >> "${munge_file}" <<-ENDSED
+s/^(UCLIBC_EXTRA_CFLAGS=".*)"$/\\1 -pipe"/
+ENDSED
+ else
+ # Hack our -pipe into WARNINGS, which will be internally incorporated to
+ # CFLAGS. This a dirty hack, but yet needed
+ cat >> "${munge_file}" <<-ENDSED
s/^(WARNINGS=".*)"$/\\1 -pipe"/
ENDSED
+ fi
fi
# Force on options needed for C++ if we'll be making a C++ compiler.
@@ -227,6 +248,7 @@ s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
s/^DOASSERTS=y/# DOASSERTS is not set/
s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
+s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
ENDSED
;;
1)
@@ -237,6 +259,7 @@ s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
s/^DOASSERTS=y/# DOASSERTS is not set/
s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
+s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
ENDSED
;;
2)
@@ -247,6 +270,7 @@ s/^# DODEBUG_PT is not set.*/DODEBUG_PT=y/
s/^# DOASSERTS is not set.*/DOASSERTS=y/
s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
s/^# SUPPORT_LD_DEBUG_EARLY is not set.*/SUPPORT_LD_DEBUG_EARLY=y/
+s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
ENDSED
;;
esac
diff --git a/scripts/build/libfloat.sh b/scripts/build/libfloat.sh
index e80e393..b557404 100644
--- a/scripts/build/libfloat.sh
+++ b/scripts/build/libfloat.sh
@@ -14,7 +14,7 @@ do_libfloat_get() {
ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat
CT_Pushd "${CT_TARBALLS_DIR}"
ext=`CT_GetFileExtension "${libfloat_file}"`
- ln -s "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}"
+ ln -svf "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}" |CT_DoLog DEBUG
CT_Popd
}
diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh
index d7f27f3..1771ba8 100755
--- a/scripts/saveSample.sh
+++ b/scripts/saveSample.sh
@@ -30,7 +30,13 @@ CT_DoBuildTargetTriplet
. "${CT_TOP_DIR}/.config"
# Create the sample directory
-[ -d "${CT_TOP_DIR}/samples/${CT_TARGET}" ] || svn mkdir "${CT_TOP_DIR}/samples/${CT_TARGET}" >/dev/null 2>&1
+# In case it was manually made, add it to svn
+if [ -d "${CT_TOP_DIR}/samples/${CT_TARGET}" ]; then
+ # svn won't fail when adding a directory already managed by svn
+ svn add "${CT_TOP_DIR}/samples/${CT_TARGET}" >/dev/null 2>&1
+else
+ svn mkdir "${CT_TOP_DIR}/samples/${CT_TARGET}" >/dev/null 2>&1
+fi
# Save the crosstool-NG config file
cp "${CT_TOP_DIR}/.config" "${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config"
@@ -42,7 +48,7 @@ CT_DoAddFileToSample() {
source="$1"
dest="$2"
inode_s=`ls -i "${source}"`
- inode_d=`ls -i "${dest}"`
+ inode_d=`ls -i "${dest}" 2>/dev/null || true`
if [ "${inode_s}" != "${inode_d}" ]; then
cp "${source}" "${dest}"
fi