diff --git a/base/uclibc/uClibc-0.9.33-git.patch b/base/uclibc/uClibc-0.9.33-git.patch new file mode 100644 index 000000000..fb4b85c0e --- /dev/null +++ b/base/uclibc/uClibc-0.9.33-git.patch @@ -0,0 +1,349 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../uclibc/uClibc-0.9.33-git.patch +# Copyright (C) 2012 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +diff --git a/Rules.mak b/Rules.mak +index ceb6d08..f474236 100644 +--- a/Rules.mak ++++ b/Rules.mak +@@ -105,7 +105,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR + MAJOR_VERSION := 0 + MINOR_VERSION := 9 + SUBLEVEL := 33 +-EXTRAVERSION := ++EXTRAVERSION :=.1-git + VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) + ABI_VERSION := $(MAJOR_VERSION) + ifneq ($(EXTRAVERSION),) +diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c +index 086a059..51bcf7d 100644 +--- a/ldso/libdl/libdl.c ++++ b/ldso/libdl/libdl.c +@@ -1011,6 +1011,8 @@ static int do_dlclose(void *vhandle, int need_fini) + } + } + free(tpnt->libname); ++ if (handle->dyn != tpnt) ++ free(tpnt->symbol_scope.r_list); + free(tpnt); + } + } +diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c +index 951e76b..bebd5a6 100644 +--- a/libc/signal/sigfillset.c ++++ b/libc/signal/sigfillset.c +@@ -19,6 +19,9 @@ + #include + #include + #include ++#ifdef __UCLIBC_HAS_THREADS_NATIVE__ ++# include /* SIGCANCEL */ ++#endif + + + /* Set all signals in SET. */ +diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch +index cd1710a..cc73c45 100644 +--- a/libc/sysdeps/linux/arm/Makefile.arch ++++ b/libc/sysdeps/linux/arm/Makefile.arch +@@ -22,7 +22,7 @@ endif + + # Is our compiler set up for EABI ? + IS_EABI:=$(shell $(CC) $(CFLAGS) -x c - -E -dM /dev/null \ +- |sed -r -e '/^\#[[:space:]]*define[[:space:]]+__ARM_EABI__([[:space:]]+1)?$$/!d; s/.+/y/;' \ ++ | grep __ARM_EABI__ 2>&1 >/dev/null && echo 'y' \ + ) + + ifeq ($(IS_EABI),y) +diff --git a/libc/sysdeps/linux/c6x/sigaction.c b/libc/sysdeps/linux/c6x/sigaction.c +index c65a85d..ed90f05 100644 +--- a/libc/sysdeps/linux/c6x/sigaction.c ++++ b/libc/sysdeps/linux/c6x/sigaction.c +@@ -28,6 +28,9 @@ + #include + #include + #include ++#ifdef __UCLIBC_HAS_THREADS_NATIVE__ ++# include /* SIGCANCEL */ ++#endif + + #define SA_RESTORER 0x04000000 + +diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c +index 26860d2..d9f3260 100644 +--- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c ++++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c +@@ -16,6 +16,7 @@ + + # ifdef __UCLIBC_HAS_THREADS_NATIVE__ + # include ++# include /* SIGCANCEL */ + + static int do_sigtimedwait(const sigset_t *set, siginfo_t *info, + const struct timespec *timeout) +diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h +index faebd1b..0f5a929 100644 +--- a/libc/sysdeps/linux/common/bits/syscalls-common.h ++++ b/libc/sysdeps/linux/common/bits/syscalls-common.h +@@ -59,8 +59,8 @@ + #ifndef INLINE_SYSCALL_NOERR_NCS + # define INLINE_SYSCALL_NOERR_NCS(name, nr, args...) \ + ({ \ +- /*INTERNAL_SYSCALL_DECL(__err);*/ \ +- long __res = INTERNAL_SYSCALL_NCS(name, /*__err*/, nr, args); \ ++ INTERNAL_SYSCALL_DECL(__err); \ ++ long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args); \ + __res; \ + }) + #endif +diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c +index acc639b..4726a68 100644 +--- a/libc/sysdeps/linux/common/fstat.c ++++ b/libc/sysdeps/linux/common/fstat.c +@@ -12,18 +12,28 @@ + #include + #include "xstatconv.h" + +-#define __NR___syscall_fstat __NR_fstat +-static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf) +- + int fstat(int fd, struct stat *buf) + { + int result; ++#ifdef __NR_fstat64 ++ /* normal stat call has limited values for various stat elements ++ * e.g. uid device major/minor etc. ++ * so we use 64 variant if available ++ * in order to get newer versions of stat elements ++ */ ++ struct kernel_stat64 kbuf; ++ result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf); ++ if (result == 0) { ++ __xstat32_conv(&kbuf, buf); ++ } ++#else + struct kernel_stat kbuf; + +- result = __syscall_fstat(fd, &kbuf); ++ result = INLINE_SYSCALL(fstat, 2, fd, &kbuf); + if (result == 0) { + __xstat_conv(&kbuf, buf); + } ++#endif + return result; + } + libc_hidden_def(fstat) +diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c +index aa77447..db72d1f 100644 +--- a/libc/sysdeps/linux/common/lstat.c ++++ b/libc/sysdeps/linux/common/lstat.c +@@ -12,19 +12,28 @@ + #include + #include "xstatconv.h" + +-#define __NR___syscall_lstat __NR_lstat +-static __inline__ _syscall2(int, __syscall_lstat, +- const char *, file_name, struct kernel_stat *, buf) +- + int lstat(const char *file_name, struct stat *buf) + { + int result; ++#ifdef __NR_lstat64 ++ /* normal stat call has limited values for various stat elements ++ * e.g. uid device major/minor etc. ++ * so we use 64 variant if available ++ * in order to get newer versions of stat elements ++ */ ++ struct kernel_stat64 kbuf; ++ result = INLINE_SYSCALL(lstat64, 2, file_name, &kbuf); ++ if (result == 0) { ++ __xstat32_conv(&kbuf, buf); ++ } ++#else + struct kernel_stat kbuf; + +- result = __syscall_lstat(file_name, &kbuf); ++ result = INLINE_SYSCALL(lstat, 2, file_name, &kbuf); + if (result == 0) { + __xstat_conv(&kbuf, buf); + } ++#endif + return result; + } + libc_hidden_def(lstat) +diff --git a/libc/sysdeps/linux/common/sigprocmask.c b/libc/sysdeps/linux/common/sigprocmask.c +index 011d7b3..bc3e64d 100644 +--- a/libc/sysdeps/linux/common/sigprocmask.c ++++ b/libc/sysdeps/linux/common/sigprocmask.c +@@ -11,6 +11,9 @@ + + #if defined __USE_POSIX + #include ++#ifdef __UCLIBC_HAS_THREADS_NATIVE__ ++# include /* SIGCANCEL */ ++#endif + + #undef sigprocmask + +diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c +index a6ab291..829f35a 100644 +--- a/libc/sysdeps/linux/common/stat.c ++++ b/libc/sysdeps/linux/common/stat.c +@@ -12,20 +12,30 @@ + #include + #include "xstatconv.h" + +-#define __NR___syscall_stat __NR_stat + #undef stat +-static __inline__ _syscall2(int, __syscall_stat, +- const char *, file_name, struct kernel_stat *, buf) + + int stat(const char *file_name, struct stat *buf) + { + int result; ++#ifdef __NR_stat64 ++ /* normal stat call has limited values for various stat elements ++ * e.g. uid device major/minor etc. ++ * so we use 64 variant if available ++ * in order to get newer versions of stat elements ++ */ ++ struct kernel_stat64 kbuf; ++ result = INLINE_SYSCALL(stat64, 2, file_name, &kbuf); ++ if (result == 0) { ++ __xstat32_conv(&kbuf, buf); ++ } ++#else + struct kernel_stat kbuf; + +- result = __syscall_stat(file_name, &kbuf); ++ result = INLINE_SYSCALL(stat, 2, file_name, &kbuf); + if (result == 0) { + __xstat_conv(&kbuf, buf); + } ++#endif + return result; + } + libc_hidden_def(stat) +diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in +index 79765e9..add3a8e 100644 +--- a/libpthread/nptl/sysdeps/pthread/Makefile.in ++++ b/libpthread/nptl/sysdeps/pthread/Makefile.in +@@ -33,17 +33,12 @@ libpthread_pthread_CSRC = \ + pthread_spin_init.c \ + pthread_spin_unlock.c \ + pt-longjmp.c \ +- pt-sigaction.c \ +- pt-sigfillset.c \ +- pt-sigprocmask.c \ + tpp.c + CFLAGS-pthread = $(SSP_ALL_CFLAGS) -DNOT_IN_libc -DIS_IN_libpthread + CFLAGS-pthread_barrier_wait.c = -D_GNU_SOURCE + CFLAGS-pthread_spin_destroy.c = -D_GNU_SOURCE + CFLAGS-pthread_spin_init.c = -D_GNU_SOURCE + CFLAGS-pthread_spin_unlock.c = -D_GNU_SOURCE +-CFLAGS-pt-sigfillset.c = -I$(top_srcdir)libc/signal +-CFLAGS-pt-sigprocmask.c = -I$(top_srcdir)libc/sysdeps/linux/common + CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables + + CFLAGS-OMIT-librt-cancellation.c = -DIS_IN_libpthread +@@ -53,8 +48,7 @@ CFLAGS-librt-cancellation.c = -DIS_IN_librt \ + CFLAGS-rt-unwind-resume.c = -DIS_IN_librt \ + -fexceptions -fasynchronous-unwind-tables + +-libpthread-so-y += $(patsubst %,$(libpthread_pthread_OUT)/%.oS, \ +- pt-sigaction pt-sigprocmask unwind-forcedunwind) ++libpthread-so-y += $(patsubst %,$(libpthread_pthread_OUT)/%.oS, unwind-forcedunwind) + + librt-pt-routines-y = librt-cancellation.c + librt-pt-shared-only-routines-y = rt-unwind-resume.c +@@ -104,26 +98,9 @@ $(libpthread_pthread_OUT)/pt-crtn.S: $(libpthread_pthread_OUT)/pt-initfini.s $(l + -e '/@TRAILER_BEGINS/,$$p' $< > $@.tmp + $(Q)mv $@.tmp $@ + endif +-# It would have been easier to just add dummy files that include the real +-# impl, but ok. +-# Special rules needed since we do objdir->objdir compilation for these 3. +-# First symlink them, then build them. Rob would freak out on these. Sheesh! ;) +-pthread-lc-fwd = sigfillset sigprocmask +-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.c,$(pthread-lc-fwd)): | $(libpthread_pthread_OUT) +- $(do_ln) $(call rel_srcdir)$(patsubst pt-%,$(libpthread_pthread_DIR)/%,$(@F)) $@ +-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.oS,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.oS: $(libpthread_pthread_OUT)/pt-%.c +- $(compile.c) +-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.o,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.o: $(libpthread_pthread_OUT)/pt-%.c +- $(compile.c) +-ifeq ($(DOPIC),y) +-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.os,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.os: $(libpthread_pthread_OUT)/pt-%.c +- $(compile.c) +-endif + + objclean-y += CLEAN_libpthread/nptl/sysdeps/pthread + + CLEAN_libpthread/nptl/sysdeps/pthread: + $(do_rm) $(addprefix $(libpthread_pthread_OUT)/*., o os oS s S) \ +- $(libpthread_pthread_OUT)/defs.h \ +- $(addprefix $(libpthread_pthread_DIR)/, \ +- pt-sigfillset.c pt-sigprocmask.c) ++ $(libpthread_pthread_OUT)/defs.h +diff --git a/test/Rules.mak b/test/Rules.mak +index 900ff44..b5eb20b 100644 +--- a/test/Rules.mak ++++ b/test/Rules.mak +@@ -94,7 +94,7 @@ endif + + ifeq ($(LDSO_GNU_HASH_SUPPORT),y) + # Check for binutils support is done on root Rules.mak +-LDFLAGS += -Wl,${LDFLAGS_GNUHASH} ++LDFLAGS += $(CFLAG_-Wl--hash-style=gnu) + endif + + +diff --git a/test/stat/stat-loop256.c b/test/stat/stat-loop256.c +new file mode 100644 +index 0000000..14284c1 +--- /dev/null ++++ b/test/stat/stat-loop256.c +@@ -0,0 +1,32 @@ ++#include ++#include ++#include ++#include ++int main() ++{ ++ struct stat statbuf; ++ int ret = 0; ++ char* loop255 = "/dev/loop255"; ++ char* loop256 = "/dev/loop256"; ++ mode_t mode = 0660; ++ mknod(loop255, mode, 0x7ff); ++ mknod(loop256, mode, 0x100700); ++ ret = stat(loop255, &statbuf); ++ if(ret < 0) { ++ printf("stat: Cant stat %s\n",loop255); ++ unlink(loop255); ++ exit(1); ++ } ++ ret = stat(loop256, &statbuf); ++ if(ret < 0) { ++ printf("stat: Cant stat %s\n",loop256); ++ unlink(loop255); ++ unlink(loop256); ++ exit(1); ++ } ++ ++ unlink(loop255); ++ unlink(loop256); ++ exit(0); ++} ++