diff options
author | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2013-09-16 20:53:09 +0200 |
---|---|---|
committer | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2013-09-16 20:53:09 +0200 |
commit | c59a74ce6528c3d8dfe644dfecd916cd6f928416 (patch) | |
tree | 5d5039686a9648d9c325d7412f048ba9e227183a | |
parent | 1ddf1360f6396fa9887d3ed8f6e9f943eb02ecee (diff) |
bus error on mips/mipsel is fixed now. thx to Rich Felker, added musl-git patch from today
-rw-r--r-- | toolchain/musl/patches/0.9.13/musl-git.patch | 8837 |
1 files changed, 8837 insertions, 0 deletions
diff --git a/toolchain/musl/patches/0.9.13/musl-git.patch b/toolchain/musl/patches/0.9.13/musl-git.patch new file mode 100644 index 000000000..a6a87390f --- /dev/null +++ b/toolchain/musl/patches/0.9.13/musl-git.patch @@ -0,0 +1,8837 @@ +diff -Nur musl-0.9.13/.gitignore musl-git/.gitignore +--- musl-0.9.13/.gitignore 1970-01-01 01:00:00.000000000 +0100 ++++ musl-git/.gitignore 2013-09-16 20:31:39.000000000 +0200 +@@ -0,0 +1,10 @@ ++*.o ++*.lo ++*.a ++*.so ++*.so.1 ++arch/*/bits/alltypes.h ++config.mak ++include/bits ++tools/musl-gcc ++lib/musl-gcc.specs +diff -Nur musl-0.9.13/Makefile musl-git/Makefile +--- musl-0.9.13/Makefile 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/Makefile 2013-09-16 20:31:39.000000000 +0200 +@@ -157,7 +157,7 @@ + $(INSTALL) -D -m 644 $< $@ + + $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so +- $(INSTALL) -D -l $< $@ || true ++ $(INSTALL) -D -l $(libdir)/libc.so $@ || true + + install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) + +diff -Nur musl-0.9.13/arch/microblaze/bits/limits.h musl-git/arch/microblaze/bits/limits.h +--- musl-0.9.13/arch/microblaze/bits/limits.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/microblaze/bits/limits.h 2013-09-16 20:31:39.000000000 +0200 +@@ -1,6 +1,5 @@ + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +-#define PAGE_SIZE 4096 + #define LONG_BIT 32 + #endif + +diff -Nur musl-0.9.13/arch/microblaze/reloc.h musl-git/arch/microblaze/reloc.h +--- musl-0.9.13/arch/microblaze/reloc.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/microblaze/reloc.h 2013-09-16 20:31:39.000000000 +0200 +@@ -49,7 +49,7 @@ + for (a+=c+1; *a; a++); + for (a++; *a; a+=2) if (*a<20) t[*a] = a[1]; + base = (char *)t[AT_BASE]; +- if (!base) base = (char *)(t[AT_PHDR] & -4096); ++ if (!base) base = (char *)(t[AT_PHDR] & -t[AT_PAGESZ]); + for (a=dynv; *a; a+=2) if (*a<20) t[*a] = a[1]; + n = t[DT_RELASZ]; + for (a=(void *)(base+t[DT_RELA]); n; a+=3, n-=12) +diff -Nur musl-0.9.13/arch/mips/bits/limits.h musl-git/arch/mips/bits/limits.h +--- musl-0.9.13/arch/mips/bits/limits.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/mips/bits/limits.h 2013-09-16 20:31:39.000000000 +0200 +@@ -1,6 +1,5 @@ + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +-#define PAGE_SIZE 4096 + #define LONG_BIT 32 + #endif + +diff -Nur musl-0.9.13/arch/mips/bits/msg.h musl-git/arch/mips/bits/msg.h +--- musl-0.9.13/arch/mips/bits/msg.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/mips/bits/msg.h 2013-09-16 20:31:39.000000000 +0200 +@@ -1,12 +1,21 @@ + struct msqid_ds + { + struct ipc_perm msg_perm; ++#if _MIPSEL || __MIPSEL || __MIPSEL__ + time_t msg_stime; + int __unused1; + time_t msg_rtime; + int __unused2; + time_t msg_ctime; + int __unused3; ++#else ++ int __unused1; ++ time_t msg_stime; ++ int __unused2; ++ time_t msg_rtime; ++ int __unused3; ++ time_t msg_ctime; ++#endif + unsigned long msg_cbytes; + msgqnum_t msg_qnum; + msglen_t msg_qbytes; +diff -Nur musl-0.9.13/arch/mips/bits/shm.h musl-git/arch/mips/bits/shm.h +--- musl-0.9.13/arch/mips/bits/shm.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/mips/bits/shm.h 2013-09-16 20:31:39.000000000 +0200 +@@ -5,11 +5,8 @@ + struct ipc_perm shm_perm; + size_t shm_segsz; + time_t shm_atime; +- int __unused1; + time_t shm_dtime; +- int __unused2; + time_t shm_ctime; +- int __unused3; + pid_t shm_cpid; + pid_t shm_lpid; + unsigned long shm_nattch; +diff -Nur musl-0.9.13/arch/mips/reloc.h musl-git/arch/mips/reloc.h +--- musl-0.9.13/arch/mips/reloc.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/mips/reloc.h 2013-09-16 20:31:39.000000000 +0200 +@@ -51,7 +51,7 @@ + for (a+=c+1; *a; a++); + for (a++; *a; a+=2) if (*a<20) t[*a] = a[1]; + base = (char *)t[AT_BASE]; +- if (!base) base = (char *)(t[AT_PHDR] & -4096); ++ if (!base) base = (char *)(t[AT_PHDR] & -t[AT_PAGESZ]); + for (a=dynv; *a; a+=2) if (*a-0x70000000UL<20) t[*a&31] = a[1]; + n = t[DT_MIPS_LOCAL_GOTNO - 0x70000000]; + for (a=got; n; a++, n--) *a += (size_t)base; +diff -Nur musl-0.9.13/arch/powerpc/bits/limits.h musl-git/arch/powerpc/bits/limits.h +--- musl-0.9.13/arch/powerpc/bits/limits.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/powerpc/bits/limits.h 2013-09-16 20:31:39.000000000 +0200 +@@ -1,6 +1,5 @@ + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +-#define PAGE_SIZE 4096 + #define LONG_BIT 32 + #endif + +diff -Nur musl-0.9.13/arch/powerpc/reloc.h musl-git/arch/powerpc/reloc.h +--- musl-0.9.13/arch/powerpc/reloc.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/arch/powerpc/reloc.h 2013-09-16 20:31:39.000000000 +0200 +@@ -46,7 +46,7 @@ + for (a+=c+1; *a; a++); + for (a++; *a; a+=2) if (*a<20) t[*a] = a[1]; + base = (char *)t[AT_BASE]; +- if (!base) base = (char *)(t[AT_PHDR] & -4096); ++ if (!base) base = (char *)(t[AT_PHDR] & -t[AT_PAGESZ]); + for (a=dynv; *a; a+=2) if (*a<20) t[*a] = a[1]; + n = t[DT_RELASZ]; + for (a=(void *)(base+t[DT_RELA]); n; a+=3, n-=12) +diff -Nur musl-0.9.13/include/elf.h musl-git/include/elf.h +--- musl-0.9.13/include/elf.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/elf.h 2013-09-16 20:31:39.000000000 +0200 +@@ -105,6 +105,7 @@ + #define ELFOSABI_HPUX 1 + #define ELFOSABI_NETBSD 2 + #define ELFOSABI_LINUX 3 ++#define ELFOSABI_GNU 3 + #define ELFOSABI_SOLARIS 6 + #define ELFOSABI_AIX 7 + #define ELFOSABI_IRIX 8 +@@ -211,7 +212,11 @@ + #define EM_OPENRISC 92 + #define EM_ARC_A5 93 + #define EM_XTENSA 94 +-#define EM_NUM 95 ++#define EM_AARCH64 183 ++#define EM_TILEPRO 188 ++#define EM_MICROBLAZE 189 ++#define EM_TILEGX 191 ++#define EM_NUM 192 + #define EM_ALPHA 0x9026 + + #define EV_NONE 0 +@@ -487,6 +492,8 @@ + #define PT_HIPROC 0x7fffffff + + ++#define PN_XNUM 0xffff ++ + + #define PF_X (1 << 0) + #define PF_W (1 << 1) +@@ -512,12 +519,31 @@ + #define NT_LWPSTATUS 16 + #define NT_LWPSINFO 17 + #define NT_PRFPXREG 20 ++#define NT_SIGINFO 0x53494749 ++#define NT_FILE 0x46494c45 + #define NT_PRXFPREG 0x46e62b7f + #define NT_PPC_VMX 0x100 + #define NT_PPC_SPE 0x101 + #define NT_PPC_VSX 0x102 + #define NT_386_TLS 0x200 + #define NT_386_IOPERM 0x201 ++#define NT_X86_XSTATE 0x202 ++#define NT_S390_HIGH_GPRS 0x300 ++#define NT_S390_TIMER 0x301 ++#define NT_S390_TODCMP 0x302 ++#define NT_S390_TODPREG 0x303 ++#define NT_S390_CTRS 0x304 ++#define NT_S390_PREFIX 0x305 ++#define NT_S390_LAST_BREAK 0x306 ++#define NT_S390_SYSTEM_CALL 0x307 ++#define NT_S390_TDB 0x308 ++#define NT_ARM_VFP 0x400 ++#define NT_ARM_TLS 0x401 ++#define NT_ARM_HW_BREAK 0x402 ++#define NT_ARM_HW_WATCH 0x403 ++#define NT_METAG_CBUF 0x500 ++#define NT_METAG_RPIPE 0x501 ++#define NT_METAG_TLS 0x502 + #define NT_VERSION 1 + + +@@ -666,7 +692,15 @@ + #define DF_1_ENDFILTEE 0x00004000 + #define DF_1_DISPRELDNE 0x00008000 + #define DF_1_DISPRELPND 0x00010000 +- ++#define DF_1_NODIRECT 0x00020000 ++#define DF_1_IGNMULDEF 0x00040000 ++#define DF_1_NOKSYMS 0x00080000 ++#define DF_1_NOHDR 0x00100000 ++#define DF_1_EDITED 0x00200000 ++#define DF_1_NORELOC 0x00400000 ++#define DF_1_SYMINTPOSE 0x00800000 ++#define DF_1_GLOBAUDIT 0x01000000 ++#define DF_1_SINGLETON 0x02000000 + + #define DTF_1_PARINIT 0x00000001 + #define DTF_1_CONFEXP 0x00000002 +@@ -832,6 +866,8 @@ + + #define AT_RANDOM 25 + ++#define AT_HWCAP2 26 ++ + #define AT_EXECFN 31 + + +@@ -979,6 +1015,7 @@ + #define R_386_TLS_DTPMOD32 35 + #define R_386_TLS_DTPOFF32 36 + #define R_386_TLS_TPOFF32 37 ++#define R_386_SIZE32 38 + #define R_386_TLS_GOTDESC 39 + #define R_386_TLS_DESC_CALL 40 + #define R_386_TLS_DESC 41 +@@ -1109,20 +1146,6 @@ + #define DT_SPARC_NUM 2 + + +- +-#define HWCAP_SPARC_FLUSH 1 +-#define HWCAP_SPARC_STBAR 2 +-#define HWCAP_SPARC_SWAP 4 +-#define HWCAP_SPARC_MULDIV 8 +-#define HWCAP_SPARC_V9 16 +-#define HWCAP_SPARC_ULTRA3 32 +-#define HWCAP_SPARC_BLKINIT 64 +-#define HWCAP_SPARC_N2 128 +- +- +- +- +- + #define EF_MIPS_NOREORDER 1 + #define EF_MIPS_PIC 2 + #define EF_MIPS_CPIC 4 +@@ -1139,9 +1162,10 @@ + #define EF_MIPS_ARCH_3 0x20000000 + #define EF_MIPS_ARCH_4 0x30000000 + #define EF_MIPS_ARCH_5 0x40000000 +-#define EF_MIPS_ARCH_32 0x60000000 +-#define EF_MIPS_ARCH_64 0x70000000 +- ++#define EF_MIPS_ARCH_32 0x50000000 ++#define EF_MIPS_ARCH_64 0x60000000 ++#define EF_MIPS_ARCH_32R2 0x70000000 ++#define EF_MIPS_ARCH_64R2 0x80000000 + + + #define E_MIPS_ARCH_1 0x00000000 +@@ -1149,8 +1173,8 @@ + #define E_MIPS_ARCH_3 0x20000000 + #define E_MIPS_ARCH_4 0x30000000 + #define E_MIPS_ARCH_5 0x40000000 +-#define E_MIPS_ARCH_32 0x60000000 +-#define E_MIPS_ARCH_64 0x70000000 ++#define E_MIPS_ARCH_32 0x50000000 ++#define E_MIPS_ARCH_64 0x60000000 + + + +@@ -2020,7 +2044,8 @@ + #define EF_ARM_VFP_FLOAT 0x400 + #define EF_ARM_MAVERICK_FLOAT 0x800 + +- ++#define EF_ARM_ABI_FLOAT_SOFT 0x200 ++#define EF_ARM_ABI_FLOAT_HARD 0x400 + + + #define EF_ARM_SYMSARESORTED 0x04 +@@ -2064,6 +2089,17 @@ + #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) + + ++#define R_AARCH64_NONE 0 ++#define R_AARCH64_ABS64 257 ++#define R_AARCH64_ABS32 258 ++#define R_AARCH64_COPY 1024 ++#define R_AARCH64_GLOB_DAT 1025 ++#define R_AARCH64_JUMP_SLOT 1026 ++#define R_AARCH64_RELATIVE 1027 ++#define R_AARCH64_TLS_DTPMOD64 1028 ++#define R_AARCH64_TLS_DTPREL64 1029 ++#define R_AARCH64_TLS_TPREL64 1030 ++#define R_AARCH64_TLSDESC 1031 + + + #define R_ARM_NONE 0 +@@ -2079,7 +2115,7 @@ + #define R_ARM_THM_PC22 10 + #define R_ARM_THM_PC8 11 + #define R_ARM_AMP_VCALL9 12 +-#define R_ARM_SWI24 13 ++#define R_ARM_TLS_DESC 13 + #define R_ARM_THM_SWI8 14 + #define R_ARM_XPC25 15 + #define R_ARM_THM_XPC22 16 +@@ -2094,12 +2130,78 @@ + #define R_ARM_GOTPC 25 + #define R_ARM_GOT32 26 + #define R_ARM_PLT32 27 ++#define R_ARM_CALL 28 ++#define R_ARM_JUMP24 29 ++#define R_ARM_THM_JUMP24 30 ++#define R_ARM_BASE_ABS 31 + #define R_ARM_ALU_PCREL_7_0 32 + #define R_ARM_ALU_PCREL_15_8 33 + #define R_ARM_ALU_PCREL_23_15 34 + #define R_ARM_LDR_SBREL_11_0 35 + #define R_ARM_ALU_SBREL_19_12 36 + #define R_ARM_ALU_SBREL_27_20 37 ++#define R_ARM_TARGET1 38 ++#define R_ARM_SBREL31 39 ++#define R_ARM_V4BX 40 ++#define R_ARM_TARGET2 41 ++#define R_ARM_PREL31 42 ++#define R_ARM_MOVW_ABS_NC 43 ++#define R_ARM_MOVT_ABS 44 ++#define R_ARM_MOVW_PREL_NC 45 ++#define R_ARM_MOVT_PREL 46 ++#define R_ARM_THM_MOVW_ABS_NC 47 ++#define R_ARM_THM_MOVT_ABS 48 ++#define R_ARM_THM_MOVW_PREL_NC 49 ++#define R_ARM_THM_MOVT_PREL 50 ++#define R_ARM_THM_JUMP19 51 ++#define R_ARM_THM_JUMP6 52 ++#define R_ARM_THM_ALU_PREL_11_0 53 ++#define R_ARM_THM_PC12 54 ++#define R_ARM_ABS32_NOI 55 ++#define R_ARM_REL32_NOI 56 ++#define R_ARM_ALU_PC_G0_NC 57 ++#define R_ARM_ALU_PC_G0 58 ++#define R_ARM_ALU_PC_G1_NC 59 ++#define R_ARM_ALU_PC_G1 60 ++#define R_ARM_ALU_PC_G2 61 ++#define R_ARM_LDR_PC_G1 62 ++#define R_ARM_LDR_PC_G2 63 ++#define R_ARM_LDRS_PC_G0 64 ++#define R_ARM_LDRS_PC_G1 65 ++#define R_ARM_LDRS_PC_G2 66 ++#define R_ARM_LDC_PC_G0 67 ++#define R_ARM_LDC_PC_G1 68 ++#define R_ARM_LDC_PC_G2 69 ++#define R_ARM_ALU_SB_G0_NC 70 ++#define R_ARM_ALU_SB_G0 71 ++#define R_ARM_ALU_SB_G1_NC 72 ++#define R_ARM_ALU_SB_G1 73 ++#define R_ARM_ALU_SB_G2 74 ++#define R_ARM_LDR_SB_G0 75 ++#define R_ARM_LDR_SB_G1 76 ++#define R_ARM_LDR_SB_G2 77 ++#define R_ARM_LDRS_SB_G0 78 ++#define R_ARM_LDRS_SB_G1 79 ++#define R_ARM_LDRS_SB_G2 80 ++#define R_ARM_LDC_SB_G0 81 ++#define R_ARM_LDC_SB_G1 82 ++#define R_ARM_LDC_SB_G2 83 ++#define R_ARM_MOVW_BREL_NC 84 ++#define R_ARM_MOVT_BREL 85 ++#define R_ARM_MOVW_BREL 86 ++#define R_ARM_THM_MOVW_BREL_NC 87 ++#define R_ARM_THM_MOVT_BREL 88 ++#define R_ARM_THM_MOVW_BREL 89 ++#define R_ARM_TLS_GOTDESC 90 ++#define R_ARM_TLS_CALL 91 ++#define R_ARM_TLS_DESCSEQ 92 ++#define R_ARM_THM_TLS_CALL 93 ++#define R_ARM_PLT32_ABS 94 ++#define R_ARM_GOT_ABS 95 ++#define R_ARM_GOT_PREL 96 ++#define R_ARM_GOT_BREL12 97 ++#define R_ARM_GOTOFF12 98 ++#define R_ARM_GOTRELAX 99 + #define R_ARM_GNU_VTENTRY 100 + #define R_ARM_GNU_VTINHERIT 101 + #define R_ARM_THM_PC11 102 +@@ -2113,7 +2215,15 @@ + #define R_ARM_TLS_IE32 107 + + #define R_ARM_TLS_LE32 108 +- ++#define R_ARM_TLS_LDO12 109 ++#define R_ARM_TLS_LE12 110 ++#define R_ARM_TLS_IE12GP 111 ++#define R_ARM_ME_TOO 128 ++#define R_ARM_THM_TLS_DESCSEQ 129 ++#define R_ARM_THM_TLS_DESCSEQ16 129 ++#define R_ARM_THM_TLS_DESCSEQ32 130 ++#define R_ARM_THM_GOT_BREL12 131 ++#define R_ARM_IRELATIVE 160 + #define R_ARM_RXPC25 249 + #define R_ARM_RSBREL32 250 + #define R_ARM_THM_RPC22 251 +@@ -2421,15 +2531,21 @@ + #define R_X86_64_PC64 24 + #define R_X86_64_GOTOFF64 25 + #define R_X86_64_GOTPC32 26 +- ++#define R_X86_64_GOT64 27 ++#define R_X86_64_GOTPCREL64 28 ++#define R_X86_64_GOTPC64 29 ++#define R_X86_64_GOTPLT64 30 ++#define R_X86_64_PLTOFF64 31 ++#define R_X86_64_SIZE32 32 ++#define R_X86_64_SIZE64 33 + + #define R_X86_64_GOTPC32_TLSDESC 34 + #define R_X86_64_TLSDESC_CALL 35 + + #define R_X86_64_TLSDESC 36 + #define R_X86_64_IRELATIVE 37 +- +-#define R_X86_64_NUM 38 ++#define R_X86_64_RELATIVE64 38 ++#define R_X86_64_NUM 39 + + + +diff -Nur musl-0.9.13/include/limits.h musl-git/include/limits.h +--- musl-0.9.13/include/limits.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/limits.h 2013-09-16 20:31:39.000000000 +0200 +@@ -40,7 +40,9 @@ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + + #define PIPE_BUF 4096 ++#ifdef PAGE_SIZE + #define PAGESIZE PAGE_SIZE ++#endif + #define FILESIZEBITS 64 + #define NAME_MAX 255 + #define SYMLINK_MAX 255 +diff -Nur musl-0.9.13/include/net/if_arp.h musl-git/include/net/if_arp.h +--- musl-0.9.13/include/net/if_arp.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/net/if_arp.h 2013-09-16 20:31:39.000000000 +0200 +@@ -52,6 +52,7 @@ + #define ARPHRD_ROSE 270 + #define ARPHRD_X25 271 + #define ARPHRD_HWX25 272 ++#define ARPHRD_CAN 280 + #define ARPHRD_PPP 512 + #define ARPHRD_CISCO 513 + #define ARPHRD_HDLC ARPHRD_CISCO +@@ -84,7 +85,12 @@ + #define ARPHRD_IEEE80211_PRISM 802 + #define ARPHRD_IEEE80211_RADIOTAP 803 + #define ARPHRD_IEEE802154 804 +-#define ARPHRD_IEEE802154_PHY 805 ++#define ARPHRD_IEEE802154_MONITOR 805 ++#define ARPHRD_PHONET 820 ++#define ARPHRD_PHONET_PIPE 821 ++#define ARPHRD_CAIF 822 ++#define ARPHRD_IP6GRE 823 ++#define ARPHRD_NETLINK 824 + + #define ARPHRD_VOID 0xFFFF + #define ARPHRD_NONE 0xFFFE +diff -Nur musl-0.9.13/include/netinet/in.h musl-git/include/netinet/in.h +--- musl-0.9.13/include/netinet/in.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/netinet/in.h 2013-09-16 20:31:39.000000000 +0200 +@@ -91,10 +91,12 @@ + #define IPPROTO_NONE 59 + #define IPPROTO_DSTOPTS 60 + #define IPPROTO_MTP 92 ++#define IPPROTO_BEETPH 94 + #define IPPROTO_ENCAP 98 + #define IPPROTO_PIM 103 + #define IPPROTO_COMP 108 + #define IPPROTO_SCTP 132 ++#define IPPROTO_MH 135 + #define IPPROTO_UDPLITE 136 + #define IPPROTO_RAW 255 + #define IPPROTO_MAX 256 +diff -Nur musl-0.9.13/include/sys/ptrace.h musl-git/include/sys/ptrace.h +--- musl-0.9.13/include/sys/ptrace.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/sys/ptrace.h 2013-09-16 20:31:39.000000000 +0200 +@@ -37,6 +37,8 @@ + #define PTRACE_INTERRUPT 0x4207 + #define PTRACE_LISTEN 0x4208 + #define PTRACE_PEEKSIGINFO 0x4209 ++#define PTRACE_GETSIGMASK 0x420a ++#define PTRACE_SETSIGMASK 0x420b + + #define PT_READ_I PTRACE_PEEKTEXT + #define PT_READ_D PTRACE_PEEKDATA +diff -Nur musl-0.9.13/include/sys/resource.h musl-git/include/sys/resource.h +--- musl-0.9.13/include/sys/resource.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/sys/resource.h 2013-09-16 20:31:39.000000000 +0200 +@@ -59,6 +59,9 @@ + #define prlimit64 prlimit + #endif + ++#define PRIO_MIN (-20) ++#define PRIO_MAX 20 ++ + #define PRIO_PROCESS 0 + #define PRIO_PGRP 1 + #define PRIO_USER 2 +diff -Nur musl-0.9.13/include/sys/socket.h musl-git/include/sys/socket.h +--- musl-0.9.13/include/sys/socket.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/include/sys/socket.h 2013-09-16 20:31:39.000000000 +0200 +@@ -199,6 +199,7 @@ + #define SO_NOFCS 43 + #define SO_LOCK_FILTER 44 + #define SO_SELECT_ERR_QUEUE 45 ++#define SO_BUSY_POLL 46 + + #ifndef SOL_SOCKET + #define SOL_SOCKET 1 +diff -Nur musl-0.9.13/include/wait.h musl-git/include/wait.h +--- musl-0.9.13/include/wait.h 1970-01-01 01:00:00.000000000 +0100 ++++ musl-git/include/wait.h 2013-09-16 20:31:39.000000000 +0200 +@@ -0,0 +1,2 @@ ++#warning redirecting incorrect #include <wait.h> to <sys/wait.h> ++#include <sys/wait.h> +diff -Nur musl-0.9.13/src/aio/aio_readwrite.c musl-git/src/aio/aio_readwrite.c +--- musl-0.9.13/src/aio/aio_readwrite.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/aio/aio_readwrite.c 2013-09-16 20:31:39.000000000 +0200 +@@ -2,8 +2,8 @@ + #include <fcntl.h> + #include <errno.h> + #include <unistd.h> +-#include <limits.h> + #include "pthread_impl.h" ++#include "libc.h" + + static void dummy(void) + { +diff -Nur musl-0.9.13/src/aio/lio_listio.c musl-git/src/aio/lio_listio.c +--- musl-0.9.13/src/aio/lio_listio.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/aio/lio_listio.c 2013-09-16 20:31:39.000000000 +0200 +@@ -1,9 +1,9 @@ + #include <aio.h> + #include <errno.h> +-#include <limits.h> + #include <unistd.h> + #include <string.h> + #include "pthread_impl.h" ++#include "libc.h" + + struct lio_state { + struct sigevent *sev; +diff -Nur musl-0.9.13/src/conf/fpathconf.c musl-git/src/conf/fpathconf.c +--- musl-0.9.13/src/conf/fpathconf.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/conf/fpathconf.c 2013-09-16 20:31:39.000000000 +0200 +@@ -19,11 +19,11 @@ + [_PC_PRIO_IO] = -1, + [_PC_SOCK_MAXBUF] = -1, + [_PC_FILESIZEBITS] = FILESIZEBITS, +- [_PC_REC_INCR_XFER_SIZE] = PAGE_SIZE, +- [_PC_REC_MAX_XFER_SIZE] = PAGE_SIZE, +- [_PC_REC_MIN_XFER_SIZE] = PAGE_SIZE, +- [_PC_REC_XFER_ALIGN] = PAGE_SIZE, +- [_PC_ALLOC_SIZE_MIN] = PAGE_SIZE, ++ [_PC_REC_INCR_XFER_SIZE] = 4096, ++ [_PC_REC_MAX_XFER_SIZE] = 4096, ++ [_PC_REC_MIN_XFER_SIZE] = 4096, ++ [_PC_REC_XFER_ALIGN] = 4096, ++ [_PC_ALLOC_SIZE_MIN] = 4096, + [_PC_SYMLINK_MAX] = SYMLINK_MAX, + [_PC_2_SYMLINKS] = 1 + }; +diff -Nur musl-0.9.13/src/conf/sysconf.c musl-git/src/conf/sysconf.c +--- musl-0.9.13/src/conf/sysconf.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/conf/sysconf.c 2013-09-16 20:31:39.000000000 +0200 +@@ -3,6 +3,7 @@ + #include <errno.h> + #include <sys/resource.h> + #include "syscall.h" ++#include "libc.h" + + #define VER (-2) + #define OFLOW (-3) +@@ -40,9 +41,9 @@ + [_SC_AIO_PRIO_DELTA_MAX] = 0, /* ?? */ + [_SC_DELAYTIMER_MAX] = _POSIX_DELAYTIMER_MAX, + [_SC_MQ_OPEN_MAX] = -1, +- [_SC_MQ_PRIO_MAX] = MQ_PRIO_MAX, ++ [_SC_MQ_PRIO_MAX] = OFLOW, + [_SC_VERSION] = VER, +- [_SC_PAGE_SIZE] = PAGE_SIZE, ++ [_SC_PAGE_SIZE] = OFLOW, + [_SC_RTSIG_MAX] = 63, /* ?? */ + [_SC_SEM_NSEMS_MAX] = SEM_NSEMS_MAX, + [_SC_SEM_VALUE_MAX] = OFLOW, +@@ -221,6 +222,9 @@ + } else if (values[name] == OFLOW) { + if (name == _SC_ARG_MAX) return ARG_MAX; + if (name == _SC_SEM_VALUE_MAX) return SEM_VALUE_MAX; ++ if (name == _SC_MQ_PRIO_MAX) return MQ_PRIO_MAX; ++ /* name == _SC_PAGE_SIZE */ ++ return PAGE_SIZE; + } else if (values[name] == CPUCNT) { + unsigned char set[128] = {1}; + int i, cnt; +diff -Nur musl-0.9.13/src/env/__libc_start_main.c musl-git/src/env/__libc_start_main.c +--- musl-0.9.13/src/env/__libc_start_main.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/env/__libc_start_main.c 2013-09-16 20:31:39.000000000 +0200 +@@ -26,6 +26,7 @@ + for (i=0; auxv[i]; i+=2) if (auxv[i]<AUX_CNT) aux[auxv[i]] = auxv[i+1]; + __hwcap = aux[AT_HWCAP]; + __sysinfo = aux[AT_SYSINFO]; ++ libc.page_size = aux[AT_PAGESZ]; + + if (pn) { + __progname = __progname_full = pn; +diff -Nur musl-0.9.13/src/internal/libc.h musl-git/src/internal/libc.h +--- musl-0.9.13/src/internal/libc.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/internal/libc.h 2013-09-16 20:31:39.000000000 +0200 +@@ -3,6 +3,7 @@ + + #include <stdlib.h> + #include <stdio.h> ++#include <limits.h> + + struct __libc { + void *main_thread; +@@ -14,10 +15,15 @@ + FILE *ofl_head; + int ofl_lock[2]; + size_t tls_size; ++ size_t page_size; + }; + + extern size_t __hwcap; + ++#ifndef PAGE_SIZE ++#define PAGE_SIZE libc.page_size ++#endif ++ + #if !defined(__PIC__) || (100*__GNUC__+__GNUC_MINOR__ >= 303 && !defined(__PCC__)) + + #ifdef __PIC__ +diff -Nur musl-0.9.13/src/internal/libm.h musl-git/src/internal/libm.h +--- musl-0.9.13/src/internal/libm.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/internal/libm.h 2013-09-16 20:31:39.000000000 +0200 +@@ -17,117 +17,115 @@ + #include <float.h> + #include <math.h> + #include <complex.h> ++#include <endian.h> + +-#include "longdbl.h" +- +-#include "libc.h" +- +-union fshape { +- float value; +- uint32_t bits; ++#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 ++#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN ++union ldshape { ++ long double f; ++ struct { ++ uint64_t m; ++ uint16_t se; ++ } i; + }; +- +-union dshape { +- double value; +- uint64_t bits; ++#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN ++union ldshape { ++ long double f; ++ struct { ++ uint64_t lo; ++ uint32_t mid; ++ uint16_t top; ++ uint16_t se; ++ } i; ++ struct { ++ uint64_t lo; ++ uint64_t hi; ++ } i2; + }; ++#else ++#error Unsupported long double representation ++#endif + +-#define FORCE_EVAL(x) do { \ +- if (sizeof(x) == sizeof(float)) { \ +- volatile float __x; \ +- __x = (x); \ +- } else if (sizeof(x) == sizeof(double)) { \ +- volatile double __x; \ +- __x = (x); \ +- } else { \ +- volatile long double __x; \ +- __x = (x); \ +- } \ ++#define FORCE_EVAL(x) do { \ ++ if (sizeof(x) == sizeof(float)) { \ ++ volatile float __x; \ ++ __x = (x); \ ++ } else if (sizeof(x) == sizeof(double)) { \ ++ volatile double __x; \ ++ __x = (x); \ ++ } else { \ ++ volatile long double __x; \ ++ __x = (x); \ ++ } \ + } while(0) + + /* Get two 32 bit ints from a double. */ +-#define EXTRACT_WORDS(hi,lo,d) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- (hi) = __u.bits >> 32; \ +- (lo) = (uint32_t)__u.bits; \ +-} while (0) +- +-/* Get a 64 bit int from a double. */ +-#define EXTRACT_WORD64(i,d) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- (i) = __u.bits; \ ++#define EXTRACT_WORDS(hi,lo,d) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.f = (d); \ ++ (hi) = __u.i >> 32; \ ++ (lo) = (uint32_t)__u.i; \ + } while (0) + + /* Get the more significant 32 bit int from a double. */ +-#define GET_HIGH_WORD(i,d) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- (i) = __u.bits >> 32; \ ++#define GET_HIGH_WORD(hi,d) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.f = (d); \ ++ (hi) = __u.i >> 32; \ + } while (0) + + /* Get the less significant 32 bit int from a double. */ +-#define GET_LOW_WORD(i,d) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- (i) = (uint32_t)__u.bits; \ ++#define GET_LOW_WORD(lo,d) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.f = (d); \ ++ (lo) = (uint32_t)__u.i; \ + } while (0) + + /* Set a double from two 32 bit ints. */ +-#define INSERT_WORDS(d,hi,lo) \ +-do { \ +- union dshape __u; \ +- __u.bits = ((uint64_t)(hi) << 32) | (uint32_t)(lo); \ +- (d) = __u.value; \ +-} while (0) +- +-/* Set a double from a 64 bit int. */ +-#define INSERT_WORD64(d,i) \ +-do { \ +- union dshape __u; \ +- __u.bits = (i); \ +- (d) = __u.value; \ ++#define INSERT_WORDS(d,hi,lo) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.i = ((uint64_t)(hi)<<32) | (uint32_t)(lo); \ ++ (d) = __u.f; \ + } while (0) + + /* Set the more significant 32 bits of a double from an int. */ +-#define SET_HIGH_WORD(d,hi) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- __u.bits &= 0xffffffff; \ +- __u.bits |= (uint64_t)(hi) << 32; \ +- (d) = __u.value; \ ++#define SET_HIGH_WORD(d,hi) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.f = (d); \ ++ __u.i &= 0xffffffff; \ ++ __u.i |= (uint64_t)(hi) << 32; \ ++ (d) = __u.f; \ + } while (0) + + /* Set the less significant 32 bits of a double from an int. */ +-#define SET_LOW_WORD(d,lo) \ +-do { \ +- union dshape __u; \ +- __u.value = (d); \ +- __u.bits &= 0xffffffff00000000ull; \ +- __u.bits |= (uint32_t)(lo); \ +- (d) = __u.value; \ ++#define SET_LOW_WORD(d,lo) \ ++do { \ ++ union {double f; uint64_t i;} __u; \ ++ __u.f = (d); \ ++ __u.i &= 0xffffffff00000000ull; \ ++ __u.i |= (uint32_t)(lo); \ ++ (d) = __u.f; \ + } while (0) + + /* Get a 32 bit int from a float. */ +-#define GET_FLOAT_WORD(i,d) \ +-do { \ +- union fshape __u; \ +- __u.value = (d); \ +- (i) = __u.bits; \ ++#define GET_FLOAT_WORD(w,d) \ ++do { \ ++ union {float f; uint32_t i;} __u; \ ++ __u.f = (d); \ ++ (w) = __u.i; \ + } while (0) + + /* Set a float from a 32 bit int. */ +-#define SET_FLOAT_WORD(d,i) \ +-do { \ +- union fshape __u; \ +- __u.bits = (i); \ +- (d) = __u.value; \ ++#define SET_FLOAT_WORD(d,w) \ ++do { \ ++ union {float f; uint32_t i;} __u; \ ++ __u.i = (w); \ ++ (d) = __u.f; \ + } while (0) + + /* fdlibm kernel functions */ +@@ -157,15 +155,4 @@ + long double __polevll(long double, const long double *, int); + long double __p1evll(long double, const long double *, int); + +-#if 0 +-/* Attempt to get strict C99 semantics for assignment with non-C99 compilers. */ +-#define STRICT_ASSIGN(type, lval, rval) do { \ +- volatile type __v = (rval); \ +- (lval) = __v; \ +-} while (0) +-#else +-/* Should work with -fexcess-precision=standard (>=gcc-4.5) or -ffloat-store */ +-#define STRICT_ASSIGN(type, lval, rval) ((lval) = (type)(rval)) +-#endif +- + #endif +diff -Nur musl-0.9.13/src/internal/longdbl.h musl-git/src/internal/longdbl.h +--- musl-0.9.13/src/internal/longdbl.h 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/internal/longdbl.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,137 +0,0 @@ +-#ifndef _LDHACK_H +-#define _LDHACK_H +- +-#include <float.h> +-#include <stdint.h> +- +-#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +-#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 +-union ldshape { +- long double value; +- struct { +- uint64_t m; +- uint16_t exp:15; +- uint16_t sign:1; +- uint16_t pad; +- } bits; +-}; +-#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 +-union ldshape { +- long double value; +- struct { +- uint64_t mlo; +- uint64_t mhi:48; +- uint16_t exp:15; +- uint16_t sign:1; +- } bits; +-}; +-#else +-#error Unsupported long double representation +-#endif +- +- +-// FIXME: hacks to make freebsd+openbsd long double code happy +- +-// union and macros for freebsd +- +-#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 +- +-union IEEEl2bits { +- long double e; +- struct { +- uint32_t manl:32; +- uint32_t manh:32; +- uint32_t exp:15; +- uint32_t sign:1; +- uint32_t pad:16; +- } bits; +- struct { +- uint64_t man:64; +- uint32_t expsign:16; +- uint32_t pad:16; +- } xbits; +-}; +- +-#define LDBL_MANL_SIZE 32 +-#define LDBL_MANH_SIZE 32 +-#define LDBL_NBIT (1ull << LDBL_MANH_SIZE-1) +-#undef LDBL_IMPLICIT_NBIT +-#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) +- +-#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 +-/* +-// ld128 float.h +-//#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L +-#define LDBL_MAX 0x1.ffffffffffffffffffffffffffffp+16383 +-#define LDBL_MAX_EXP 16384 +-#define LDBL_HAS_INFINITY 1 +-//#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L +-#define LDBL_MIN 0x1p-16382 +-#define LDBL_HAS_QUIET_NAN 1 +-#define LDBL_HAS_DENORM 1 +-//#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L +-#define LDBL_EPSILON 0x1p-112 +-#define LDBL_MANT_DIG 113 +-#define LDBL_MIN_EXP (-16381) +-#define LDBL_MAX_10_EXP 4932 +-#define LDBL_DENORM_MIN 0x0.0000000000000000000000000001p-16381 +-#define LDBL_MIN_10_EXP (-4931) +-#define LDBL_DIG 33 +-*/ +- +-union IEEEl2bits { +- long double e; +- struct { +- uint64_t manl:64; +- uint64_t manh:48; +- uint32_t exp:15; +- uint32_t sign:1; +- } bits; +- struct { +- uint64_t unused0:64; +- uint64_t unused1:48; +- uint32_t expsign:16; +- } xbits; +-}; +- +-#define LDBL_MANL_SIZE 64 +-#define LDBL_MANH_SIZE 48 +-#define LDBL_NBIT (1ull << LDBL_MANH_SIZE) +-#define LDBL_IMPLICIT_NBIT 1 +-#define mask_nbit_l(u) +- +-#endif +- +- +-// macros for openbsd +- +-#define GET_LDOUBLE_WORDS(se,mh,ml, f) do{ \ +- union IEEEl2bits u; \ +- u.e = (f); \ +- (se) = u.xbits.expsign; \ +- (mh) = u.bits.manh; \ +- (ml) = u.bits.manl; \ +-}while(0) +- +-#define SET_LDOUBLE_WORDS(f, se,mh,ml) do{ \ +- union IEEEl2bits u; \ +- u.xbits.expsign = (se); \ +- u.bits.manh = (mh); \ +- u.bits.manl = (ml); \ +- (f) = u.e; \ +-}while(0) +- +-#define GET_LDOUBLE_EXP(se, f) do{ \ +- union IEEEl2bits u; \ +- u.e = (f); \ +- (se) = u.xbits.expsign; \ +-}while(0) +- +-#define SET_LDOUBLE_EXP(f, se) do{ \ +- union IEEEl2bits u; \ +- u.e = (f); \ +- u.xbits.expsign = (se); \ +- (f) = u.e; \ +-}while(0) +- +-#endif +diff -Nur musl-0.9.13/src/ldso/dynlink.c musl-git/src/ldso/dynlink.c +--- musl-0.9.13/src/ldso/dynlink.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/ldso/dynlink.c 2013-09-16 20:31:39.000000000 +0200 +@@ -614,6 +614,8 @@ + sys_path = ""; + } + fclose(f); ++ } else if (errno != ENOENT) { ++ sys_path = ""; + } + } + if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib"; +@@ -978,6 +980,7 @@ + env_preload = 0; + libc.secure = 1; + } ++ libc.page_size = aux[AT_PAGESZ]; + + /* If the dynamic linker was invoked as a program itself, AT_BASE + * will not be set. In that case, we assume the base address is +diff -Nur musl-0.9.13/src/legacy/getpagesize.c musl-git/src/legacy/getpagesize.c +--- musl-0.9.13/src/legacy/getpagesize.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/legacy/getpagesize.c 2013-09-16 20:31:39.000000000 +0200 +@@ -1,5 +1,5 @@ + #include <unistd.h> +-#include <limits.h> ++#include "libc.h" + + int getpagesize(void) + { +diff -Nur musl-0.9.13/src/legacy/valloc.c musl-git/src/legacy/valloc.c +--- musl-0.9.13/src/legacy/valloc.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/legacy/valloc.c 2013-09-16 20:31:39.000000000 +0200 +@@ -1,6 +1,6 @@ + #define _BSD_SOURCE + #include <stdlib.h> +-#include <limits.h> ++#include "libc.h" + + void *valloc(size_t size) + { +diff -Nur musl-0.9.13/src/math/__cosl.c musl-git/src/math/__cosl.c +--- musl-0.9.13/src/math/__cosl.c 2013-08-30 23:30:53.000000000 +0200 ++++ musl-git/src/math/__cosl.c 2013-09-16 20:31:39.000000000 +0200 +@@ -1,4 +1,5 @@ + /* origin: FreeBSD /usr/src/lib/msun/ld80/k_cosl.c */ ++/* origin: FreeBSD /usr/src/lib/msun/ld128/k_cosl.c */ + /* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. +@@ -14,7 +15,8 @@ + + #include "libm.h" + +-#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 ++#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EX |