gcc: convert musl patches to -Np1

This commit is contained in:
Đoàn Trần Công Danh 2021-06-21 19:19:41 +07:00
parent 63b9d4b51f
commit cc162db0de
4 changed files with 38 additions and 40 deletions

View file

@ -7,8 +7,8 @@ with freestanding versions of libucontext
Souurce: Adélie Linux, q66 Souurce: Adélie Linux, q66
URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
--- Makefile.in --- a/Makefile.in
+++ Makefile.in +++ b/Makefile.in
@@ -46325,7 +46325,7 @@ configure-target-libgo: @@ -46325,7 +46325,7 @@ configure-target-libgo:
esac; \ esac; \
module_srcdir=libgo; \ module_srcdir=libgo; \
@ -18,8 +18,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
$$s/$$module_srcdir/configure \ $$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \ --srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--- libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh
+++ libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh
@@ -379,11 +379,7 @@ fi @@ -379,11 +379,7 @@ fi
# Some basic types. # Some basic types.
echo 'type Size_t _size_t' >> ${OUT} echo 'type Size_t _size_t' >> ${OUT}
@ -33,8 +33,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
echo "type Mode_t _mode_t" >> ${OUT} echo "type Mode_t _mode_t" >> ${OUT}
echo "type Pid_t _pid_t" >> ${OUT} echo "type Pid_t _pid_t" >> ${OUT}
echo "type Uid_t _uid_t" >> ${OUT} echo "type Uid_t _uid_t" >> ${OUT}
--- libgo/go/runtime/mem_gccgo.go --- a/libgo/go/runtime/mem_gccgo.go
+++ libgo/go/runtime/mem_gccgo.go +++ b/libgo/go/runtime/mem_gccgo.go
@@ -16,7 +16,7 @@ import ( @@ -16,7 +16,7 @@ import (
//go:linkname sysFree runtime.sysFree //go:linkname sysFree runtime.sysFree
@ -53,8 +53,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
p := sysMmap(addr, n, prot, flags, fd, off) p := sysMmap(addr, n, prot, flags, fd, off)
if uintptr(p) == _MAP_FAILED { if uintptr(p) == _MAP_FAILED {
return nil, errno() return nil, errno()
--- libgo/go/runtime/signal_gccgo.go --- a/libgo/go/runtime/signal_gccgo.go
+++ libgo/go/runtime/signal_gccgo.go +++ b/libgo/go/runtime/signal_gccgo.go
@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr { @@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
if sigaction(i, nil, &sa) < 0 { if sigaction(i, nil, &sa) < 0 {
// On GNU/Linux glibc rejects attempts to call // On GNU/Linux glibc rejects attempts to call
@ -64,8 +64,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
return _SIG_DFL return _SIG_DFL
} }
throw("sigaction read failure") throw("sigaction read failure")
--- libgo/go/syscall/errstr.go --- a/libgo/go/syscall/errstr.go
+++ libgo/go/syscall/errstr.go +++ b/libgo/go/syscall/errstr.go
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -74,7 +74,7 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
package syscall package syscall
--- libgo/go/syscall/errstr_glibc.go --- a/libgo/go/syscall/errstr_glibc.go
+++ /dev/null +++ /dev/null
@@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
-// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings. -// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings.
@ -110,8 +110,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
- } - }
- return string(b[:i]) - return string(b[:i])
-} -}
--- libgo/go/syscall/libcall_linux.go --- a/libgo/go/syscall/libcall_linux.go
+++ libgo/go/syscall/libcall_linux.go +++ b/libgo/go/syscall/libcall_linux.go
@@ -206,19 +206,19 @@ func Gettid() (tid int) { @@ -206,19 +206,19 @@ func Gettid() (tid int) {
//sys Setxattr(path string, attr string, data []byte, flags int) (err error) //sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
@ -140,8 +140,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
plwoff = &lwoff plwoff = &lwoff
} }
n, err = splice(rfd, plroff, wfd, plwoff, len, flags) n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
--- libgo/mksigtab.sh --- a/libgo/mksigtab.sh
+++ libgo/mksigtab.sh +++ b/libgo/mksigtab.sh
@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}' @@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}' checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}'
checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}' checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}'
@ -165,8 +165,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
fi fi
if test "${GOOS}" = "aix"; then if test "${GOOS}" = "aix"; then
--- libgo/runtime/go-signal.c 2020-07-23 08:35:19.004402840 +0200 --- a/libgo/runtime/go-signal.c 2020-07-23 08:35:19.004402840 +0200
+++ - 2020-08-09 21:35:54.352886232 +0200 +++ b/libgo/runtime/go-signal.c 2020-08-09 21:35:54.352886232 +0200
@@ -224,7 +224,11 @@ @@ -224,7 +224,11 @@
#elif defined(__alpha__) && defined(__linux__) #elif defined(__alpha__) && defined(__linux__)
ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc; ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc;
@ -189,8 +189,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
{ {
mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
int i; int i;
--- libgo/runtime/runtime.h --- a/libgo/runtime/runtime.h
+++ libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h
@@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*); @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
void __go_makecontext(__go_context_t*, void (*)(), void*, size_t); void __go_makecontext(__go_context_t*, void (*)(), void*, size_t);
#else #else
@ -208,8 +208,8 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
#endif #endif
// Symbols defined by the linker. // Symbols defined by the linker.
--- libgo/sysinfo.c --- a/libgo/sysinfo.c
+++ libgo/sysinfo.c +++ b/libgo/sysinfo.c
@@ -73,9 +73,6 @@ @@ -73,9 +73,6 @@
#include <sys/times.h> #include <sys/times.h>
#include <sys/wait.h> #include <sys/wait.h>

View file

@ -3,8 +3,8 @@ Upstream: Unknown
Reason: Patch libgnarl to not use function missing from musl. Reason: Patch libgnarl to not use function missing from musl.
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
--- gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800 --- a/gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800
+++ gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700
@@ -394,12 +394,6 @@ package System.OS_Interface is @@ -394,12 +394,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
@ -31,8 +31,8 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
sched_priority : int; -- scheduling priority sched_priority : int; -- scheduling priority
end record; end record;
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
--- gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800 --- a/gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800
+++ gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800
@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper @@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
pragma Import pragma Import
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");

View file

@ -2,8 +2,8 @@ First part taken from Alpine.
Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
--- gcc/gcc.c --- a/gcc/gcc.c
+++ gcc/gcc.c +++ b/gcc/gcc.c
@@ -874,10 +874,15 @@ proper position among the other output files. */ @@ -874,10 +874,15 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif #endif
@ -31,8 +31,8 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
%{coverage:-fprofile-arcs -ftest-coverage}\ %{coverage:-fprofile-arcs -ftest-coverage}\
%{fprofile-arcs|fprofile-generate*|coverage:\ %{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\ %{!fprofile-update=single:\
--- gcc/params.opt --- a/gcc/params.opt
+++ gcc/params.opt +++ b/gcc/params.opt
@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim @@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value. The maximum number of SSA_NAME assignments to follow in determining a value.
@ -42,8 +42,8 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
The lower bound for a buffer to be considered for stack smashing protection. The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size= -param=stack-clash-protection-guard-size=
--- gcc/config/i386/gnu-user-common.h --- a/gcc/config/i386/gnu-user-common.h
+++ gcc/config/i386/gnu-user-common.h +++ b/gcc/config/i386/gnu-user-common.h
@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see @@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see
/* Static stack checking is supported by means of probes. */ /* Static stack checking is supported by means of probes. */
@ -54,8 +54,8 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE -#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
-#define TARGET_CAN_SPLIT_STACK -#define TARGET_CAN_SPLIT_STACK
-#endif -#endif
--- gcc/config/i386/gnu.h --- a/gcc/config/i386/gnu.h
+++ gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h
@@ -40,11 +40,6 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>. @@ -40,11 +40,6 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */ /* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14 #define TARGET_THREAD_SSP_OFFSET 0x14

View file

@ -184,13 +184,11 @@ pre_configure() {
# Do not run fixincludes # Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
case "$XBPS_TARGET_MACHINE" in if [ "$XBPS_TARGET_LIBC" = musl ]; then
*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
patch -p0 -i ${FILESDIR}/libgnarl-musl.patch patch -p1 -i ${FILESDIR}/libssp-musl.patch
patch -p0 -i ${FILESDIR}/libssp-musl.patch patch -p1 -i ${FILESDIR}/gccgo-musl.patch
patch -p0 -i ${FILESDIR}/gccgo-musl.patch fi
;;
esac
} }
do_configure() { do_configure() {
local _langs _args _hash local _langs _args _hash