[packages/uClibc-ng] Drop old patches.

arekm arekm at pld-linux.org
Mon Jun 16 21:06:06 CEST 2025


commit 7f67dfeb2513ff2a2132717e136193c3e1c48535
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Jun 16 20:56:24 2025 +0200

    Drop old patches.

 hash-style-detect.patch        |  11 -
 uClibc-debug.patch             |  11 -
 uClibc-features.patch          |  12 -
 uClibc-kernel-types.patch      | 365 -------------------
 uClibc-newsoname.patch         | 161 --------
 uClibc-stdio-unhide.patch      |  22 --
 uClibc-targetcpu.patch         |  78 ----
 uClibc-toolchain-wrapper.patch | 807 -----------------------------------------
 8 files changed, 1467 deletions(-)
---
diff --git a/hash-style-detect.patch b/hash-style-detect.patch
deleted file mode 100644
index f5245f2..0000000
--- a/hash-style-detect.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- uClibc-0.9.33.2/Rules.mak~	2022-04-22 10:04:03.000000000 +0200
-+++ uClibc-0.9.33.2/Rules.mak	2022-04-22 10:08:16.933174949 +0200
-@@ -170,7 +170,7 @@ check_as=$(shell \
- 	if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
- 	then echo "-Wa,$(1)"; fi)
- check_ld=$(shell \
--	if $(LD) $(1) -o /dev/null -b binary /dev/null > /dev/null 2>&1; \
-+	if $(LD) $(1) -o /dev/null -b binary /dev/zero > /dev/null 2>&1; \
- 	then echo "$(1)"; fi)
- 
- # Use variable indirection here so that we can have variable
diff --git a/uClibc-debug.patch b/uClibc-debug.patch
deleted file mode 100644
index 1de39c6..0000000
--- a/uClibc-debug.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- uClibc-0.9.32/Rules.mak.orig	2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/Rules.mak	2011-06-12 09:22:09.454050098 +0200
-@@ -624,7 +624,7 @@
- 
- LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
- ifeq ($(DODEBUG),y)
--CFLAGS += -O0 -g3 -DDEBUG
-+CFLAGS += $(OPTIMIZATION) -O0 -g3 -DDEBUG
- else
- CFLAGS += $(OPTIMIZATION)
- endif
diff --git a/uClibc-features.patch b/uClibc-features.patch
deleted file mode 100644
index aa43116..0000000
--- a/uClibc-features.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN uClibc-0.9.33.2.org/include/features.h uClibc-0.9.33.2/include/features.h
---- uClibc-0.9.33.2.org/include/features.h	2012-05-15 09:20:09.000000000 +0200
-+++ uClibc-0.9.33.2/include/features.h	2017-07-26 11:04:32.749757294 +0200
-@@ -139,6 +139,8 @@
- # define __GNUC_PREREQ(maj, min) 0
- #endif
- 
-+/* Whether to use feature set F.  */
-+#define __GLIBC_USE(F) __GLIBC_USE_ ## F
- 
- /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX.  */
- #if defined _BSD_SOURCE && \
diff --git a/uClibc-kernel-types.patch b/uClibc-kernel-types.patch
deleted file mode 100644
index b194aed..0000000
--- a/uClibc-kernel-types.patch
+++ /dev/null
@@ -1,365 +0,0 @@
-commit 6a76edddaa62ff06f178143b582167734cb55c18
-Author: Chris Packham <chris.packham at alliedtelesis.co.nz>
-Date:   Mon Oct 1 18:12:54 2012 +1300
-
-    libc/sysdeps: add __kernel_long and __kernel_ulong
-    
-    Linux 3.4 added __kernel_long_t and __kernel_ulong_t and various
-    exported header files were updated to use these new types. Add the
-    definitions for __kernel_long_t and __kernel_ulong_t to the relevant
-    kernel_types.h headers.
-    
-    This change was automated with the following scriptlet
-    
-      git grep --name-only 'typedef.*__kernel_old_dev_t' \
-        | xargs sed -i '/typedef.*__kernel_old_dev_t/ a\
-      typedef long\t\t__kernel_long_t;\
-      typedef unsigned long\t__kernel_ulong_t;'
-    
-    Whitespace in arm, avr32, hppa, sparc was then manually fixed up.
-    
-    Signed-off-by: Chris Packham <chris.packham at alliedtelesis.co.nz>
-    --
-    Here's a cleaned up patch which should get the whitespace right. I'm a
-    bit iffy about the sparc changes they make sense to me but it's not a
-    platform I have access to.
-    
-    I can break this up per arch or per maintainer if requested.
-    
-     libc/sysdeps/linux/alpha/bits/kernel_types.h      |    2 ++
-     libc/sysdeps/linux/arm/bits/kernel_types.h        |    2 ++
-     libc/sysdeps/linux/avr32/bits/kernel_types.h      |    2 ++
-     libc/sysdeps/linux/bfin/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/c6x/bits/kernel_types.h        |    2 ++
-     libc/sysdeps/linux/cris/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/e1/bits/kernel_types.h         |    2 ++
-     libc/sysdeps/linux/h8300/bits/kernel_types.h      |    2 ++
-     libc/sysdeps/linux/hppa/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/i386/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/ia64/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/m68k/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/microblaze/bits/kernel_types.h |    2 ++
-     libc/sysdeps/linux/mips/bits/kernel_types.h       |    4 ++++
-     libc/sysdeps/linux/nios2/bits/kernel_types.h      |    2 ++
-     libc/sysdeps/linux/powerpc/bits/kernel_types.h    |    4 ++++
-     libc/sysdeps/linux/sh/bits/kernel_types.h         |    2 ++
-     libc/sysdeps/linux/sh64/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/sparc/bits/kernel_types.h      |    4 ++++
-     libc/sysdeps/linux/v850/bits/kernel_types.h       |    2 ++
-     libc/sysdeps/linux/x86_64/bits/kernel_types.h     |    2 ++
-     libc/sysdeps/linux/xtensa/bits/kernel_types.h     |    2 ++
-     22 files changed, 50 insertions(+)
-    Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
-
-diff --git a/libc/sysdeps/linux/alpha/bits/kernel_types.h b/libc/sysdeps/linux/alpha/bits/kernel_types.h
-index d5574c9..cd59b9d 100644
---- a/libc/sysdeps/linux/alpha/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/alpha/bits/kernel_types.h
-@@ -33,6 +33,8 @@ typedef __kernel_gid_t __kernel_old_gid_t;
- typedef __kernel_uid_t __kernel_uid32_t;
- typedef __kernel_gid_t __kernel_gid32_t;
- typedef __kernel_dev_t __kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- typedef struct {
- 	int val[2];
-diff --git a/libc/sysdeps/linux/arm/bits/kernel_types.h b/libc/sysdeps/linux/arm/bits/kernel_types.h
-index 766a306..6b36f32 100644
---- a/libc/sysdeps/linux/arm/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/arm/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned short		__kernel_old_uid_t;
- typedef unsigned short		__kernel_old_gid_t;
- typedef long long		__kernel_loff_t;
- typedef __kernel_dev_t		__kernel_old_dev_t;
-+typedef long			__kernel_long_t;
-+typedef unsigned long		__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/avr32/bits/kernel_types.h b/libc/sysdeps/linux/avr32/bits/kernel_types.h
-index f7d8b52..c551d57 100644
---- a/libc/sysdeps/linux/avr32/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/avr32/bits/kernel_types.h
-@@ -39,6 +39,8 @@ typedef unsigned int		__kernel_gid32_t;
- typedef unsigned short		__kernel_old_uid_t;
- typedef unsigned short		__kernel_old_gid_t;
- typedef unsigned short		__kernel_old_dev_t;
-+typedef long			__kernel_long_t;
-+typedef unsigned long		__kernel_ulong_t;
- 
- #ifdef __GNUC__
- typedef long long		__kernel_loff_t;
-diff --git a/libc/sysdeps/linux/bfin/bits/kernel_types.h b/libc/sysdeps/linux/bfin/bits/kernel_types.h
-index d69a875..9fec595 100644
---- a/libc/sysdeps/linux/bfin/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/bfin/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef long long	__kernel_loff_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/c6x/bits/kernel_types.h b/libc/sysdeps/linux/c6x/bits/kernel_types.h
-index 7557309..2c363a8 100644
---- a/libc/sysdeps/linux/c6x/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/c6x/bits/kernel_types.h
-@@ -22,6 +22,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned int	__kernel_old_uid_t;
- typedef unsigned int	__kernel_old_gid_t;
- typedef unsigned int	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef unsigned int	__kernel_size_t;
- typedef int		__kernel_ssize_t;
- typedef int		__kernel_ptrdiff_t;
-diff --git a/libc/sysdeps/linux/cris/bits/kernel_types.h b/libc/sysdeps/linux/cris/bits/kernel_types.h
-index f122c7f..5d31f7b 100644
---- a/libc/sysdeps/linux/cris/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/cris/bits/kernel_types.h
-@@ -28,6 +28,8 @@ typedef unsigned int    __kernel_gid32_t;
- typedef unsigned short  __kernel_old_uid_t;
- typedef unsigned short  __kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- #ifdef __GNUC__
- typedef long long	__kernel_loff_t;
-diff --git a/libc/sysdeps/linux/e1/bits/kernel_types.h b/libc/sysdeps/linux/e1/bits/kernel_types.h
-index 8017d85..f55a129 100644
---- a/libc/sysdeps/linux/e1/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/e1/bits/kernel_types.h
-@@ -31,6 +31,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- /*
-diff --git a/libc/sysdeps/linux/h8300/bits/kernel_types.h b/libc/sysdeps/linux/h8300/bits/kernel_types.h
-index 0570675..4cfd1bf 100644
---- a/libc/sysdeps/linux/h8300/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/h8300/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef long long	__kernel_loff_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/hppa/bits/kernel_types.h b/libc/sysdeps/linux/hppa/bits/kernel_types.h
-index 4441f9b..6b2e794 100644
---- a/libc/sysdeps/linux/hppa/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/hppa/bits/kernel_types.h
-@@ -45,6 +45,8 @@ typedef long long		__kernel_off64_t;
- typedef unsigned long long	__kernel_ino64_t;
- 
- typedef unsigned int		__kernel_old_dev_t;
-+typedef long			__kernel_long_t;
-+typedef unsigned long		__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/i386/bits/kernel_types.h b/libc/sysdeps/linux/i386/bits/kernel_types.h
-index 9c07c72..59044b8 100644
---- a/libc/sysdeps/linux/i386/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/i386/bits/kernel_types.h
-@@ -40,6 +40,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- typedef struct {
-diff --git a/libc/sysdeps/linux/ia64/bits/kernel_types.h b/libc/sysdeps/linux/ia64/bits/kernel_types.h
-index c8ef86d..e31dc65 100644
---- a/libc/sysdeps/linux/ia64/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/ia64/bits/kernel_types.h
-@@ -52,5 +52,7 @@ typedef __kernel_gid_t __kernel_gid32_t;
- 
- typedef unsigned int	__kernel_dev_t;
- typedef unsigned int	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- #endif /* _ASM_IA64_POSIX_TYPES_H */
-diff --git a/libc/sysdeps/linux/m68k/bits/kernel_types.h b/libc/sysdeps/linux/m68k/bits/kernel_types.h
-index 0a77a8f..176b968 100644
---- a/libc/sysdeps/linux/m68k/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/m68k/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef long long	__kernel_loff_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/microblaze/bits/kernel_types.h b/libc/sysdeps/linux/microblaze/bits/kernel_types.h
-index 2a70575..a9f736b 100644
---- a/libc/sysdeps/linux/microblaze/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/microblaze/bits/kernel_types.h
-@@ -44,6 +44,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned int	__kernel_old_uid_t;
- typedef unsigned int	__kernel_old_gid_t;
- typedef unsigned int	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- #ifdef __GNUC__
- typedef long long	__kernel_loff_t;
-diff --git a/libc/sysdeps/linux/mips/bits/kernel_types.h b/libc/sysdeps/linux/mips/bits/kernel_types.h
-index 9fc3b96..97faeac 100644
---- a/libc/sysdeps/linux/mips/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/mips/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef int		__kernel_gid32_t;
- typedef __kernel_uid_t	__kernel_old_uid_t;
- typedef __kernel_gid_t	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long      __kernel_loff_t;
- #else
- typedef unsigned int	__kernel_dev_t;
-@@ -68,6 +70,8 @@ typedef int		__kernel_gid32_t;
- typedef __kernel_uid_t	__kernel_old_uid_t;
- typedef __kernel_gid_t	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long      __kernel_loff_t;
- #endif
- 
-diff --git a/libc/sysdeps/linux/nios2/bits/kernel_types.h b/libc/sysdeps/linux/nios2/bits/kernel_types.h
-index 8b86d79..3c030e7 100644
---- a/libc/sysdeps/linux/nios2/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/nios2/bits/kernel_types.h
-@@ -31,6 +31,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef unsigned short	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- typedef struct {
-diff --git a/libc/sysdeps/linux/powerpc/bits/kernel_types.h b/libc/sysdeps/linux/powerpc/bits/kernel_types.h
-index 3f3b933..1167de2 100644
---- a/libc/sysdeps/linux/powerpc/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/powerpc/bits/kernel_types.h
-@@ -36,6 +36,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned int	__kernel_old_uid_t;
- typedef unsigned int	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- #else
- typedef unsigned int	__kernel_dev_t;
- typedef unsigned int	__kernel_ino_t;
-@@ -61,6 +63,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned int	__kernel_old_uid_t;
- typedef unsigned int	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- #endif
- 
-diff --git a/libc/sysdeps/linux/sh/bits/kernel_types.h b/libc/sysdeps/linux/sh/bits/kernel_types.h
-index f96e9fa..ac97261 100644
---- a/libc/sysdeps/linux/sh/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/sh/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- typedef struct {
-diff --git a/libc/sysdeps/linux/sh64/bits/kernel_types.h b/libc/sysdeps/linux/sh64/bits/kernel_types.h
-index 671cc83..8cc6c61 100644
---- a/libc/sysdeps/linux/sh64/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/sh64/bits/kernel_types.h
-@@ -43,6 +43,8 @@ typedef unsigned int    __kernel_gid32_t;
- typedef unsigned short  __kernel_old_uid_t;
- typedef unsigned short  __kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long       __kernel_loff_t;
- 
- typedef struct {
-diff --git a/libc/sysdeps/linux/sparc/bits/kernel_types.h b/libc/sysdeps/linux/sparc/bits/kernel_types.h
-index 0cc4bc2..a10e075 100644
---- a/libc/sysdeps/linux/sparc/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/sparc/bits/kernel_types.h
-@@ -32,6 +32,8 @@ typedef unsigned short	       __kernel_gid16_t;
- typedef __kernel_uid_t 	       __kernel_old_uid_t;
- typedef __kernel_gid_t         __kernel_old_gid_t;
- typedef __kernel_dev_t         __kernel_old_dev_t;
-+typedef long                   __kernel_long_t;
-+typedef unsigned long          __kernel_ulong_t;
- typedef __kernel_uid_t	       __kernel_uid32_t;
- typedef __kernel_gid_t	       __kernel_gid32_t;
- typedef int		       __kernel_suseconds_t;
-@@ -62,6 +64,8 @@ typedef unsigned int	       __kernel_gid32_t;
- typedef unsigned short	       __kernel_old_uid_t;
- typedef unsigned short	       __kernel_old_gid_t;
- typedef __kernel_dev_t         __kernel_old_dev_t;
-+typedef long                   __kernel_long_t;
-+typedef unsigned long          __kernel_ulong_t;
- typedef long long              __kernel_loff_t;
- #endif
- 
-diff --git a/libc/sysdeps/linux/v850/bits/kernel_types.h b/libc/sysdeps/linux/v850/bits/kernel_types.h
-index 3e851ab..780aa8a 100644
---- a/libc/sysdeps/linux/v850/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/v850/bits/kernel_types.h
-@@ -41,6 +41,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- 
- typedef struct {
- #ifdef __USE_ALL
-diff --git a/libc/sysdeps/linux/x86_64/bits/kernel_types.h b/libc/sysdeps/linux/x86_64/bits/kernel_types.h
-index de800d7..0cae08c 100644
---- a/libc/sysdeps/linux/x86_64/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/x86_64/bits/kernel_types.h
-@@ -40,6 +40,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef __kernel_dev_t	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- typedef struct {
-diff --git a/libc/sysdeps/linux/xtensa/bits/kernel_types.h b/libc/sysdeps/linux/xtensa/bits/kernel_types.h
-index 44f1075..ed38f2e 100644
---- a/libc/sysdeps/linux/xtensa/bits/kernel_types.h
-+++ b/libc/sysdeps/linux/xtensa/bits/kernel_types.h
-@@ -33,6 +33,8 @@ typedef unsigned int	__kernel_gid32_t;
- typedef unsigned short	__kernel_old_uid_t;
- typedef unsigned short	__kernel_old_gid_t;
- typedef unsigned short	__kernel_old_dev_t;
-+typedef long		__kernel_long_t;
-+typedef unsigned long	__kernel_ulong_t;
- typedef long long	__kernel_loff_t;
- 
- /* Beginning in 2.6 kernels, which is the first version that includes the
diff --git a/uClibc-newsoname.patch b/uClibc-newsoname.patch
deleted file mode 100644
index 7070640..0000000
--- a/uClibc-newsoname.patch
+++ /dev/null
@@ -1,161 +0,0 @@
---- uClibc-0.9.32/libpthread/linuxthreads.old/Makefile.in.orig	2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/libpthread/linuxthreads.old/Makefile.in	2011-06-12 09:00:50.687340614 +0200
-@@ -14,16 +14,16 @@
- CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
- 
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
--LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
-+LDFLAGS-libpthread-uclibc.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
- else
--LDFLAGS-libpthread.so := $(LDFLAGS)
-+LDFLAGS-libpthread-uclibc.so := $(LDFLAGS)
- endif
--LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libpthread.so := -Wl,--dsbt-index=10
-+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libpthread-uclibc.so := -Wl,--dsbt-index=10
- 
--LIBS-libpthread.so := $(LIBS) $(ldso)
-+LIBS-libpthread-uclibc.so := $(LIBS) $(ldso)
- 
--START_FILE-libpthread.so := $(SHARED_START_FILES)
--END_FILE-libpthread.so := $(SHARED_END_FILES)
-+START_FILE-libpthread-uclibc.so := $(SHARED_START_FILES)
-+END_FILE-libpthread-uclibc.so := $(SHARED_END_FILES)
- 
- libpthread_FULL_NAME := libpthread-$(VERSION).so
- 
-@@ -73,13 +73,13 @@
- libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
- 
- lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
--lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
-+lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread-uclibc.so
- 
- #ifeq ($(DOMULTI),n)
--$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend)
-+$(top_builddir)lib/libpthread-uclibc.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend)
- 	$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
- #else
--#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend)
-+#$(top_builddir)lib/libpthread-uclibc.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend)
- #	$(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
- #endif
- 
-@@ -90,6 +90,10 @@
- 	$(Q)$(RM) $@
- 	$(do_ar)
- 
-+$(top_builddir)lib/libpthread.so: $(top_builddir)lib/libpthread-uclibc.so
-+	$(LN) -sf $(notdir $<).$(MAJOR_VERSION) $@.$(MAJOR_VERSION)
-+	$(LN) -sf $(notdir $<) $@
-+
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(libpthread_OUT)/libpthread.oS: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
- endif
---- uClibc-0.9.32/libpthread/linuxthreads/Makefile.in.orig	2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/libpthread/linuxthreads/Makefile.in	2011-06-12 09:03:14.797345439 +0200
-@@ -23,15 +23,15 @@
- #CFLAGS:=$(CFLAGS:-O0=-O1)
- 
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
--LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
-+LDFLAGS-libpthread-uclibc.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
- else
--LDFLAGS-libpthread.so := $(LDFLAGS)
-+LDFLAGS-libpthread-uclibc.so := $(LDFLAGS)
- endif
- 
--LIBS-libpthread.so := $(LIBS) $(ldso)
-+LIBS-libpthread-uclibc.so := $(LIBS) $(ldso)
- 
--START_FILE-libpthread.so := $(SHARED_START_FILES)
--END_FILE-libpthread.so := $(SHARED_END_FILES)
-+START_FILE-libpthread-uclibc.so := $(SHARED_START_FILES)
-+END_FILE-libpthread-uclibc.so := $(SHARED_END_FILES)
- 
- libpthread_FULL_NAME := libpthread-$(VERSION).so
- 
-@@ -84,13 +84,13 @@
- libpthread-so-y += $(libpthread_OBJ:.o=.oS)
- 
- lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
--lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
-+lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread-uclibc.so
- 
- #ifeq ($(DOMULTI),n)
--$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
-+$(top_builddir)lib/libpthread-uclibc.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
- 	$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
- #else
--#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
-+#$(top_builddir)lib/libpthread-uclibc.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
- #	$(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
- #endif
- 	$(Q)$(RM) $@
-@@ -98,6 +98,10 @@
- 	$(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
- 	$(Q)mv $@.tmp $@
- 
-+$(top_builddir)lib/libpthread.so: $(top_builddir)lib/libpthread-uclibc.so
-+	$(LN) -sf $(notdir $<).$(MAJOR_VERSION) $@.$(MAJOR_VERSION)
-+	$(LN) -sf $(notdir $<) $@
-+
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
- endif
---- uClibc-0.9.32/libpthread/nptl/Makefile.in.orig	2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/libpthread/nptl/Makefile.in	2011-06-12 10:54:46.594236173 +0200
-@@ -64,17 +64,17 @@
- librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
- 
- ifeq ($(UCLIBC_CTOR_DTOR),y)
--START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crti.o
--END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crtn.o
--LDFLAGS-libpthread.so += -nostartfiles
--$(top_builddir)lib/libpthread.so: | $(START_FILE-libpthread.so) $(END_FILE-libpthread.so)
-+START_FILE-libpthread-uclibc.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/pt-crti.o
-+END_FILE-libpthread-uclibc.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/pt-crtn.o
-+LDFLAGS-libpthread-uclibc.so += -nostartfiles
-+$(top_builddir)lib/libpthread-uclibc.so: | $(START_FILE-libpthread-uclibc.so) $(END_FILE-libpthread-uclibc.so)
- endif
- 
- libpthread_FULL_NAME := libpthread-$(VERSION).so
- lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
--lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
-+lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread-uclibc.so
- 
--$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a
-+$(top_builddir)lib/libpthread-uclibc.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a
- 	$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
- 	$(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
- 	$(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
-@@ -92,6 +92,10 @@
- 	$(Q)$(RM) $@
- 	$(do_ar)
- 
-+$(top_builddir)lib/libpthread.so: $(top_builddir)lib/libpthread-uclibc.so
-+	$(LN) -sf $(notdir $<).$(MAJOR_VERSION) $@.$(MAJOR_VERSION)
-+	$(LN) -sf $(notdir $<) $@
-+
- #
- # Create 'pthread-errnos.h' header file.
- #
-@@ -139,15 +143,15 @@
- 	$(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)
- 
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
--LDFLAGS-libpthread.so += $(LDFLAGS_NOSTRIP) -Wl,-z,defs
-+LDFLAGS-libpthread-uclibc.so += $(LDFLAGS_NOSTRIP) -Wl,-z,defs
- else
--LDFLAGS-libpthread.so += $(LDFLAGS)
-+LDFLAGS-libpthread-uclibc.so += $(LDFLAGS)
- endif
- 
--LDFLAGS-libpthread.so += $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so $(top_builddir)lib/libdl-$(VERSION).so \
-+LDFLAGS-libpthread-uclibc.so += $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so $(top_builddir)lib/libdl-$(VERSION).so \
- 	-Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal
- 
--LIBS-libpthread.so := $(LIBS)
-+LIBS-libpthread-uclibc.so := $(LIBS)
- 
- CFLAGS-nptl = -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
- 
diff --git a/uClibc-stdio-unhide.patch b/uClibc-stdio-unhide.patch
deleted file mode 100644
index 4955638..0000000
--- a/uClibc-stdio-unhide.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- uClibc-0.9.32/libc/misc/internals/__uClibc_main.c.orig	2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/libc/misc/internals/__uClibc_main.c	2011-06-12 09:23:48.324053409 +0200
-@@ -118,7 +118,7 @@
-  */
- extern int *weak_const_function __errno_location(void);
- extern int *weak_const_function __h_errno_location(void);
--extern void weak_function _stdio_init(void) attribute_hidden;
-+extern void weak_function _stdio_init(void);
- #ifdef __UCLIBC_HAS_LOCALE__
- extern void weak_function _locale_init(void) attribute_hidden;
- #endif
---- uClibc-0.9.33/libc/stdlib/_atexit.c.orig	2012-02-01 22:21:04.000000000 +0100
-+++ uClibc-0.9.33/libc/stdlib/_atexit.c	2012-02-04 15:34:41.881463595 +0100
-@@ -314,7 +314,7 @@
- 	return q != 0;
- }
- 
--extern void weak_function _stdio_term(void) attribute_hidden;
-+extern void weak_function _stdio_term(void);
- attribute_hidden void (*__exit_cleanup)(int) = 0;
- __UCLIBC_MUTEX_INIT(__atexit_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
- 
diff --git a/uClibc-targetcpu.patch b/uClibc-targetcpu.patch
deleted file mode 100644
index d41540c..0000000
--- a/uClibc-targetcpu.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff -urNp -x '*.orig' uClibc-0.9.33.2.org/extra/Configs/Config.in uClibc-0.9.33.2/extra/Configs/Config.in
---- uClibc-0.9.33.2.org/extra/Configs/Config.in	2012-05-15 09:20:09.000000000 +0200
-+++ uClibc-0.9.33.2/extra/Configs/Config.in	2021-04-09 09:42:09.833470098 +0200
-@@ -1994,7 +1994,7 @@ menu "Library Installation Options"
- 
- config RUNTIME_PREFIX
- 	string "uClibc runtime library directory"
--	default "/usr/$(TARGET_ARCH)-linux-uclibc/"
-+	default "/usr/$(TARGET_CPU)-linux-uclibc"
- 	help
- 	  RUNTIME_PREFIX is the directory into which the uClibc runtime
- 	  libraries will be installed.   The result will look something
-@@ -2012,7 +2012,7 @@ config RUNTIME_PREFIX
- 
- config DEVEL_PREFIX
- 	string "uClibc development environment directory"
--	default "/usr/$(TARGET_ARCH)-linux-uclibc/usr/"
-+	default "/usr/$(TARGET_CPU)-linux-uclibc/usr"
- 	help
- 	  DEVEL_PREFIX is the directory into which the uClibc development
- 	  environment will be installed.   The result will look something
-diff -urNp -x '*.orig' uClibc-0.9.33.2.org/extra/gcc-uClibc/Makefile uClibc-0.9.33.2/extra/gcc-uClibc/Makefile
---- uClibc-0.9.33.2.org/extra/gcc-uClibc/Makefile	2021-04-09 09:42:09.643467299 +0200
-+++ uClibc-0.9.33.2/extra/gcc-uClibc/Makefile	2021-04-09 09:42:09.833470098 +0200
-@@ -53,37 +53,37 @@ else
- endif
- 
- gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
--	$(HOSTCC) $(HOSTCFLAGS) -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
-+	$(HOSTCC) $(HOSTCFLAGS) -s gcc-uClibc.c -o $(TARGET_CPU)-uclibc-gcc
- 	touch gcc-uClibc
- 
- ld-uClibc:
--	@echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
--	@echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
--	@echo "exec $(LD_BIN) \$$@ -L$(DEVEL_PREFIX)/lib" >> $(TARGET_ARCH)-uclibc-ld
--	chmod a+x $(TARGET_ARCH)-uclibc-ld
-+	@echo "#!/bin/sh" > $(TARGET_CPU)-uclibc-ld
-+	@echo "# This file was autogenerated by make" >> $(TARGET_CPU)-uclibc-ld
-+	@echo "exec $(LD_BIN) \$$@ -L$(DEVEL_PREFIX)/lib" >> $(TARGET_CPU)-uclibc-ld
-+	chmod a+x $(TARGET_CPU)-uclibc-ld
- 	touch ld-uClibc
- 
- install: all
- 	install -d $(PREFIX)$(DEVEL_PREFIX)/bin;
- 	install -d $(PREFIX)$(RUNTIME_PREFIX)/bin;
--	install -m 755 $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/
--	install -m 755 $(TARGET_ARCH)-uclibc-ld $(PREFIX)$(RUNTIME_PREFIX)/bin/
--	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-cc
--	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/gcc
--	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/cc
--	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ld  $(PREFIX)$(DEVEL_PREFIX)/bin/ld
-+	install -m 755 $(TARGET_CPU)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/
-+	install -m 755 $(TARGET_CPU)-uclibc-ld $(PREFIX)$(RUNTIME_PREFIX)/bin/
-+	ln -fs $(TARGET_CPU)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-cc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/gcc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/cc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-ld  $(PREFIX)$(DEVEL_PREFIX)/bin/ld
- ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
--	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-g++
--	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-c++
--	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/c++
--	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/g++
-+	ln -fs $(TARGET_CPU)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-g++
-+	ln -fs $(TARGET_CPU)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-c++
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/c++
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/g++
- endif
- 	for app in addr2line ar as cpp nm objcopy \
- 	    objdump ranlib size strings strip; do \
- 	  APPNAME=`which $(CROSS)$${app}`; \
- 	  if [ -x "$$APPNAME" ] ; then \
- 	  ln -fs "$$APPNAME" $(PREFIX)$(DEVEL_PREFIX)/bin/$${app}; \
--	  ln -fs "$$APPNAME" $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-$${app}; \
-+	  ln -fs "$$APPNAME" $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_CPU)-uclibc-$${app}; \
- 	  fi; \
- 	done
- 
diff --git a/uClibc-toolchain-wrapper.patch b/uClibc-toolchain-wrapper.patch
deleted file mode 100644
index 1a4c153..0000000
--- a/uClibc-toolchain-wrapper.patch
+++ /dev/null
@@ -1,807 +0,0 @@
-diff -urNp -x '*.orig' uClibc-0.9.33.2.org/Makefile.in uClibc-0.9.33.2/Makefile.in
---- uClibc-0.9.33.2.org/Makefile.in	2012-05-15 09:20:09.000000000 +0200
-+++ uClibc-0.9.33.2/Makefile.in	2021-04-09 09:42:09.273461846 +0200
-@@ -23,7 +23,7 @@ export KCONFIG_CONFIG
- 
- ifeq ($(HAVE_DOT_CONFIG),y)
- 
--all: pregen libs
-+all: pregen libs toolchain
- libs: pregen
- 
- # In this section, we need .config
-@@ -195,7 +195,7 @@ $(LOCAL_INSTALL_PATH):
- 	HOSTCC="$(HOSTCC)" \
- 	install
- 
--install: install_runtime install_dev
-+install: install_runtime install_dev install_toolchain
- 
- 
- RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
-@@ -416,6 +416,12 @@ install_utils: utils
- 
- endif # ifeq ($(HAVE_DOT_CONFIG),y)
- 
-+toolchain:
-+	$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C extra/gcc-uClibc
-+
-+install_toolchain: toolchain
-+	$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C extra/gcc-uClibc install
-+
- hostutils: | pregen
- 	$(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
- 
-diff -urNp -x '*.orig' uClibc-0.9.33.2.org/extra/gcc-uClibc/Makefile uClibc-0.9.33.2/extra/gcc-uClibc/Makefile
---- uClibc-0.9.33.2.org/extra/gcc-uClibc/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ uClibc-0.9.33.2/extra/gcc-uClibc/Makefile	2021-04-09 09:42:09.273461846 +0200
-@@ -0,0 +1,93 @@
-+# Makefile for building a fake gcc/binutils toolchain
-+# that simply spoofs the location of the C library
-+#
-+# Copyright (C) 2000-2002 Erik Andersen <andersen at uclibc.org>
-+#
-+
-+TOPDIR = ../../
-+include $(TOPDIR)Rules.mak
-+include $(TOPDIR)/.config
-+
-+UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
-+GCC_BIN = $(shell which $(CC))
-+LD_BIN = $(shell which $(LD))
-+GCCINCDIR:= ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-+
-+all: gcc-uClibc ld-uClibc
-+
-+gcc-uClibc.h: Makefile $(TOPDIR)/.config
-+	@echo "/* this file was autogenerated by make */" > gcc-uClibc.h
-+	@echo "#define UCLIBC_TARGET_PREFIX " \"$(TARGET_PREFIX)\" >> gcc-uClibc.h
-+	@echo "#define UCLIBC_DEVEL_PREFIX " \"$(DEVEL_PREFIX)\" >> gcc-uClibc.h
-+	@echo "#define UCLIBC_RUNTIME_PREFIX " \"$(RUNTIME_PREFIX)\" >> gcc-uClibc.h
-+	@echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)\" >> gcc-uClibc.h
-+	@echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
-+	@echo "#define LIBGCC_DIR " \"$(LIBGCC_DIR)\" >> gcc-uClibc.h
-+	@echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
-+	@echo "#define DYNAMIC_LINKER " \"$(RUNTIME_PREFIX)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
-+	@echo "#define BUILD_DYNAMIC_LINKER " \"$(UCLIBC_DIR)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
-+ifeq ($(strip $(HAVE_SHARED)),y)
-+	@echo "#define __UCLIBC_HAS_SHARED__ 1" >> gcc-uClibc.h
-+else
-+	@echo "#undef __UCLIBC_HAS_SHARED__" >> gcc-uClibc.h
-+endif
-+ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
-+	@echo "#define __UCLIBC_HAS_MMU__ 1" >> gcc-uClibc.h
-+else
-+	@echo "#undef __UCLIBC_HAS_MMU__" >> gcc-uClibc.h
-+endif
-+ifeq ($(strip $(HAS_ELF)),y)
-+	@echo "#define __HAS_ELF__ 1" >> gcc-uClibc.h
-+else
-+	@echo "#undef __HAS_ELF__" >> gcc-uClibc.h
-+endif
-+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-+	@echo "#define __UCLIBC_CTOR_DTOR__ 1" >> gcc-uClibc.h
-+ifeq ($(strip $(UCLIBC_PROFILING)),y)
-+	@echo "#define __UCLIBC_PROFILING__ 1" >> gcc-uClibc.h
-+else
-+	@echo "#undef __UCLIBC_PROFILING__" >> gcc-uClibc.h
-+endif
-+else
-+	@echo "#undef __UCLIBC_CTOR_DTOR__" >> gcc-uClibc.h
-+endif
-+
-+gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
-+	$(HOSTCC) $(HOSTCFLAGS) -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
-+	touch gcc-uClibc
-+
-+ld-uClibc:
-+	@echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
-+	@echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
-+	@echo "exec $(LD_BIN) \$$@ -L$(DEVEL_PREFIX)/lib" >> $(TARGET_ARCH)-uclibc-ld
-+	chmod a+x $(TARGET_ARCH)-uclibc-ld
-+	touch ld-uClibc
-+
-+install: all
-+	install -d $(PREFIX)$(DEVEL_PREFIX)/bin;
-+	install -d $(PREFIX)$(RUNTIME_PREFIX)/bin;
-+	install -m 755 $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/
-+	install -m 755 $(TARGET_ARCH)-uclibc-ld $(PREFIX)$(RUNTIME_PREFIX)/bin/
-+	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-cc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/gcc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/cc
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ld  $(PREFIX)$(DEVEL_PREFIX)/bin/ld
-+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-+	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-g++
-+	ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-c++
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/c++
-+	ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/g++
-+endif
-+	for app in addr2line ar as cpp nm objcopy \
-+	    objdump ranlib size strings strip; do \
-+	  APPNAME=`which $(CROSS)$${app}`; \
-+	  if [ -x "$$APPNAME" ] ; then \
-+	  ln -fs "$$APPNAME" $(PREFIX)$(DEVEL_PREFIX)/bin/$${app}; \
-+	  ln -fs "$$APPNAME" $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-$${app}; \
-+	  fi; \
-+	done
-+
-+clean:
-+	rm -f gcc-uClibc.h *-uclibc-gcc *-uclibc-ld core
-+
-+
-diff -urNp -x '*.orig' uClibc-0.9.33.2.org/extra/gcc-uClibc/gcc-uClibc.c uClibc-0.9.33.2/extra/gcc-uClibc/gcc-uClibc.c
---- uClibc-0.9.33.2.org/extra/gcc-uClibc/gcc-uClibc.c	1970-01-01 01:00:00.000000000 +0100
-+++ uClibc-0.9.33.2/extra/gcc-uClibc/gcc-uClibc.c	2021-04-09 09:42:09.273461846 +0200
-@@ -0,0 +1,672 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * Copyright (C) 2000 Manuel Novoa III
-+ * Copyright (C) 2002-2003 Erik Andersen
-+ *
-+ * This is a crude wrapper to use uClibc with gcc.
-+ * It was originally written to work around ./configure for ext2fs-utils.
-+ * It certainly can be improved, but it works for me in the normal cases.
-+ *
-+ * April 7, 2001
-+ *
-+ * A bug was fixed in building the gcc command line when dynamic linking.
-+ * The functions dlopen, etc. now work.  At this time, you must make sure
-+ * the correct libdl.so is included however.  It is safest to, for example,
-+ * add /lib/libdl.so.1 if using ld-linux.so.1 rather than adding -ldl to the
-+ * command line.
-+ *
-+ * Note: This is only a problem if devel and target archs are the same.  To
-+ * avoid the problem, you can use a customized dynamic linker.
-+ *
-+ *
-+ * April 18, 2001
-+ *
-+ * The wrapper now works with either installed and uninstalled uClibc versions.
-+ * If you want to use the uninstalled header files and libs, either include
-+ * the string "build" in the invocation name such as
-+ *       'ln -s <ARCH>-uclibc-gcc <ARCH>-uclibc-gcc-build'
-+ * or include it in the environment variable setting of UCLIBC_ENV.
-+ * Note: This automatically enables the "rpath" behavior described below.
-+ *
-+ * The wrapper will now pass the location of the uClibc shared libs used to
-+ * the linker with the "-rpath" option if the invocation name includes the
-+ * string "rpath" or if the environment variable UCLIBC_ENV include it (as
-+ * with "build" above).  This is primarily intended to be used on devel
-+ * platforms of the same arch as the target.  A good place to use this feature
-+ * would be in the uClibc/test directory.
-+ *
-+ * The wrapper now displays the command line passed to gcc when '-v' is used.
-+ *
-+ * May 31, 2001
-+ *
-+ * "rpath" and "build" behavior are now decoupled.  You can of course get
-+ * the old "build" behavior by setting UCLIBC_ENV="rpath-build".  Order
-+ * isn't important here, as only the substrings are searched for.
-+ *
-+ * Added environment variable check for UCLIBC_GCC_DLOPT to let user specify
-+ * an alternative dynamic linker at runtime without using command line args.
-+ * Since this wouldn't commonly be used, I made it easy on myself.  You have
-+ * to match the option you would have passed to the gcc wrapper.  As an
-+ * example,
-+ *
-+ *   export UCLIBC_GCC_DLOPT="-Wl,--dynamic-linker,/lib/ld-alt-linker.so.3"
-+ *
-+ * This is really only useful if target arch == devel arch and DEVEL_PREFIX
-+ * isn't empty.  It involves a recompile, but you can at least test apps
-+ * on your devel system if combined with the "rpath" behavor if by using
-+ * LD_LIBRARY_PATH, etc.
-+ *
-+ * Also added check for "-Wl,--dynamic-linker" on the command line.  The
-+ * use default dynamic linker or the envirnment-specified dynamic linker
-+ * is disabled in that case.
-+ *
-+ * Added options --uclibc-use-build-dir and --uclibc-use-rpath so that those
-+ * behaviors can be invoked from the command line.
-+ *
-+ */
-+
-+/*
-+ *
-+ * TODO:
-+ * Check/modify gcc-specific environment variables?
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <stdarg.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <errno.h>
-+#include <sys/stat.h>
-+#include <sys/wait.h>
-+
-+#include "gcc-uClibc.h"
-+
-+static char *our_usr_lib_path = "-L"UCLIBC_DEVEL_PREFIX"/lib";
-+
-+static char static_linking[] = "-static";
-+static char nostdinc[] = "-nostdinc";
-+static char nostartfiles[] = "-nostartfiles";
-+static char nodefaultlibs[] = "-nodefaultlibs";
-+static char nostdlib[] = "-nostdlib";
-+#ifdef __UCLIBC_CTOR_DTOR__
-+static char nostdinc_plus[] = "-nostdinc++";
-+#endif
-+
-+/* Include a local implementation of basename, since this
-+ * uses the host system's C lib, and CYGWIN apparently
-+ * doesn't provide an implementation of basename(). */
-+char *basename(const char *path)
-+{
-+	register const char *s;
-+	register const char *p;
-+	p = s = path;
-+	while (*s) {
-+		if (*s++ == '/') {
-+			p = s;
-+		}
-+	}
-+	return (char *) p;
-+}
-+
-+char *dirname(char *path)
-+{
-+	static const char null_or_empty_or_noslash[] = ".";
-+	register char *s;
-+	register char *last;
-+	char *first;
-+
-+	last = s = path;
-+
-+	if (s != NULL) {
-+
-+LOOP:
-+		while (*s && (*s != '/')) ++s;
-+		first = s;
-+		while (*s == '/') ++s;
-+		if (*s) {
-+			last = first;
-+			goto LOOP;
-+		}
-+
-+		if (last == path) {
-+			if (*last != '/') {
-+				goto DOT;
-+			}
-+			if ((*++last == '/') && (last[1] == 0)) {
-+				++last;
-+			}
-+		}
-+		*last = 0;
-+		return path;
-+	}
-+DOT:
-+	return (char *) null_or_empty_or_noslash;
-+}
-+
-+
-+extern void *xmalloc(size_t size)
-+{
-+	void *ptr = malloc(size);
-+
-+	if (!ptr) {
-+		fprintf(stderr, "memory exhausted");
-+		exit(EXIT_FAILURE);
-+	}
-+	return ptr;
-+}
-+
-+void xstrcat(char **string, ...)
-+{
-+	const char *c;
-+	va_list p; 
-+	/* Don't bother to calculate how big exerything 
-+	 * will be, just be careful to not overflow...  */
-+	va_start(p, string);
-+	*string = xmalloc(BUFSIZ);
-+	**string = '\0';
-+	while(1) {
-+		if (!(c = va_arg(p, const char *)))
-+			break;
-+		strcat(*string, c); 
-+	}
-+	va_end(p);
-+}
-+
-+int main(int argc, char **argv)
-+{
-+	int use_build_dir = 0, linking = 1, use_static_linking = 0;
-+	int use_stdinc = 1, use_start = 1, use_stdlib = 1, use_pic = 0;
-+	int source_count = 0, use_rpath = 0, verbose = 0;
-+	int i, j, k, l, m, n;
-+	char ** gcc_argv;
-+	char ** gcc_argument;
-+	char ** libraries;
-+	char ** libpath;
-+	char *dlstr;
-+	char *incstr;
-+	char *devprefix;
-+   char *runprefix;
-+	char *builddir;
-+	char *libstr;
-+	char *build_dlstr = 0;
-+	char *cc;
-+	char *ep;
-+	char *rpath_link[2];
-+	char *rpath[2];
-+	char *uClibc_inc[2];
-+	char *our_lib_path[2];
-+	char *crt0_path[2];
-+	char *crtbegin_path[2];
-+	char *crtend_path[2];
-+	const char *application_name;
-+#ifdef __UCLIBC_CTOR_DTOR__
-+	char *crti_path[2];
-+	char *crtn_path[2];
-+	int len;
-+	int ctor_dtor = 1, cplusplus = 0, use_nostdinc_plus = 0;
-+	int findlibgcc = 1;
-+	char *cpp = NULL;
-+#endif
-+#ifdef __UCLIBC_PROFILING__
-+	int profile = 0;
-+	char *gcrt1_path[2];
-+#endif
-+
-+	cc     = getenv("UCLIBC_CC");
-+	if (cc==NULL) {
-+		cc = GCC_BIN;
-+#ifdef __UCLIBC_CTOR_DTOR__
-+		findlibgcc = 0;
-+#endif
-+	}
-+
-+	application_name = basename(argv[0]);
-+	if (application_name[0] == '-')
-+		application_name++;
-+
-+#ifdef __UCLIBC_CTOR_DTOR__
-+	/* We must use strstr since g++ might be named like a
-+	 * cross compiler (i.e. arm-linux-g++).   We must also
-+	 * search carefully, in case we are searching something 
-+	 * like /opt/c++/gcc-3.1/bin/arm-linux-g++ or some similar 
-+	 * perversion...  */
-+	len = strlen(application_name);
-+	if ((strcmp(application_name+len-3, "g++")==0) ||
-+			(strcmp(application_name+len-3, "c++")==0)) {
-+		len = strlen(cc);
-+		if (strcmp(cc+len-3, "gcc")==0) {
-+			cpp = strdup(cc);
-+			cpp[len-1]='+';
-+			cpp[len-2]='+';
-+		}
-+		cplusplus = 1;
-+		use_nostdinc_plus = 1;
-+	}
-+#endif
-+
-+	devprefix = getenv("UCLIBC_DEVEL_PREFIX");
-+	if (!devprefix) {
-+		devprefix = UCLIBC_DEVEL_PREFIX;
-+	}
-+
-+	runprefix = getenv("UCLIBC_RUNTIME_PREFIX");
-+	if (!runprefix) {
-+		runprefix = UCLIBC_RUNTIME_PREFIX;
-+	}
-+
-+	builddir = getenv("UCLIBC_BUILD_DIR");
-+	if (!builddir) {
-+		builddir = UCLIBC_BUILD_DIR;
-+	}
-+
-+	incstr = getenv("UCLIBC_GCC_INC");
-+	libstr = getenv("UCLIBC_GCC_LIB");
-+
-+	ep     = getenv("UCLIBC_ENV");
-+	if (!ep) {
-+		ep = "";
-+	}
-+
-+	if (strstr(ep,"build") != 0) {
-+		use_build_dir = 1;
-+	}
-+
-+	if (strstr(ep,"rpath") != 0) {
-+		use_rpath = 1;
-+	}
-+
-+
-+	xstrcat(&(rpath_link[0]), "-Wl,-rpath-link,", devprefix, "/lib:", runprefix, "/lib", NULL);
-+	xstrcat(&(rpath_link[1]), "-Wl,-rpath-link,", builddir, "/lib", NULL);
-+
-+	xstrcat(&(rpath[0]), "-Wl,-rpath,", devprefix, "/lib:", runprefix, "/lib", NULL);
-+	xstrcat(&(rpath[1]), "-Wl,-rpath,", builddir, "/lib", NULL);
-+
-+	xstrcat(&(uClibc_inc[0]), devprefix, "/include/", NULL);
-+	xstrcat(&(uClibc_inc[1]), builddir, "/include/", NULL);
-+
-+#ifdef __UCLIBC_CTOR_DTOR__
-+	xstrcat(&(crt0_path[0]), devprefix, "/lib/crt1.o", NULL);
-+	xstrcat(&(crt0_path[1]), builddir, "/lib/crt1.o", NULL);
-+	xstrcat(&(crti_path[0]), devprefix, "/lib/crti.o", NULL);
-+	xstrcat(&(crti_path[1]), builddir, "/lib/crti.o", NULL);
-+	xstrcat(&(crtn_path[0]), devprefix, "/lib/crtn.o", NULL);
-+	xstrcat(&(crtn_path[1]), builddir, "/lib/crtn.o", NULL);
-+#else
-+	xstrcat(&(crt0_path[0]), devprefix, "/lib/crt0.o", NULL);
-+	xstrcat(&(crt0_path[1]), builddir, "/lib/crt0.o", NULL);
-+#endif
-+#ifdef __UCLIBC_PROFILING__
-+	xstrcat(&(gcrt1_path[0]), devprefix, "/lib/gcrt1.o", NULL);
-+	xstrcat(&(gcrt1_path[1]), builddir, "/lib/gcrt1.o", NULL);
-+#endif
-+
-+	xstrcat(&(our_lib_path[0]), "-L", devprefix, "/lib", NULL);
-+	xstrcat(&(our_lib_path[1]), "-L", builddir, "/lib", NULL);
-+
-+#ifdef __UCLIBC_HAS_SHARED__
-+	build_dlstr = "-Wl,--dynamic-linker," BUILD_DYNAMIC_LINKER;
-+	dlstr = getenv("UCLIBC_GCC_DLOPT");
-+	if (!dlstr) {
-+		dlstr = "-Wl,--dynamic-linker," DYNAMIC_LINKER;
-+	}
-+#endif
-+
-+	m = 0;
-+	libraries = __builtin_alloca(sizeof(char*) * (argc));
-+	libraries[m] = '\0';
-+
-+	n = 0;
-+	libpath = __builtin_alloca(sizeof(char*) * (argc));
-+	libpath[n] = '\0';
-+
-+	for ( i = 1 ; i < argc ; i++ ) {
-+		if (argv[i][0] == '-') { /* option */
-+			switch (argv[i][1]) {
-+				case 'c':		/* compile or assemble */
-+				case 'S':		/* generate assembler code */
-+				case 'E':		/* preprocess only */
-+				case 'M':	    /* generate dependencies */
-+					linking = 0;
-+					break;
-+				case 'L': 		/* library */
-+					libpath[n++] = argv[i];
-+					libpath[n] = '\0';
-+					if (argv[i][2] == 0) {
-+						argv[i] = '\0';
-+						libpath[n++] = argv[++i];
-+						libpath[n] = '\0';
-+					}
-+					argv[i] = '\0';
-+					break;
-+				case 'l': 		/* library */
-+					libraries[m++] = argv[i];
-+					libraries[m] = '\0';
-+					argv[i] = '\0';
-+					break;
-+				case 'v':		/* verbose */
-+					if (argv[i][2] == 0) verbose = 1;
-+					printf("Invoked as %s\n", argv[0]);
-+					break;
-+				case 'n':
-+					if (strcmp(nostdinc,argv[i]) == 0) {
-+						use_stdinc = 0;
-+					} else if (strcmp(nostartfiles,argv[i]) == 0) {
-+#ifdef __UCLIBC_CTOR_DTOR__
-+						ctor_dtor = 0;
-+#endif
-+						use_start = 0;
-+					} else if (strcmp(nodefaultlibs,argv[i]) == 0) {
-+						use_stdlib = 0;
-+						argv[i] = '\0';
-+					} else if (strcmp(nostdlib,argv[i]) == 0) {
-+#ifdef __UCLIBC_CTOR_DTOR__
-+						ctor_dtor = 0;
-+#endif
-+						use_start = 0;
-+						use_stdlib = 0;
-+					} 
-+#ifdef __UCLIBC_CTOR_DTOR__
-+					else if (strcmp(nostdinc_plus,argv[i]) == 0) {
-+						if (cplusplus==1) {
-+							use_nostdinc_plus = 0;
-+						}
-+					}
-+#endif
-+					break;
-+				case 's':
-+					if (strstr(argv[i],static_linking) != NULL) {
-+						use_static_linking = 1;
-+					}
-+					if (strcmp("-shared",argv[i]) == 0) {
-+						use_start = 0;
-+						use_pic = 1;
-+					}
-+					break;
-+				case 'W':		/* -static could be passed directly to ld */
-+					if (strncmp("-Wl,",argv[i],4) == 0) {
-+						if (strstr(argv[i],static_linking) != 0) {
-+							use_static_linking = 1;
-+						}
-+						if (strstr(argv[i],"--dynamic-linker") != 0) {
-+							dlstr = 0;
-+						}
-+						if ((strstr(argv[i],"-z,combreloc") != 0) ||
-+								(strstr(argv[i],"-z,relro") != 0)) {
-+							argv[i] = '\0';
-+						}
-+					}
-+					break;
-+#ifdef __UCLIBC_PROFILING__
-+				case 'p':
-+					if (strcmp("-pg",argv[i]) == 0) {
-+						profile = 1;
-+					}
-+					break;
-+#endif
-+				case 'f':
-+					/* Check if we are doing PIC */
-+					if (strcmp("-fPIC",argv[i]) == 0) {
-+						use_pic = 1;
-+					} else if (strcmp("-fpic",argv[i]) == 0) {
-+						use_pic = 1;
-+					} 
-+#ifdef __UCLIBC_PROFILING__
-+					else if (strcmp("-fprofile-arcs",argv[i]) == 0) {
-+						profile = 1;
-+					}
-+#endif
-+					break;
-+
-+				case '-':
-+					if (strstr(argv[i]+1,static_linking) != NULL) {
-+						use_static_linking = 1;
-+						argv[i]='\0';
-+					} else if (strcmp("--uclibc-use-build-dir",argv[i]) == 0) {
-+						use_build_dir = 1;
-+						argv[i]='\0';
-+					} else if (strcmp("--uclibc-use-rpath",argv[i]) == 0) {
-+						use_rpath = 1;
-+						argv[i]='\0';
-+					} else if (strcmp ("--uclibc-cc", argv[i]) == 0 && argv[i + 1]) {
-+						cc = argv[i + 1];
-+						argv[i] = 0;
-+						argv[i + 1] = 0;
-+					} else if (strncmp ("--uclibc-cc=", argv[i], 12) == 0) {
-+						cc = argv[i] + 12;
-+						argv[i] = 0;
-+					}
-+#ifdef __UCLIBC_CTOR_DTOR__
-+					else if (strcmp("--uclibc-no-ctors",argv[i]) == 0) {
-+						ctor_dtor = 0;
-+						argv[i]='\0';
-+					}
-+#endif
-+					break;
-+			}
-+		} else {				/* assume it is an existing source file */
-+			++source_count;
-+		}
-+	}
-+
-+	gcc_argv = __builtin_alloca(sizeof(char*) * (argc + 64));
-+	gcc_argument = __builtin_alloca(sizeof(char*) * (argc + 20));
-+
-+	i = 0; k = 0;
-+#ifdef __UCLIBC_CTOR_DTOR__
-+	if (ctor_dtor) {
-+		struct stat statbuf;
-+		if (findlibgcc==1 || stat(LIBGCC_DIR, &statbuf)!=0 || 
-+				!S_ISDIR(statbuf.st_mode))
-+		{
-+			/* Bummer, gcc is hiding from us. This is going
-+			 * to really slow things down... bummer.  */
-+			int status, gcc_pipe[2];
-+			pid_t pid, wpid;
-+
-+			pipe(gcc_pipe);
-+			if (!(pid = fork())) {
-+				char *argv[4];
-+				close(gcc_pipe[0]);
-+				close(1);
-+				close(2);
-+				dup2(gcc_pipe[1], 1);
-+				dup2(gcc_pipe[1], 2);
-+				argv[0] = cc;
-+				argv[1] = "-print-libgcc-file-name";
-+				argv[2] = NULL;
-+				execvp(cc, argv);
-+				close(gcc_pipe[1]);
-+				_exit(EXIT_FAILURE);
-+			}
-+			wpid=0;
-+			while (wpid != pid) {
-+				wpid = wait(&status);
-+			}
-+			close(gcc_pipe[1]);
-+			if (WIFEXITED(status) && WEXITSTATUS(status)) {
-+crash_n_burn:
-+				fprintf(stderr, "Unable to locale crtbegin.o provided by gcc");
-+				exit(EXIT_FAILURE);
-+			}
-+			if (WIFSIGNALED(status)) {
-+				fprintf(stderr, "%s exited because of uncaught signal %d", cc, WTERMSIG(status));
-+				exit(EXIT_FAILURE);
-+			}
-+
-+			{
-+				char buf[1024], *dir;
-+				status = read(gcc_pipe[0], buf, sizeof(buf));
-+				close(gcc_pipe[0]);
-+				if (status < 0) {
-+					goto crash_n_burn;
-+				}
-+				buf[(status == sizeof(buf)) ? status-1 : status] = 0;
-+				dir = dirname(buf);
-+				xstrcat(&(crtbegin_path[0]), dir, "/crtbegin.o", NULL);
-+				xstrcat(&(crtbegin_path[1]), dir, "/crtbeginS.o", NULL);
-+				xstrcat(&(crtend_path[0]), dir, "/crtend.o", NULL);
-+				xstrcat(&(crtend_path[1]), dir, "/crtendS.o", NULL);
-+			}
-+
-+		} else {
-+			xstrcat(&(crtbegin_path[0]), LIBGCC_DIR, "crtbegin.o", NULL);
-+			xstrcat(&(crtbegin_path[1]), LIBGCC_DIR, "crtbeginS.o", NULL);
-+			xstrcat(&(crtend_path[0]), LIBGCC_DIR, "crtend.o", NULL);
-+			xstrcat(&(crtend_path[1]), LIBGCC_DIR, "crtendS.o", NULL);
-+		}
-+	}
-+
-+	if (cplusplus && cpp)
-+		gcc_argv[i++] = cpp;
-+	else
-+#endif
-+		gcc_argv[i++] = cc;
-+
-+	for ( j = 1 ; j < argc ; j++ ) {
-+		if (argv[j]=='\0') {
-+			continue;
-+		} else {
-+			gcc_argument[k++] = argv[j];
-+			gcc_argument[k] = '\0';
-+		}
-+	}
-+
-+	if (linking && source_count) {
-+		gcc_argv[i++] = "-Wl,--hash-style=gnu";
-+#if defined __HAVE_ELF__ && ! defined __UCLIBC_HAS_MMU__
-+		gcc_argv[i++] = "-Wl,-elf2flt";
-+#endif
-+		gcc_argv[i++] = nostdlib;
-+		if (use_static_linking) {
-+			gcc_argv[i++] = static_linking;
-+		}
-+		if (!use_static_linking) {
-+			if (dlstr && use_build_dir) {
-+				gcc_argv[i++] = build_dlstr;
-+			} else if (dlstr) {
-+				gcc_argv[i++] = dlstr;
-+			}
-+			if (use_rpath) {
-+				gcc_argv[i++] = rpath[use_build_dir];
-+			}
-+		}
-+		for ( l = 0 ; l < n ; l++ ) {
-+			if (libpath[l]) gcc_argv[i++] = libpath[l];
-+		}
-+		gcc_argv[i++] = rpath_link[use_build_dir]; /* just to be safe */
-+		if( libstr )
-+			gcc_argv[i++] = libstr;
-+		gcc_argv[i++] = our_lib_path[use_build_dir];
-+		if (!use_build_dir) {
-+			gcc_argv[i++] = our_usr_lib_path;
-+		}
-+	}
-+	if (use_stdinc && source_count) {
-+		gcc_argv[i++] = nostdinc;
-+#ifdef __UCLIBC_CTOR_DTOR__
-+		if (cplusplus) {
-+			char *cppinc;
-+			if (use_nostdinc_plus) {
-+				gcc_argv[i++] = nostdinc_plus;
-+			}
-+			xstrcat(&cppinc, uClibc_inc[use_build_dir], "g++/", NULL);
-+			gcc_argv[i++] = "-isystem";
-+			gcc_argv[i++] = cppinc;
-+			xstrcat(&cppinc, uClibc_inc[use_build_dir], "g++-v3/", NULL);
-+			gcc_argv[i++] = "-isystem";
-+			gcc_argv[i++] = cppinc;
-+		}
-+#endif
-+		gcc_argv[i++] = "-isystem";
-+		gcc_argv[i++] = uClibc_inc[use_build_dir];
-+		gcc_argv[i++] = "-iwithprefix";
-+		gcc_argv[i++] = "include";
-+		if( incstr )
-+			gcc_argv[i++] = incstr;
-+	}
-+
-+	if (linking && source_count) {
-+
-+#ifdef __UCLIBC_PROFILING__
-+		if (profile) {
-+			gcc_argv[i++] = gcrt1_path[use_build_dir];
-+		}
-+#endif
-+#ifdef __UCLIBC_CTOR_DTOR__
-+		if (ctor_dtor) {
-+			gcc_argv[i++] = crti_path[use_build_dir];
-+			if (use_pic) {
-+				gcc_argv[i++] = crtbegin_path[1];
-+			} else {
-+				gcc_argv[i++] = crtbegin_path[0];
-+			}
-+		}
-+#endif
-+		if (use_start) {
-+#ifdef __UCLIBC_PROFILING__
-+			if (!profile)
-+#endif
-+			{
-+				gcc_argv[i++] = crt0_path[use_build_dir];
-+			}
-+		}
-+		for ( l = 0 ; l < k ; l++ ) {
-+			if (gcc_argument[l]) gcc_argv[i++] = gcc_argument[l];
-+		}
-+		if (use_stdlib) {
-+			//gcc_argv[i++] = "-Wl,--start-group";
-+			gcc_argv[i++] = "-lgcc";
-+		}
-+		for ( l = 0 ; l < m ; l++ ) {
-+			if (libraries[l]) gcc_argv[i++] = libraries[l];
-+		}
-+		if (use_stdlib) {
-+#ifdef __UCLIBC_CTOR_DTOR__
-+			if (cplusplus) {
-+				gcc_argv[ i++ ] = "-lstdc++";
-+				gcc_argv[ i++ ] = "-lm";
-+			}
-+#endif
-+			gcc_argv[i++] = "-lc";
-+			gcc_argv[i++] = "-lgcc";
-+			//gcc_argv[i++] = "-Wl,--end-group";
-+		}
-+#ifdef __UCLIBC_CTOR_DTOR__
-+		if (ctor_dtor) {
-+			if (use_pic) {
-+				gcc_argv[i++] = crtend_path[1];
-+			} else {
-+				gcc_argv[i++] = crtend_path[0];
-+			}
-+
-+			gcc_argv[i++] = crtn_path[use_build_dir];
-+		}
-+#endif
-+	} else {
-+		for ( l = 0 ; l < k ; l++ ) {
-+			if (gcc_argument[l]) gcc_argv[i++] = gcc_argument[l];
-+		}
-+	}
-+	gcc_argv[i++] = NULL;
-+
-+	if (verbose) {
-+		for ( j = 0 ; gcc_argv[j] ; j++ ) {
-+			printf("arg[%2i] = %s\n", j, gcc_argv[j]);
-+		}
-+		fflush(stdout);
-+	}
-+	//no need to free memory from xstrcat because we never return... 
-+#ifdef __UCLIBC_CTOR_DTOR__
-+	if (cplusplus && cpp) {
-+		execvp(cpp, gcc_argv);
-+		fprintf(stderr, "%s: %s\n", cpp, strerror(errno));
-+	} else
-+#endif
-+	{
-+		execvp(cc, gcc_argv);
-+		fprintf(stderr, "%s: %s\n", cc, strerror(errno));
-+	}
-+	exit(EXIT_FAILURE);
-+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/uClibc-ng.git/commitdiff/7f67dfeb2513ff2a2132717e136193c3e1c48535



More information about the pld-cvs-commit mailing list