1 |
commit: d3c50b452280a23da7fa55fe97e926bad3386ee5 |
2 |
Author: William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon May 6 11:52:22 2019 +0000 |
4 |
Commit: Ralph Seichter <gentoo <AT> seichter <DOT> de> |
5 |
CommitDate: Mon May 6 11:52:22 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d3c50b45 |
7 |
|
8 |
dev-lang/fbc: Add patch for proper symbol stripping behavior |
9 |
|
10 |
Package-Manager: Portage-2.3.65, Repoman-2.3.12 |
11 |
Signed-off-by: William Breathitt Gray <vilhelm.gray <AT> gmail.com> |
12 |
|
13 |
dev-lang/fbc/Manifest | 4 +- |
14 |
dev-lang/fbc/fbc-1.06.0.ebuild | 12 +- |
15 |
...lement-the-strip-nostrip-compiler-options.patch | 169 +++++++++++++++++++++ |
16 |
3 files changed, 174 insertions(+), 11 deletions(-) |
17 |
|
18 |
diff --git a/dev-lang/fbc/Manifest b/dev-lang/fbc/Manifest |
19 |
index 1c62094..948cffc 100644 |
20 |
--- a/dev-lang/fbc/Manifest |
21 |
+++ b/dev-lang/fbc/Manifest |
22 |
@@ -1,4 +1,4 @@ |
23 |
DIST FreeBASIC-1.06.0-source-bootstrap.tar.xz 7742292 BLAKE2B fd32c6e5edf6e8c27538465141c6b870d6c893f8e05fc8d91b273f9268a68065709cba95e8c5cd8b86786522b2ac1eaf1a6a547227432bbc9998eb1288b29515 SHA512 42878091994cae7e0a2f4ba1d2d83a80d32d62ad06790ac06643a266200b53b7ce2480a651b1622910a2733756b7ca032a5be1bb73ee3f796146394eebb9f43c |
24 |
-DIST fbc-1.06.0-bootstrap-dist-linux-x86.patch 125456 BLAKE2B 14bf25ed51d04773a8c98408f76ce79fcc165500e3ef67fc9407971f92fdb359dfc9abe8feb989ad6fd0b710b26d99ac478561d561a0687c213d048d41610ca9 SHA512 39622d88ef1b83bbe309df937139e73e6bdae87c4e0461a170aa4b792a74a295060f2b770fa81e74a0a973a9ae816fadf18d75a1075d9112dd68c83ca3e0cbb6 |
25 |
-DIST fbc-1.06.0-bootstrap-dist-linux-x86_64.patch 58219 BLAKE2B f28a4b74b8648a3128d2e8f273af55e5f1880fe35c5acef31ceed7b33386c5fb6b83ed4657138515abb95891ce8bc157aea339f8ba947dece4df1f2876e926b7 SHA512 e62b6969a93f214a6c1d246c734ab2b9045ee7ad9558d0871589945613d11ae0815945b3270213bc959c792903e86cf38555b6fd68b0d0c9ec68f8ef61ea9a0e |
26 |
+DIST fbc-1.06.0-bootstrap-dist-linux-x86.patch 147301 BLAKE2B 8320f988bc84f5df1b732719a11d1a8edbfceff04ad51b1fbd883eb21d20f1c2f16b8c6ae41b5b0472e4faf1058345969b85ed0c93c071de3c9ed703e298106a SHA512 b2ee285504ce0f8a6a01ee5da7661e40c4a6bb0075f26751fbc79a328cac66f7809ad4c2489eaab01a6e6432ca6d76e19835c86bddf9df5af3b89c547fd8ffb3 |
27 |
+DIST fbc-1.06.0-bootstrap-dist-linux-x86_64.patch 198197 BLAKE2B 72083bef84aed5ec2d95badb70a42db2e5d89084454f79aef41808a018ab238b1d230cb7282f4adf1be9d003c3865cb914fbf057fbd84c069dfecc4abd3da80b SHA512 771077a2526164223c3ae157558355538701224863b2a5923881ac2d2568f4cd1f5489df73aa8d55b1efccc82fe9e251e893a2b361363c1862d4c1e7bc3fb4ba |
28 |
DIST fbc-1.06.0.tar.gz 8847831 BLAKE2B 9245137995f9f3e2ff5adaf9b273593434ac9ec96919b2c970ec26183fe6fb7afee35753f2dd92f4b34d1aade92871e5a6722571a5ba04dde323fd7fb06c55c5 SHA512 687dcf665bb10e6a771cc01d02c21da77d89e052308600038dce526ba1ccfc6554d409dab184f3495557c9e4fdf744fd7a9088b4b137b782a9ab8633622c5484 |
29 |
|
30 |
diff --git a/dev-lang/fbc/fbc-1.06.0.ebuild b/dev-lang/fbc/fbc-1.06.0.ebuild |
31 |
index 689d4bb..aef1b85 100644 |
32 |
--- a/dev-lang/fbc/fbc-1.06.0.ebuild |
33 |
+++ b/dev-lang/fbc/fbc-1.06.0.ebuild |
34 |
@@ -7,8 +7,8 @@ DESCRIPTION="FreeBASIC - A free/open source, multi-platform BASIC compiler." |
35 |
HOMEPAGE="https://www.freebasic.net" |
36 |
SRC_URI="https://github.com/freebasic/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz |
37 |
https://github.com/freebasic/${PN}/releases/download/${PV}/FreeBASIC-${PV}-source-bootstrap.tar.xz |
38 |
- https://gist.github.com/vilhelmgray/08cebe0f22e303f7d5e6e5bc71e3d1f2/raw/710ba9ded1c7772f23fd68c08e02402f167d2c56/fbc-1.06.0-bootstrap-dist-linux-x86.patch |
39 |
- https://gist.github.com/vilhelmgray/08cebe0f22e303f7d5e6e5bc71e3d1f2/raw/710ba9ded1c7772f23fd68c08e02402f167d2c56/fbc-1.06.0-bootstrap-dist-linux-x86_64.patch" |
40 |
+ https://gist.github.com/vilhelmgray/08cebe0f22e303f7d5e6e5bc71e3d1f2/raw/70c1f43eec81c35bdc780ace7fdf6a3c8b548c85/fbc-1.06.0-bootstrap-dist-linux-x86.patch |
41 |
+ https://gist.github.com/vilhelmgray/08cebe0f22e303f7d5e6e5bc71e3d1f2/raw/70c1f43eec81c35bdc780ace7fdf6a3c8b548c85/fbc-1.06.0-bootstrap-dist-linux-x86_64.patch" |
42 |
|
43 |
LICENSE="FDL-1.2 GPL-2+ LGPL-2.1+" |
44 |
SLOT="0" |
45 |
@@ -80,14 +80,8 @@ src_compile() { |
46 |
$(usex X "" " -DDISABLE_X11") |
47 |
) |
48 |
|
49 |
- # fbc automatically strips the executables it compiles; in order to avoid |
50 |
- # creating striped executables, we override the fbc hardcoded linker "-s" |
51 |
- # flag with our own; "--strip-debug" was chosen arbitrarily (without the |
52 |
- # "-g" flag the executable should not have debug_info symbols anyway, so the |
53 |
- # "--strip-debug" flag should be a safe option) |
54 |
- local fblflags="-Wl --strip-debug " |
55 |
# fbc requires a space after the -Wl option |
56 |
- fblflags+=${LDFLAGS//-Wl,/-Wl } |
57 |
+ local fblflags=${LDFLAGS//-Wl,/-Wl } |
58 |
|
59 |
# Build fbc |
60 |
emake CFLAGS="${CFLAGS} ${xcflags[*]}" FBC="${fbc}" FBCFLAGS="${fbcflags}" FBLFLAGS="${fblflags}" |
61 |
|
62 |
diff --git a/dev-lang/fbc/files/1.06.0/fbc/0002-Implement-the-strip-nostrip-compiler-options.patch b/dev-lang/fbc/files/1.06.0/fbc/0002-Implement-the-strip-nostrip-compiler-options.patch |
63 |
new file mode 100644 |
64 |
index 0000000..3298044 |
65 |
--- /dev/null |
66 |
+++ b/dev-lang/fbc/files/1.06.0/fbc/0002-Implement-the-strip-nostrip-compiler-options.patch |
67 |
@@ -0,0 +1,169 @@ |
68 |
+From b8bfa87f56a86c3c81976b1a8c0411ac4240ae9e Mon Sep 17 00:00:00 2001 |
69 |
+From: William Breathitt Gray <vilhelm.gray@×××××.com> |
70 |
+Date: Wed, 24 Apr 2019 16:59:08 +0900 |
71 |
+Subject: [PATCH] Implement the '-strip'/'-nostrip' compiler options |
72 |
+ |
73 |
+This change allows users to choose whether or not to strip symbol |
74 |
+information from the output file. The fbc '-strip' option is analogous |
75 |
+to the ld '--strip-all' option. The ENABLE_STRIPALL compiler build |
76 |
+option is introduced to configure whether fbc defaults to stripping |
77 |
+symbols. |
78 |
+ |
79 |
+This fixes issue #140. |
80 |
+--- |
81 |
+ makefile | 8 ++++++++ |
82 |
+ src/compiler/fbc.bas | 21 ++++++++++++++++++++- |
83 |
+ 2 files changed, 28 insertions(+), 1 deletion(-) |
84 |
+ |
85 |
+diff --git a/makefile b/makefile |
86 |
+index 245e95669..519fe7e7b 100644 |
87 |
+--- a/makefile |
88 |
++++ b/makefile |
89 |
+@@ -81,6 +81,7 @@ |
90 |
+ # ENABLE_SUFFIX=-0.24 append a string like "-0.24" to fbc/FB dir names, |
91 |
+ # and use "-d ENABLE_SUFFIX=$(ENABLE_SUFFIX)" (non-standalone only) |
92 |
+ # ENABLE_LIB64=1 use prefix/lib64/ instead of prefix/lib/ for 64bit libs (non-standalone only) |
93 |
++# ENABLE_STRIPALL=1 use "-d ENABLE_STRIPALL" with select targets |
94 |
+ # FBPACKAGE bindist: The package/archive file name without path or extension |
95 |
+ # FBPACKSUFFIX bindist: Allows adding a custom suffix to the normal package name (and the toplevel dir in the archive) |
96 |
+ # FBMANIFEST bindist: The manifest file name without path or extension |
97 |
+@@ -92,6 +93,7 @@ |
98 |
+ # -d ENABLE_SUFFIX=-0.24 assume FB's lib dir uses the given suffix (non-standalone only) |
99 |
+ # -d ENABLE_PREFIX=/some/path hard-code specific $(prefix) into fbc |
100 |
+ # -d ENABLE_LIB64 use prefix/lib64/ instead of prefix/lib/ for 64bit libs (non-standalone only) |
101 |
++# -d ENABLE_STRIPALL configure fbc to pass down '--strip-all' to linker by default |
102 |
+ # |
103 |
+ # rtlib/gfxlib2 source code configuration (CFLAGS): |
104 |
+ # -DDISABLE_X11 build without X11 headers (disables X11 gfx driver) |
105 |
+@@ -429,6 +431,12 @@ endif |
106 |
+ ifdef ENABLE_LIB64 |
107 |
+ ALLFBCFLAGS += -d ENABLE_LIB64 |
108 |
+ endif |
109 |
++ifdef ENABLE_STRIPALL |
110 |
++ ifneq ($(filter dos win32,$(TARGET_OS)),) |
111 |
++ ALLFBCFLAGS += -d ENABLE_STRIPALL |
112 |
++ endif |
113 |
++endif |
114 |
++ |
115 |
+ |
116 |
+ ALLFBCFLAGS += $(FBCFLAGS) $(FBFLAGS) |
117 |
+ ALLFBLFLAGS += $(FBLFLAGS) $(FBFLAGS) |
118 |
+diff --git a/src/compiler/fbc.bas b/src/compiler/fbc.bas |
119 |
+index f6fa3d9db..f9b665bbc 100644 |
120 |
+--- a/src/compiler/fbc.bas |
121 |
++++ b/src/compiler/fbc.bas |
122 |
+@@ -100,6 +100,7 @@ type FBCCTX |
123 |
+ xbe_title as zstring * FB_MAXNAMELEN+1 '' For the '-title <title>' xbox option |
124 |
+ nodeflibs as integer |
125 |
+ staticlink as integer |
126 |
++ stripsymbols as integer |
127 |
+ |
128 |
+ '' Compiler paths |
129 |
+ prefix as zstring * FB_MAXPATHLEN+1 '' Path from -prefix or empty |
130 |
+@@ -163,6 +164,10 @@ private sub fbcInit( ) |
131 |
+ |
132 |
+ fbGlobalInit() |
133 |
+ |
134 |
++#ifdef ENABLE_STRIPALL |
135 |
++ fbc.stripsymbols = TRUE |
136 |
++#endif |
137 |
++ |
138 |
+ fbc.objinf.lang = fbGetOption( FB_COMPOPT_LANG ) |
139 |
+ |
140 |
+ fbc.print = -1 |
141 |
+@@ -762,7 +767,7 @@ private function hLinkFiles( ) as integer |
142 |
+ |
143 |
+ if( fbGetOption( FB_COMPOPT_DEBUGINFO ) = FALSE ) then |
144 |
+ if( fbGetOption( FB_COMPOPT_PROFILE ) = FALSE ) then |
145 |
+- if( fbGetOption( FB_COMPOPT_TARGET ) <> FB_COMPTARGET_DARWIN ) then |
146 |
++ if( fbc.stripsymbols ) then |
147 |
+ ldcline += " -s" |
148 |
+ end if |
149 |
+ end if |
150 |
+@@ -1417,6 +1422,7 @@ enum |
151 |
+ OPT_NODEFLIBS |
152 |
+ OPT_NOERRLINE |
153 |
+ OPT_NOOBJINFO |
154 |
++ OPT_NOSTRIP |
155 |
+ OPT_O |
156 |
+ OPT_OPTIMIZE |
157 |
+ OPT_P |
158 |
+@@ -1432,6 +1438,7 @@ enum |
159 |
+ OPT_S |
160 |
+ OPT_SHOWINCLUDES |
161 |
+ OPT_STATIC |
162 |
++ OPT_STRIP |
163 |
+ OPT_T |
164 |
+ OPT_TARGET |
165 |
+ OPT_TITLE |
166 |
+@@ -1480,6 +1487,7 @@ dim shared as integer option_takes_argument(0 to (OPT__COUNT - 1)) = _ |
167 |
+ FALSE, _ '' OPT_NODEFLIBS |
168 |
+ FALSE, _ '' OPT_NOERRLINE |
169 |
+ FALSE, _ '' OPT_NOOBJINFO |
170 |
++ FALSE, _ '' OPT_NOSTRIP |
171 |
+ TRUE , _ '' OPT_O |
172 |
+ TRUE , _ '' OPT_OPTIMIZE |
173 |
+ TRUE , _ '' OPT_P |
174 |
+@@ -1495,6 +1503,7 @@ dim shared as integer option_takes_argument(0 to (OPT__COUNT - 1)) = _ |
175 |
+ TRUE , _ '' OPT_S |
176 |
+ FALSE, _ '' OPT_SHOWINCLUDES |
177 |
+ FALSE, _ '' OPT_STATIC |
178 |
++ FALSE, _ '' OPT_STRIP |
179 |
+ TRUE , _ '' OPT_T |
180 |
+ TRUE , _ '' OPT_TARGET |
181 |
+ TRUE , _ '' OPT_TITLE |
182 |
+@@ -1676,6 +1685,9 @@ private sub handleOpt(byval optid as integer, byref arg as string) |
183 |
+ case OPT_NOOBJINFO |
184 |
+ fbSetOption( FB_COMPOPT_OBJINFO, FALSE ) |
185 |
+ |
186 |
++ case OPT_NOSTRIP |
187 |
++ fbc.stripsymbols = FALSE |
188 |
++ |
189 |
+ case OPT_O |
190 |
+ '' Error if there already is an -o waiting to be assigned |
191 |
+ hCheckWaitingObjfile( ) |
192 |
+@@ -1765,6 +1777,9 @@ private sub handleOpt(byval optid as integer, byref arg as string) |
193 |
+ case OPT_STATIC |
194 |
+ fbc.staticlink = TRUE |
195 |
+ |
196 |
++ case OPT_STRIP |
197 |
++ fbc.stripsymbols = TRUE |
198 |
++ |
199 |
+ case OPT_T |
200 |
+ fbSetOption( FB_COMPOPT_STACKSIZE, clng( arg ) * 1024 ) |
201 |
+ |
202 |
+@@ -1963,6 +1978,7 @@ private function parseOption(byval opt as zstring ptr) as integer |
203 |
+ CHECK("noerrline", OPT_NOERRLINE) |
204 |
+ CHECK("nodeflibs", OPT_NODEFLIBS) |
205 |
+ CHECK("noobjinfo", OPT_NOOBJINFO) |
206 |
++ CHECK("nostrip", OPT_NOSTRIP) |
207 |
+ |
208 |
+ case asc("o") |
209 |
+ ONECHAR(OPT_O) |
210 |
+@@ -1990,6 +2006,7 @@ private function parseOption(byval opt as zstring ptr) as integer |
211 |
+ ONECHAR(OPT_S) |
212 |
+ CHECK("showincludes", OPT_SHOWINCLUDES) |
213 |
+ CHECK("static", OPT_STATIC) |
214 |
++ CHECK("strip", OPT_STRIP) |
215 |
+ |
216 |
+ case asc("t") |
217 |
+ ONECHAR(OPT_T) |
218 |
+@@ -3384,6 +3401,7 @@ private sub hPrintOptions( ) |
219 |
+ print " -nodeflibs Do not include the default libraries" |
220 |
+ print " -noerrline Do not show source context in error messages" |
221 |
+ print " -noobjinfo Do not read/write compile-time info from/to .o and .a files" |
222 |
++ print " -nostrip Do not strip symbol information from the output file" |
223 |
+ print " -o <file> Set .o (or -pp .bas) file name for prev/next input file" |
224 |
+ print " -O <value> Optimization level (default: 0)" |
225 |
+ print " -p <path> Add a library search path" |
226 |
+@@ -3401,6 +3419,7 @@ private sub hPrintOptions( ) |
227 |
+ print " -s console|gui Select win32 subsystem" |
228 |
+ print " -showincludes Display a tree of file names of #included files" |
229 |
+ print " -static Prefer static libraries over dynamic ones when linking" |
230 |
++ print " -strip Omit all symbol information from the output file" |
231 |
+ print " -t <value> Set .exe stack size in kbytes, default: 1024 (win32/dos)" |
232 |
+ print " -target <name> Set cross-compilation target" |
233 |
+ print " -title <name> Set XBE display title (xbox)" |
234 |
+-- |
235 |
+2.21.0 |
236 |
+ |