Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/
Date: Wed, 01 May 2019 21:42:06
Message-Id: 1556746886.f9c41f936caf99abb18910db5c68ff68a49c50f9.gyakovlev@gentoo
1 commit: f9c41f936caf99abb18910db5c68ff68a49c50f9
2 Author: Stéphane Veyret <sveyret <AT> gmail <DOT> com>
3 AuthorDate: Tue Apr 9 13:34:10 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed May 1 21:41:26 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9c41f93
7
8 sys-boot/udk: Correct issues with latest compiler versions
9
10 Signed-off-by: Stéphane VEYRET <sveyret <AT> gmail.com>
11 Closes: https://bugs.gentoo.org/633946
12 Closes: https://bugs.gentoo.org/639080
13 Package-Manager: Portage-2.3.62, Repoman-2.3.11
14 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
15
16 .../udk/{udk-2015.ebuild => udk-2015-r1.ebuild} | 124 +++++++--------------
17 1 file changed, 40 insertions(+), 84 deletions(-)
18
19 diff --git a/sys-boot/udk/udk-2015.ebuild b/sys-boot/udk/udk-2015-r1.ebuild
20 similarity index 57%
21 rename from sys-boot/udk/udk-2015.ebuild
22 rename to sys-boot/udk/udk-2015-r1.ebuild
23 index 877b99c94eb..fbb8ad18187 100644
24 --- a/sys-boot/udk/udk-2015.ebuild
25 +++ b/sys-boot/udk/udk-2015-r1.ebuild
26 @@ -1,14 +1,14 @@
27 -# Copyright 1999-2017 Gentoo Foundation
28 +# Copyright 1999-2019 Gentoo Authors
29 # Distributed under the terms of the GNU General Public License v2
30
31 -EAPI=6
32 +EAPI=7
33
34 PYTHON_COMPAT=( python2_7 )
35 PYTHON_REQ_USE="sqlite"
36
37 -inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs versionator
38 +inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs
39
40 -MY_V="${PN^^}$(get_version_component_range 1)"
41 +MY_V="${PN^^}${PV}"
42
43 DESCRIPTION="Tianocore UEFI Development kit"
44 HOMEPAGE=" https://github.com/tianocore/tianocore.github.io/wiki/EDK-II"
45 @@ -19,6 +19,7 @@ SLOT="0"
46 KEYWORDS="~amd64 ~x86"
47 IUSE="doc examples"
48 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
49 +RESTRICT="strip"
50
51 RDEPEND="${PYTHON_DEPS}"
52 DEPEND="${RDEPEND}
53 @@ -27,18 +28,20 @@ DEPEND="${RDEPEND}
54
55 S="${WORKDIR}/MyWorkSpace"
56
57 +# Generated libs for EFI can contain WX sections
58 +QA_EXECSTACK="usr/lib*/libBaseLib.a:*"
59 +
60 pkg_setup() {
61 python_setup 'python2.7'
62
63 - local uname_arch=$(uname -m | sed -e 's:i[3456789]86:IA32:')
64 - if [[ ${uname_arch} == "x86_64" ]] || [[ ${uname_arch} == "amd64" ]] ; then
65 - export ARCH=X64
66 - else
67 - export ARCH=${uname_arch}
68 + if [[ ${ARCH} == "amd64" ]]; then
69 + ARCH=X64
70 + elif [[ ${ARCH} == "x86" ]]; then
71 + ARCH=IA32
72 fi
73
74 # We will create a custom toolchain with user defined settings
75 - export TOOLCHAIN_TAG="CUSTOM"
76 + TOOLCHAIN_TAG="CUSTOM"
77 }
78
79 src_unpack() {
80 @@ -54,10 +57,11 @@ src_unpack() {
81 mkdir -p "${S}/doc" || die
82 pushd "${S}/doc" >/dev/null || die
83 for f in "${WORKDIR}/Documents/"*" Document.zip"; do
84 - doc_name=$(echo ${f} | sed -e 's:^.*/\([^/]*\) Document[.]zip$:\1:')
85 + doc_name=${f##*/}
86 + doc_name=${doc_name% Document.zip}
87 if [[ -f "${WORKDIR}/Documents/${doc_name} Document.zip" ]]; then
88 unpack "${WORKDIR}/Documents/${doc_name} Document.zip"
89 - mv "${S}/doc/html" "${S}/doc/${doc_name}" || die
90 + mv "html" "${doc_name}" || die
91 fi
92 done
93 popd >/dev/null || die
94 @@ -67,14 +71,16 @@ src_unpack() {
95 }
96
97 src_configure() {
98 + # Patch source file for permissive error (issue #639080)
99 + sed -e "s/\(mStringFileName == \)'\\\\0'/\1NULL/" \
100 + -i "${S}/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp" \
101 + || die "Failed to patch source file"
102 + sed -e "s/\((StringPtr != \)L'\\\\0'/\1NULL/" \
103 + -i "${S}/MdeModulePkg/Library/UefiHiiLib/HiiLib.c" \
104 + || die "Failed to patch source file"
105 # Compile of Base Tools is required for further setting up the environment
106 # Base tools does not like parallel make
107 - local cflags_save=${CFLAGS}
108 - append-cflags $(test-flags-CC -MD) $(test-flags-CC -fshort-wchar)
109 - append-cflags $(test-flags-CC -fno-strict-aliasing)
110 - append-cflags $(test-flags-CC -nostdlib) $(test-flags-CC -c)
111 - append-cflags $(test-flags-CC -fPIC)
112 - sed -e "s:^\(CFLAGS\s*=\).*$:\1 ${CFLAGS}:" \
113 + sed -e "s:^\(CFLAGS\s*=\).*$:\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC:" \
114 -i "${S}/BaseTools/Source/C/Makefiles/header.makefile" \
115 || die "Failed to update makefile header"
116 local make_flags=(
117 @@ -88,9 +94,7 @@ src_configure() {
118 . edksetup.sh BaseTools
119
120 # Update flags in UDK parameter files
121 - CFLAGS=${cflags_save}
122 - append-cflags $(test-flags-CC -fshort-wchar)
123 - append-cflags $(test-flags-CC -fno-strict-aliasing) $(test-flags-CC -c)
124 + append-cflags -fshort-wchar -fno-strict-aliasing -c
125 append-cflags $(test-flags-CC -ffunction-sections)
126 append-cflags $(test-flags-CC -fdata-sections)
127 append-cflags $(test-flags-CC -fno-stack-protector)
128 @@ -117,14 +121,12 @@ src_configure() {
129 }
130
131 src_compile() {
132 - local build_target
133 if use examples; then
134 - build_target=all
135 - else
136 - build_target=libraries
137 + ewarn "Examples installation does not work anymore"
138 + ewarn "Try with a most recent version of the package"
139 fi
140
141 - build ${build_target} || die "Failed to compile environment"
142 + build libraries || die "Failed to compile environment"
143 }
144
145 src_install() {
146 @@ -132,24 +134,19 @@ src_install() {
147 local build_dir="${S}/Build/MdeModule/RELEASE_${TOOLCHAIN_TAG}/${ARCH}"
148
149 for f in "${build_dir}"/*/Library/*/*/OUTPUT/*.lib; do
150 - newlib.a "${f}" lib$(basename "${f}" .lib).a
151 + local fn="lib${f##*/}"
152 + newlib.a "${f}" "${fn%.lib}.a"
153 done
154 - dolib "${S}/BaseTools/Scripts/GccBase.lds"
155 + dolib.a "${S}/BaseTools/Scripts/GccBase.lds"
156
157 - local include_dest="/usr/include/${PN}"
158 - for f in "" /Guid /IndustryStandard /Library /Pi /Ppi /Protocol /Uefi; do
159 - insinto "${include_dest}${f}"
160 - doins "${S}/MdePkg/Include${f}"/*.h
161 - done
162 - insinto "${include_dest}"
163 - doins "${S}/MdePkg/Include/${ARCH}"/*.h
164 + insinto "/usr/include/${PN}"
165 + doins "${S}/MdePkg/Include/"*.h
166 + doins -r "${S}/MdePkg/Include/"{${ARCH}/.,Guid,IndustryStandard,Library,Pi,Ppi,Protocol,Uefi}
167 local hfile
168 - find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \
169 - -name 'CryptoPkg' -prune -o -type d -name Include \
170 - -exec find {} -maxdepth 0 \; \
171 - | while read hfile; do
172 - doins -r "${hfile}"/*
173 - done
174 + while read -d '' -r hfile; do
175 + doins -r "${hfile}/."
176 + done < <(find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \
177 + -name 'CryptoPkg' -prune -o -type d -name Include -print0)
178
179 dobin "${S}/BaseTools/Source/C/bin/GenFw"
180
181 @@ -157,52 +154,11 @@ src_install() {
182 docinto "html"
183 # Document installation may be very long, so split it and display message
184 for f in "${S}"/doc/*; do
185 - ebegin "Installing documentation for $(basename ${f}), please wait"
186 + ebegin "Install documentation for ${f##*/}"
187 dodoc -r "${f}"
188 eend $?
189 done
190 fi
191 -
192 - local ex_rebuild_dir
193 - local ex_name
194 - local ex_build_dir
195 - if use examples; then
196 - ex_rebuild_dir="${S}/${P}-exemples"
197 - for f in "${S}/MdeModulePkg/Application"/*; do
198 - ex_name=$(basename "${f}")
199 - ebegin "Preparing ${ex_name} example"
200 - mkdir -p "${ex_rebuild_dir}/${ex_name}" || die
201 - ex_build_dir="${build_dir}/MdeModulePkg/Application"
202 - ex_build_dir="${ex_build_dir}/${ex_name}/${ex_name}"
203 -
204 - copySourceFiles "${f}" "${ex_rebuild_dir}/${ex_name}"
205 - copySourceFiles "${ex_build_dir}/DEBUG" "${ex_rebuild_dir}/${ex_name}"
206 - createMakefile "${ex_rebuild_dir}/${ex_name}/Makefile" \
207 - "${ex_name}" "${ex_build_dir}/GNUmakefile"
208 -
209 - tar -C "${ex_rebuild_dir}" -cf "${ex_rebuild_dir}/${ex_name}.tar" \
210 - "${ex_name}" || die
211 -
212 - eend $? "Failed to create example file"
213 - done
214 - docinto "examples"
215 - dodoc "${ex_rebuild_dir}"/*.tar
216 - fi
217 -
218 -# TODO * QA Notice: The following files contain writable and executable sections
219 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:Thunk16.obj
220 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:SwitchStack.obj
221 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:SetJump.obj
222 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:LongJump.obj
223 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableDisableInterrupts.obj
224 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisablePaging64.obj
225 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuId.obj
226 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuIdEx.obj
227 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableCache.obj
228 -# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisableCache.obj
229 -# TODO * QA Notice: Package triggers severe warnings which indicate that it
230 -# TODO * may exhibit random runtime failures.
231 -# TODO * /usr/include/bits/string3.h:90:70: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer
232 }
233
234 ##
235 @@ -213,7 +169,7 @@ copySourceFiles() {
236 local dest_file
237 while read -d '' -r filename; do
238 dest_file="${2}${filename#${1}}"
239 - mkdir -p $(dirname "${dest_file}") || die
240 + mkdir -p "${dest_file%/*}" || die
241 mv "${filename}" "${dest_file}" || die
242 done < <(find "${1}" -name '*.h' -print0 -o -name '*.c' -print0)
243 }