Skip to content

Commit 7fca622

Browse files
authored
gcc-11: build GNAT with -fPIC
1 parent 3de1685 commit 7fca622

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
--- a/config/picflag.m4
2+
+++ b/config/picflag.m4
3+
@@ -51,10 +51,10 @@
4+
# All AIX code is PIC.
5+
;;
6+
7+
- # Some targets support both -fPIC and -fpic, but prefer the latter.
8+
+ # Some targets support both -fPIC and -fpic, but prefer the former.
9+
# FIXME: Why?
10+
i[[34567]]86-*-* | x86_64-*-*)
11+
- $1=-fpic
12+
+ $1=-fPIC
13+
;;
14+
# FIXME: Override -fPIC default in libgcc only?
15+
sh-*-linux* | sh[[2346lbe]]*-*-linux*)
16+
--- a/gcc/configure
17+
+++ b/gcc/configure
18+
@@ -5348,10 +5348,10 @@
19+
# All AIX code is PIC.
20+
;;
21+
22+
- # Some targets support both -fPIC and -fpic, but prefer the latter.
23+
+ # Some targets support both -fPIC and -fpic, but prefer the former.
24+
# FIXME: Why?
25+
i[34567]86-*-* | x86_64-*-*)
26+
- PICFLAG_FOR_TARGET=-fpic
27+
+ PICFLAG_FOR_TARGET=-fPIC
28+
;;
29+
# FIXME: Override -fPIC default in libgcc only?
30+
sh-*-linux* | sh[2346lbe]*-*-linux*)
31+
--- a/libada/configure
32+
+++ b/libada/configure
33+
@@ -3219,10 +3219,10 @@
34+
# All AIX code is PIC.
35+
;;
36+
37+
- # Some targets support both -fPIC and -fpic, but prefer the latter.
38+
+ # Some targets support both -fPIC and -fpic, but prefer the former.
39+
# FIXME: Why?
40+
i[34567]86-*-* | x86_64-*-*)
41+
- PICFLAG=-fpic
42+
+ PICFLAG=-fPIC
43+
;;
44+
# FIXME: Override -fPIC default in libgcc only?
45+
sh-*-linux* | sh[2346lbe]*-*-linux*)
46+
--- a/libiberty/configure
47+
+++ b/libiberty/configure
48+
@@ -5209,10 +5209,10 @@
49+
# All AIX code is PIC.
50+
;;
51+
52+
- # Some targets support both -fPIC and -fpic, but prefer the latter.
53+
+ # Some targets support both -fPIC and -fpic, but prefer the former.
54+
# FIXME: Why?
55+
i[34567]86-*-* | x86_64-*-*)
56+
- PICFLAG=-fpic
57+
+ PICFLAG=-fPIC
58+
;;
59+
# FIXME: Override -fPIC default in libgcc only?
60+
sh-*-linux* | sh[2346lbe]*-*-linux*)
61+
--- a/libgcc/configure
62+
+++ b/libgcc/configure
63+
@@ -2419,10 +2419,10 @@
64+
# All AIX code is PIC.
65+
;;
66+
67+
- # Some targets support both -fPIC and -fpic, but prefer the latter.
68+
+ # Some targets support both -fPIC and -fpic, but prefer the former.
69+
# FIXME: Why?
70+
i[34567]86-*-* | x86_64-*-*)
71+
- PICFLAG=-fpic
72+
+ PICFLAG=-fPIC
73+
;;
74+
# FIXME: Override -fPIC default in libgcc only?
75+
sh-*-linux* | sh[2346lbe]*-*-linux*)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/gcc/ada/gcc-interface/Makefile.in
2+
+++ b/gcc/ada/gcc-interface/Makefile.in
3+
@@ -629,7 +629,7 @@
4+
CC="`echo \"$(GCC_FOR_TARGET)\" \
5+
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
6+
INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
7+
- CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
8+
+ CFLAGS="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \
9+
FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
10+
srcdir=$(fsrcdir) \
11+
-f ../Makefile $(LIBGNAT_OBJS) $(EXTRA_ADALIB_OBJS)
12+
@@ -639,7 +639,7 @@
13+
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
14+
ADA_INCLUDES="" \
15+
CFLAGS="$(GNATLIBCFLAGS)" \
16+
- ADAFLAGS="$(GNATLIBFLAGS)" \
17+
+ ADAFLAGS="$(GNATLIBFLAGS) $(PICFLAG_FOR_TARGET)" \
18+
FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
19+
srcdir=$(fsrcdir) \
20+
-f ../Makefile $(GNATRTL_OBJS)

tur/gcc-11/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="GNU C compiler"
33
TERMUX_PKG_LICENSE="GPL-3.0"
44
TERMUX_PKG_DEPENDS="binutils, libc++, libgmp, libmpfr, libmpc, libisl, zlib"
55
TERMUX_PKG_VERSION=11.5.0
6-
TERMUX_PKG_REVISION=1
6+
TERMUX_PKG_REVISION=2
77
TERMUX_PKG_MAINTAINER="@licy183"
88
TERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/gcc/gcc-${TERMUX_PKG_VERSION}/gcc-${TERMUX_PKG_VERSION}.tar.gz
99
TERMUX_PKG_SHA256=5a447f9a2566d15376beece02270decec8b8c1fcb094b93cb335b23497d58117

0 commit comments

Comments
 (0)