1 |
commit: 651fd651dceb78fb082b79aec1ac44302640e239 |
2 |
Author: Tupone Alfredo <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 18 20:56:42 2018 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 18 20:56:42 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=651fd651 |
7 |
|
8 |
dev-lang/gnat-gpl: Add some profile definitions from 2017 |
9 |
|
10 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
.../gnat-gpl/files/gnat-gpl-2016-profile.patch | 113 +++++++++++ |
14 |
dev-lang/gnat-gpl/gnat-gpl-2016-r3.ebuild | 218 +++++++++++++++++++++ |
15 |
2 files changed, 331 insertions(+) |
16 |
|
17 |
diff --git a/dev-lang/gnat-gpl/files/gnat-gpl-2016-profile.patch b/dev-lang/gnat-gpl/files/gnat-gpl-2016-profile.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..561c012a23e |
20 |
--- /dev/null |
21 |
+++ b/dev-lang/gnat-gpl/files/gnat-gpl-2016-profile.patch |
22 |
@@ -0,0 +1,113 @@ |
23 |
+--- a/gcc/ada/s-rident.ads 2018-11-18 18:47:39.042412895 +0100 |
24 |
++++ b/gcc/ada/s-rident.ads 2018-11-18 19:02:31.736559044 +0100 |
25 |
+@@ -378,15 +378,17 @@ |
26 |
+ type Profile_Name is |
27 |
+ (No_Profile, |
28 |
+ No_Implementation_Extensions, |
29 |
++ Restricted_Tasking, |
30 |
++ Restricted, |
31 |
+ Ravenscar, |
32 |
+ GNAT_Extended_Ravenscar, |
33 |
+- Restricted); |
34 |
++ GNAT_Ravenscar_EDF); |
35 |
+ -- Names of recognized profiles. No_Profile is used to indicate that a |
36 |
+ -- restriction came from pragma Restrictions[_Warning], as opposed to |
37 |
+ -- pragma Profile[_Warning]. |
38 |
+ |
39 |
+ subtype Profile_Name_Actual is Profile_Name |
40 |
+- range No_Implementation_Extensions .. Restricted; |
41 |
++ range No_Implementation_Extensions .. Profile_Name'Last; |
42 |
+ -- Actual used profile names |
43 |
+ |
44 |
+ type Profile_Data is record |
45 |
+@@ -456,6 +458,40 @@ |
46 |
+ Max_Task_Entries => 0, |
47 |
+ others => 0)), |
48 |
+ |
49 |
++ -- Restricted_Tasking Profile |
50 |
++ |
51 |
++ Restricted_Tasking => |
52 |
++ |
53 |
++ -- Restrictions for Restricted_Tasking profile |
54 |
++ |
55 |
++ (Set => |
56 |
++ (No_Abort_Statements => True, |
57 |
++ No_Asynchronous_Control => True, |
58 |
++ No_Dynamic_Attachment => True, |
59 |
++ No_Dynamic_Priorities => True, |
60 |
++ No_Entry_Queue => True, |
61 |
++ No_Local_Protected_Objects => True, |
62 |
++ No_Protected_Type_Allocators => True, |
63 |
++ No_Requeue_Statements => True, |
64 |
++ No_Task_Allocators => True, |
65 |
++ No_Task_Attributes_Package => True, |
66 |
++ No_Task_Hierarchy => True, |
67 |
++ No_Terminate_Alternatives => True, |
68 |
++ Max_Asynchronous_Select_Nesting => True, |
69 |
++ Max_Protected_Entries => True, |
70 |
++ Max_Select_Alternatives => True, |
71 |
++ Max_Task_Entries => True, |
72 |
++ others => False), |
73 |
++ |
74 |
++ -- Value settings for Restricted profile |
75 |
++ |
76 |
++ Value => |
77 |
++ (Max_Asynchronous_Select_Nesting => 0, |
78 |
++ Max_Protected_Entries => 1, |
79 |
++ Max_Select_Alternatives => 0, |
80 |
++ Max_Task_Entries => 0, |
81 |
++ others => 0)), |
82 |
++ |
83 |
+ -- Ravenscar Profile |
84 |
+ |
85 |
+ -- Note: the table entries here only represent the |
86 |
+@@ -509,6 +545,49 @@ |
87 |
+ Max_Task_Entries => 0, |
88 |
+ others => 0)), |
89 |
+ |
90 |
++ GNAT_Ravenscar_EDF => |
91 |
++ |
92 |
++ -- Restrictions for Ravenscar = Restricted profile .. |
93 |
++ |
94 |
++ (Set => |
95 |
++ (No_Abort_Statements => True, |
96 |
++ No_Asynchronous_Control => True, |
97 |
++ No_Dynamic_Attachment => True, |
98 |
++ No_Dynamic_Priorities => True, |
99 |
++ No_Entry_Queue => True, |
100 |
++ No_Local_Protected_Objects => True, |
101 |
++ No_Protected_Type_Allocators => True, |
102 |
++ No_Requeue_Statements => True, |
103 |
++ No_Task_Allocators => True, |
104 |
++ No_Task_Attributes_Package => True, |
105 |
++ No_Task_Hierarchy => True, |
106 |
++ No_Terminate_Alternatives => True, |
107 |
++ Max_Asynchronous_Select_Nesting => True, |
108 |
++ Max_Protected_Entries => True, |
109 |
++ Max_Select_Alternatives => True, |
110 |
++ Max_Task_Entries => True, |
111 |
++ |
112 |
++ -- plus these additional restrictions: |
113 |
++ |
114 |
++ No_Calendar => True, |
115 |
++ No_Implicit_Heap_Allocations => True, |
116 |
++ No_Local_Timing_Events => True, |
117 |
++ No_Relative_Delay => True, |
118 |
++ No_Select_Statements => True, |
119 |
++ No_Specific_Termination_Handlers => True, |
120 |
++ No_Task_Termination => True, |
121 |
++ Simple_Barriers => True, |
122 |
++ others => False), |
123 |
++ |
124 |
++ -- Value settings for Ravenscar (same as Restricted) |
125 |
++ |
126 |
++ Value => |
127 |
++ (Max_Asynchronous_Select_Nesting => 0, |
128 |
++ Max_Protected_Entries => 1, |
129 |
++ Max_Select_Alternatives => 0, |
130 |
++ Max_Task_Entries => 0, |
131 |
++ others => 0)), |
132 |
++ |
133 |
+ GNAT_Extended_Ravenscar => |
134 |
+ |
135 |
+ -- Restrictions for GNAT_Extended_Ravenscar = |
136 |
|
137 |
diff --git a/dev-lang/gnat-gpl/gnat-gpl-2016-r3.ebuild b/dev-lang/gnat-gpl/gnat-gpl-2016-r3.ebuild |
138 |
new file mode 100644 |
139 |
index 00000000000..d0a087fcbda |
140 |
--- /dev/null |
141 |
+++ b/dev-lang/gnat-gpl/gnat-gpl-2016-r3.ebuild |
142 |
@@ -0,0 +1,218 @@ |
143 |
+# Copyright 1999-2018 Gentoo Authors |
144 |
+# Distributed under the terms of the GNU General Public License v2 |
145 |
+ |
146 |
+EAPI="5" |
147 |
+ |
148 |
+PATCH_VER="1.3" |
149 |
+UCLIBC_VER="1.0" |
150 |
+ |
151 |
+# Hardened gcc 4 stuff |
152 |
+PIE_VER="0.6.4" |
153 |
+SPECS_VER="0.2.0" |
154 |
+SPECS_GCC_VER="4.4.3" |
155 |
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default |
156 |
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64" |
157 |
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64" |
158 |
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm" |
159 |
+# uclibc need tls and nptl support for SSP support |
160 |
+# uclibc need to be >= 0.9.33 |
161 |
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm" |
162 |
+#end Hardened stuff |
163 |
+ |
164 |
+TOOLCHAIN_GCC_PV=4.9.4 |
165 |
+ |
166 |
+inherit eutils toolchain-funcs toolchain |
167 |
+ |
168 |
+REL=4.9 |
169 |
+MYP=gcc-${REL}-gpl-${PV}-src |
170 |
+BTSTRP_X86=gnat-gpl-2014-x86-linux-bin |
171 |
+BTSTRP_AMD64=gnat-gpl-2014-x86_64-linux-bin |
172 |
+ |
173 |
+DESCRIPTION="GNAT Ada Compiler - GPL version" |
174 |
+HOMEPAGE="http://libre.adacore.com/" |
175 |
+SRC_URI+=" |
176 |
+ http://mirrors.cdn.adacore.com/art/57399304c7a447658e0aff7f |
177 |
+ -> ${P}-src.tar.gz |
178 |
+ http://mirrors.cdn.adacore.com/art/573992d4c7a447658d00e1db |
179 |
+ -> ${MYP}.tar.gz |
180 |
+ http://mirrors.cdn.adacore.com/art/57399232c7a447658e0aff7d |
181 |
+ -> gcc-interface-${REL}-gpl-${PV}-src.tar.gz |
182 |
+ bootstrap? ( |
183 |
+ amd64? ( |
184 |
+ http://mirrors.cdn.adacore.com/art/564b3ebec8e196b040fbe66c -> |
185 |
+ ${BTSTRP_AMD64}.tar.gz |
186 |
+ ) |
187 |
+ x86? ( |
188 |
+ http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248 -> |
189 |
+ ${BTSTRP_X86}.tar.gz |
190 |
+ ) |
191 |
+ )" |
192 |
+ |
193 |
+LICENSE+=" GPL-2 GPL-3" |
194 |
+SLOT="${TOOLCHAIN_GCC_PV}" |
195 |
+KEYWORDS="~amd64 ~x86" |
196 |
+IUSE="bootstrap" |
197 |
+ |
198 |
+RDEPEND="!sys-devel/gcc:${TOOLCHAIN_GCC_PV}" |
199 |
+DEPEND="${RDEPEND} |
200 |
+ elibc_glibc? ( >=sys-libs/glibc-2.8 ) |
201 |
+ >=sys-devel/binutils-2.20" |
202 |
+ |
203 |
+PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )" |
204 |
+ |
205 |
+S="${WORKDIR}"/${MYP} |
206 |
+ |
207 |
+FSFGCC=gcc-${TOOLCHAIN_GCC_PV} |
208 |
+ |
209 |
+pkg_setup() { |
210 |
+ toolchain_pkg_setup |
211 |
+ |
212 |
+ if use amd64; then |
213 |
+ BTSTRP=${BTSTRP_AMD64} |
214 |
+ else |
215 |
+ BTSTRP=${BTSTRP_X86} |
216 |
+ fi |
217 |
+ if use bootstrap; then |
218 |
+ GCC="${WORKDIR}"/${BTSTRP}/bin/gcc |
219 |
+ else |
220 |
+ GCC=${ADA:-$(tc-getCC)} |
221 |
+ fi |
222 |
+ CC=${GCC} |
223 |
+ local base=$(basename ${GCC}) |
224 |
+ CXX="${base/gcc/g++}" |
225 |
+ GNATMAKE="${base/gcc/gnatmake}" |
226 |
+ GNATBIND="${base/gcc/gnatbind}" |
227 |
+ if [[ ${base} != ${GCC} ]] ; then |
228 |
+ local path=$(dirname ${GCC}) |
229 |
+ GNATMAKE="${path}/${GNATMAKE}" |
230 |
+ GNATBIND="${path}/${GNATBIND}" |
231 |
+ CXX="${path}/${CXX}" |
232 |
+ fi |
233 |
+} |
234 |
+ |
235 |
+src_unpack() { |
236 |
+ if ! use bootstrap && [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then |
237 |
+ eerror "You need a gcc compiler that provides the Ada Compiler:" |
238 |
+ eerror "1) use gcc-config to select the right compiler or" |
239 |
+ eerror "2) set the bootstrap use flag" |
240 |
+ die "ada compiler not available" |
241 |
+ fi |
242 |
+ |
243 |
+ GCC_A_FAKEIT="${P}-src.tar.gz |
244 |
+ ${MYP}.tar.gz |
245 |
+ ${FSFGCC}.tar.bz2 |
246 |
+ gcc-interface-${REL}-gpl-${PV}-src.tar.gz" |
247 |
+ if use bootstrap; then |
248 |
+ GCC_A_FAKEIT="${GCC_A_FAKEIT} ${BTSTRP}.tar.gz" |
249 |
+ fi |
250 |
+ |
251 |
+ toolchain_src_unpack |
252 |
+ if use bootstrap; then |
253 |
+ rm ${BTSTRP}/libexec/gcc/${CHOST}/4.7.4/ld || die |
254 |
+ fi |
255 |
+} |
256 |
+ |
257 |
+src_prepare() { |
258 |
+ mv ../${P}-src/src/ada gcc/ || die |
259 |
+ mv ../gcc-interface-${REL}-gpl-${PV}-src gcc/ada/gcc-interface || die |
260 |
+ |
261 |
+ sed -i \ |
262 |
+ -e "s:gnatmake:${GNATMAKE}:g" \ |
263 |
+ gcc/ada/Make-generated.in || die "sed failed" |
264 |
+ |
265 |
+ sed -i \ |
266 |
+ -e "/xoscons/s:gnatmake:${GNATMAKE}:g" \ |
267 |
+ gcc/ada/gcc-interface/Makefile.in || die "sed failed" |
268 |
+ |
269 |
+ mv ../${FSFGCC}/gcc/doc/gcc.info gcc/doc/ || die |
270 |
+ mv ../${FSFGCC}/libjava . || die |
271 |
+ rm -r ../${FSFGCC} || die |
272 |
+ |
273 |
+ cd .. |
274 |
+ epatch "${FILESDIR}"/${P}-gentoo.patch |
275 |
+ rm patch/10_all_default-fortify-source.patch |
276 |
+ rm piepatch/34_all_gcc48_config_i386.patch |
277 |
+ cd - |
278 |
+ |
279 |
+ if has_version '<sys-libs/glibc-2.12' ; then |
280 |
+ ewarn "Your host glibc is too old; disabling automatic fortify." |
281 |
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315" |
282 |
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch" |
283 |
+ fi |
284 |
+ |
285 |
+ # Bug 638056 |
286 |
+ epatch "${FILESDIR}/${P}-bootstrap.patch" |
287 |
+ # add Finalization_Size Attribute |
288 |
+ epatch "${FILESDIR}/${P}-finalization.patch" |
289 |
+ # add profile for gnat_util compatibility |
290 |
+ epatch "${FILESDIR}/${P}-profile.patch" |
291 |
+ |
292 |
+ toolchain_src_prepare |
293 |
+ |
294 |
+ use vanilla && return 0 |
295 |
+ # Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs. |
296 |
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch |
297 |
+} |
298 |
+ |
299 |
+src_configure() { |
300 |
+ local trueGCC_BRANCH_VER=${GCC_BRANCH_VER} |
301 |
+ GCC_BRANCH_VER=$(gcc-version) |
302 |
+ downgrade_arch_flags |
303 |
+ GCC_BRANCH_VER=${trueGCC_BRANCH_VER} |
304 |
+ toolchain_src_configure \ |
305 |
+ --enable-languages=ada \ |
306 |
+ --disable-libada \ |
307 |
+ CC=${GCC} \ |
308 |
+ GNATBIND=${GNATBIND} \ |
309 |
+ GNATMAKE=yes |
310 |
+} |
311 |
+ |
312 |
+src_compile() { |
313 |
+ unset ADAFLAGS |
314 |
+ toolchain_src_compile |
315 |
+ gcc_do_make "-C gcc gnatlib-shared" |
316 |
+ ln -s gcc ../build/prev-gcc || die |
317 |
+ ln -s ${CHOST} ../build/prev-${CHOST} || die |
318 |
+ gcc_do_make "-C gcc gnattools" |
319 |
+} |
320 |
+ |
321 |
+src_install() { |
322 |
+ toolchain_src_install |
323 |
+ cd "${D}"${BINPATH} |
324 |
+ for x in gnat*; do |
325 |
+ # For some reason, g77 gets made instead of ${CTARGET}-g77... |
326 |
+ # this should take care of that |
327 |
+ if [[ -f ${x} ]] ; then |
328 |
+ # In case they're hardlinks, clear out the target first |
329 |
+ # otherwise the mv below will complain. |
330 |
+ rm -f ${CTARGET}-${x} |
331 |
+ mv ${x} ${CTARGET}-${x} |
332 |
+ fi |
333 |
+ |
334 |
+ if [[ -f ${CTARGET}-${x} ]] ; then |
335 |
+ if ! is_crosscompile ; then |
336 |
+ ln -sf ${CTARGET}-${x} ${x} |
337 |
+ dosym ${BINPATH#${EPREFIX}}/${CTARGET}-${x} \ |
338 |
+ /usr/bin/${x}-${GCC_CONFIG_VER} |
339 |
+ fi |
340 |
+ # Create versioned symlinks |
341 |
+ dosym ${BINPATH#${EPREFIX}}/${CTARGET}-${x} \ |
342 |
+ /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER} |
343 |
+ fi |
344 |
+ |
345 |
+ if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then |
346 |
+ rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER} |
347 |
+ ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} |
348 |
+ fi |
349 |
+ done |
350 |
+} |
351 |
+ |
352 |
+pkg_postinst () { |
353 |
+ toolchain_pkg_postinst |
354 |
+ einfo "This provide the GNAT compiler with gcc for ada/c/c++ and more" |
355 |
+ einfo "The compiler binary is gcc-${TOOLCHAIN_GCC_PV}" |
356 |
+ einfo "Even if the c/c++ compilers are using almost the same patched" |
357 |
+ einfo "source as the sys-devel/gcc package its use is not extensively" |
358 |
+ einfo "tested, and not supported for updating your system, except for ada" |
359 |
+ einfo "related packages" |
360 |
+} |