Skip to content

Commit 2eb3f0e

Browse files
committed
New package: gcc11-11.5.0
1 parent 664d35a commit 2eb3f0e

15 files changed

+732
-0
lines changed

srcpkgs/gcc11-gdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gcc11
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
First part taken from Alpine.
2+
3+
Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
4+
5+
--- a/gcc/gcc.c
6+
+++ b/gcc/gcc.c
7+
@@ -977,10 +977,15 @@ proper position among the other output f
8+
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
9+
#endif
10+
11+
+#ifdef ENABLE_DEFAULT_SSP
12+
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
13+
+#else
14+
+#define NO_SSP_SPEC ""
15+
+#endif
16+
+
17+
#ifndef LINK_SSP_SPEC
18+
#ifdef TARGET_LIBC_PROVIDES_SSP
19+
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
20+
- "|fstack-protector-strong|fstack-protector-explicit:}"
21+
+#define LINK_SSP_SPEC "-lssp_nonshared"
22+
#else
23+
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
24+
"|fstack-protector-strong|fstack-protector-explicit" \
25+
@@ -1273,7 +1278,7 @@ static const char *cc1_options =
26+
%{-version:--version}\
27+
%{-help=*:--help=%*}\
28+
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
29+
- %{fsyntax-only:-o %j} %{-param*}\
30+
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
31+
%{coverage:-fprofile-arcs -ftest-coverage}\
32+
%{fprofile-arcs|fprofile-generate*|coverage:\
33+
%{!fprofile-update=single:\
34+
--- a/gcc/params.opt
35+
+++ b/gcc/params.opt
36+
@@ -950,7 +950,7 @@ Common Joined UInteger Var(param_ssa_nam
37+
The maximum number of SSA_NAME assignments to follow in determining a value.
38+
39+
-param=ssp-buffer-size=
40+
-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
41+
+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
42+
The lower bound for a buffer to be considered for stack smashing protection.
43+
44+
-param=stack-clash-protection-guard-size=
45+
--- a/gcc/config/i386/gnu-user-common.h
46+
+++ b/gcc/config/i386/gnu-user-common.h
47+
@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3.
48+
49+
/* Static stack checking is supported by means of probes. */
50+
#define STACK_CHECK_STATIC_BUILTIN 1
51+
-
52+
-/* We only build the -fsplit-stack support in libgcc if the
53+
- assembler has full support for the CFI directives. */
54+
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
55+
-#define TARGET_CAN_SPLIT_STACK
56+
-#endif
57+
--- a/gcc/config/i386/gnu.h
58+
+++ b/gcc/config/i386/gnu.h
59+
@@ -40,11 +40,6 @@ along with GCC. If not, see <http://www
60+
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
61+
#define TARGET_THREAD_SSP_OFFSET 0x14
62+
63+
-/* We only build the -fsplit-stack support in libgcc if the
64+
- assembler has full support for the CFI directives. */
65+
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
66+
-#define TARGET_CAN_SPLIT_STACK
67+
-#endif
68+
/* We steal the last transactional memory word. */
69+
#define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
70+
#endif
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
Always use lib64 for 64-bit and lib32 for 32-bit.
2+
3+
Do not change the dynamic linkers in any way, though.
4+
5+
When adding a new platform, fix this up too.
6+
7+
--- a/gcc/config/aarch64/t-aarch64-linux
8+
+++ b/gcc/config/aarch64/t-aarch64-linux
9+
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
10+
LIB1ASMFUNCS = _aarch64_sync_cache_range
11+
12+
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
13+
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
14+
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib64
15+
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
16+
17+
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
18+
--- a/gcc/config/i386/t-linux64
19+
+++ b/gcc/config/i386/t-linux64
20+
@@ -33,6 +33,6 @@
21+
comma=,
22+
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
23+
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
24+
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
25+
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
26+
+MULTILIB_OSDIRNAMES = m64=../lib64
27+
+MULTILIB_OSDIRNAMES+= m32=../lib32
28+
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
29+
--- a/gcc/config/mips/t-linux64
30+
+++ b/gcc/config/mips/t-linux64
31+
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
32+
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
33+
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
34+
MULTILIB_OSDIRNAMES = \
35+
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
36+
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
37+
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
38+
+ ../lib32 \
39+
+ ../lib \
40+
+ ../lib64
41+
--- a/gcc/config/rs6000/t-linux
42+
+++ b/gcc/config/rs6000/t-linux
43+
@@ -2,7 +2,8 @@
44+
# or soft-float.
45+
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
46+
ifneq (,$(findstring powerpc64,$(target)))
47+
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
48+
+MULTILIB_OSDIRNAMES := m64=../lib64
49+
+MULTILIB_OSDIRNAMES += m32=../lib32
50+
else
51+
MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
52+
endif
53+
@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target)
54+
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
55+
endif
56+
ifneq (,$(findstring powerpc64le,$(target)))
57+
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
58+
+MULTILIB_OSDIRNAMES := m64=../lib64
59+
+MULTILIB_OSDIRNAMES += m32=../lib32
60+
endif
61+
endif
62+
63+
--- a/gcc/config/rs6000/t-linux64
64+
+++ b/gcc/config/rs6000/t-linux64
65+
@@ -28,8 +28,8 @@
66+
MULTILIB_OPTIONS := m64/m32
67+
MULTILIB_DIRNAMES := 64 32
68+
MULTILIB_EXTRA_OPTS :=
69+
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
70+
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
71+
+MULTILIB_OSDIRNAMES := m64=../lib64
72+
+MULTILIB_OSDIRNAMES += m32=../lib32
73+
74+
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
75+
$(COMPILE) $<
76+
--- a/gcc/config/rs6000/t-linux64bele
77+
+++ b/gcc/config/rs6000/t-linux64bele
78+
@@ -2,6 +2,6 @@
79+
80+
MULTILIB_OPTIONS += mlittle
81+
MULTILIB_DIRNAMES += le
82+
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
83+
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
84+
+MULTILIB_OSDIRNAMES = m64=../lib64
85+
+MULTILIB_OSDIRNAMES+= m32=../lib32
86+
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
87+
--- a/gcc/config/rs6000/t-linux64lebe
88+
+++ b/gcc/config/rs6000/t-linux64lebe
89+
@@ -2,6 +2,6 @@
90+
91+
MULTILIB_OPTIONS += mbig
92+
MULTILIB_DIRNAMES += be
93+
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
94+
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
95+
+MULTILIB_OSDIRNAMES := m64=../lib64
96+
+MULTILIB_OSDIRNAMES += m32=../lib32
97+
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
98+
--- a/gcc/config/s390/t-linux64
99+
+++ b/gcc/config/s390/t-linux64
100+
@@ -7,5 +7,5 @@
101+
102+
MULTILIB_OPTIONS = m64/m31
103+
MULTILIB_DIRNAMES = 64 32
104+
-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
105+
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
106+
+MULTILIB_OSDIRNAMES = m64=../lib64
107+
+MULTILIB_OSDIRNAMES+= m32=../lib32
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/Makefile.in
2+
+++ b/Makefile.in
3+
@@ -174,6 +174,7 @@ BUILD_EXPORTS = \
4+
# built for the build system to override those in BASE_FLAGS_TO_PASS.
5+
EXTRA_BUILD_FLAGS = \
6+
CFLAGS="$(CFLAGS_FOR_BUILD)" \
7+
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
8+
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
9+
10+
# This is the list of directories to built for the host system.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
There is no <execinfo.h> in musl libc
2+
3+
--- a/libvtv/vtv_rts.cc
4+
+++ b/libvtv/vtv_rts.cc
5+
@@ -124,7 +124,7 @@
6+
#include <windows.h>
7+
#include <winternl.h>
8+
#include <psapi.h>
9+
-#else
10+
+#elif defined (__GLIBC__)
11+
#include <execinfo.h>
12+
#endif
13+
14+
--- a/libvtv/vtv_utils.cc
15+
+++ b/libvtv/vtv_utils.cc
16+
@@ -34,7 +34,7 @@
17+
#include <string.h>
18+
#if defined (__CYGWIN__) || defined (__MINGW32__)
19+
#include <windows.h>
20+
-#else
21+
+#elif defined (__GLIBC__)
22+
#include <execinfo.h>
23+
#endif
24+
25+
@@ -178,7 +178,7 @@ __vtv_log_verification_failure (const ch
26+
27+
__vtv_add_to_log (vtv_failures_log_fd, "%s", log_msg);
28+
29+
-#if !defined (__CYGWIN__) && !defined (__MINGW32__)
30+
+#if !defined (__CYGWIN__) && !defined (__MINGW32__) && defined(__GLIBC__)
31+
if (generate_backtrace)
32+
{
33+
#define STACK_DEPTH 20
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- a/gcc/cp/mapper-client.cc
2+
+++ b/gcc/cp/mapper-client.cc
3+
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.
4+
#define INCLUDE_STRING
5+
#define INCLUDE_VECTOR
6+
#define INCLUDE_MAP
7+
+#include <pthread.h>
8+
#include "system.h"
9+
10+
#include "line-map.h"
11+
--- a/gcc/cp/mapper-resolver.cc
12+
+++ b/gcc/cp/mapper-resolver.cc
13+
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.
14+
#define INCLUDE_VECTOR
15+
#define INCLUDE_ALGORITHM
16+
#define INCLUDE_MAP
17+
+#include <pthread.h>
18+
#include "system.h"
19+
20+
// We don't want or need to be aware of networking
21+
--- a/gcc/cp/module.cc
22+
+++ b/gcc/cp/module.cc
23+
@@ -204,6 +204,7 @@ Classes used:
24+
#include "config.h"
25+
#define INCLUDE_STRING
26+
#define INCLUDE_VECTOR
27+
+#include <pthread.h>
28+
#include "system.h"
29+
#include "coretypes.h"
30+
#include "cp-tree.h"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
put vtv_end.o in front of postdep_objects_CXX
2+
having it after crtendS.o leads to missing zero termination in eh_frame section
3+
4+
This is in line with comment in libgcc/vtv_end.c:
5+
6+
When the GCC driver inserts vtv_start.o into the link line (just
7+
after crtbegin.o) it also inserts vtv_end.o into the link line,
8+
just before crtend.o.
9+
10+
--- a/libstdc++-v3/configure
11+
+++ b/libstdc++-v3/configure
12+
@@ -15566,7 +15566,7 @@ esac
13+
14+
if test "$enable_vtable_verify" = yes; then
15+
predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o"
16+
- postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o"
17+
+ postdep_objects_CXX="${glibcxx_builddir}/../libgcc/vtv_end.o ${postdep_objects_CXX}"
18+
fi
19+
20+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This is necessary when building a gnu cross compiler for a musl target.
2+
Otherwise, even if clocale manually is set to gnu, it will be reset to generic
3+
when the test is performed using AC_EGREP_CPP().
4+
--- a/libstdc++-v3/configure
5+
+++ b/libstdc++-v3/configure
6+
@@ -16504,6 +16504,7 @@ fi
7+
8+
# Sanity check model, and test for special functionality.
9+
if test $enable_clocale_flag = gnu; then
10+
+ if test $enable_clocale = auto; then
11+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12+
/* end confdefs.h. */
13+
14+
@@ -16520,6 +16521,7 @@ else
15+
enable_clocale_flag=generic
16+
fi
17+
rm -f conftest*
18+
+ fi
19+
20+
21+
# Set it to scream when it hurts.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 236634eed58fa6e00cc50f19e7202903a9d8fae6 Mon Sep 17 00:00:00 2001
2+
From: q66 <[email protected]>
3+
Date: Thu, 12 Dec 2019 04:03:56 +0100
4+
Subject: [PATCH] libgcc: use -mno-gnu-attribute for 128-bit IBM ldouble
5+
support code
6+
7+
Doing this will allow libgcc to emit the appropriate symbols without actually
8+
emitting the FP ABI tag for them, which allows 64-bit long double environments
9+
to function and even link statically while still allowing usage of
10+
explicit __ibm128.
11+
---
12+
libgcc/config/rs6000/t-ibm-ldouble | 2 +-
13+
libgcc/config/rs6000/t-linux | 2 +-
14+
2 files changed, 2 insertions(+), 2 deletions(-)
15+
16+
--- a/libgcc/config/rs6000/t-ibm-ldouble
17+
+++ b/libgcc/config/rs6000/t-ibm-ldouble
18+
@@ -1,6 +1,6 @@
19+
# GCC 128-bit long double support routines.
20+
LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
21+
22+
-HOST_LIBGCC2_CFLAGS += -mlong-double-128
23+
+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
24+
25+
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ibm-ldouble.ver
26+
--- a/libgcc/config/rs6000/t-linux
27+
+++ b/libgcc/config/rs6000/t-linux
28+
@@ -1,6 +1,6 @@
29+
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
30+
31+
-HOST_LIBGCC2_CFLAGS += -mlong-double-128
32+
+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
33+
34+
# This is a way of selecting -mcmodel=small for ppc64, which gives
35+
# smaller and faster libgcc code. Directly specifying -mcmodel=small
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/libgomp/team.c
2+
+++ b/libgomp/team.c
3+
@@ -312,7 +312,7 @@ gomp_team_start (void (*fn) (void *), vo
4+
unsigned flags, struct gomp_team *team,
5+
struct gomp_taskgroup *taskgroup)
6+
{
7+
- struct gomp_thread_start_data *start_data;
8+
+ struct gomp_thread_start_data *start_data = NULL;
9+
struct gomp_thread *thr, *nthr;
10+
struct gomp_task *task;
11+
struct gomp_task_icv *icv;

0 commit comments

Comments
 (0)