diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index 868cde7353..2beb404c03 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb | |||
@@ -81,6 +81,7 @@ EXTRA_OEMAKE = '\ | |||
81 | AR="${AR}" \ | 81 | AR="${AR}" \ |
82 | LD="${LD}" \ | 82 | LD="${LD}" \ |
83 | EXTRA_CFLAGS="-ldw" \ | 83 | EXTRA_CFLAGS="-ldw" \ |
84 | YFLAGS='-y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' \ | ||
84 | EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \ | 85 | EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \ |
85 | perfexecdir=${libexecdir} \ | 86 | perfexecdir=${libexecdir} \ |
86 | NO_GTK2=1 \ | 87 | NO_GTK2=1 \ |
@@ -214,6 +215,43 @@ do_configure_prepend () { | |||
214 | ${S}/tools/build/Makefile.build | 215 | ${S}/tools/build/Makefile.build |
215 | fi | 216 | fi |
216 | 217 | ||
218 | # start reproducibility substitutions | ||
219 | if [ -e "${S}/tools/perf/Makefile.config" ]; then | ||
220 | # The following line in the Makefle: | ||
221 | # override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON_AUTO)) | ||
222 | # "PYTHON" / "PYTHON_AUTO" have the full path as part of the variable. We've | ||
223 | # ensure that the environment is setup and we do not need the full path to be | ||
224 | # captured, since the symbol gets built into the executable, making it not | ||
225 | # reproducible. | ||
226 | sed -i -e 's,$(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO)),$(notdir $(call get-executable-or-default\,PYTHON\,$(PYTHON_AUTO))),g' \ | ||
227 | ${S}/tools/perf/Makefile.config | ||
228 | |||
229 | # The following line: | ||
230 | # srcdir_SQ = $(patsubst %tools/perf,tools/perf,$(subst ','\'',$(srcdir))), | ||
231 | # Captures the full src path of perf, which of course makes it not | ||
232 | # reproducible. We really only need the relative location 'tools/perf', so we | ||
233 | # change the Makefile line to remove everything before 'tools/perf' | ||
234 | sed -i -e "s%srcdir_SQ = \$(subst ','\\\'',\$(srcdir))%srcdir_SQ = \$(patsubst \%tools/perf,tools/perf,\$(subst ','\\\'',\$(srcdir)))%g" \ | ||
235 | ${S}/tools/perf/Makefile.config | ||
236 | fi | ||
237 | if [ -e "${S}/tools/perf/tests/Build" ]; then | ||
238 | # OUTPUT is the full path, we have python on the path so we remove it from the | ||
239 | # definition. This is captured in the perf binary, so breaks reproducibility | ||
240 | sed -i -e 's,PYTHONPATH="BUILD_STR($(OUTPUT)python)",PYTHONPATH="BUILD_STR(python)",g' \ | ||
241 | ${S}/tools/perf/tests/Build | ||
242 | fi | ||
243 | if [ -e "${S}/tools/perf/util/Build" ]; then | ||
244 | # To avoid bison generating #ifdefs that have captured paths, we make sure | ||
245 | # all the calls have YFLAGS, which contains prefix mapping information. | ||
246 | sed -i -e 's,$(BISON),$(BISON) $(YFLAGS),g' ${S}/tools/perf/util/Build | ||
247 | fi | ||
248 | if [ -e "${S}/scripts/Makefile.host" ]; then | ||
249 | # To avoid yacc (bison) generating #ifdefs that have captured paths, we make sure | ||
250 | # all the calls have YFLAGS, which contains prefix mapping information. | ||
251 | sed -i -e 's,$(YACC),$(YACC) $(YFLAGS),g' ${S}/scripts/Makefile.host | ||
252 | fi | ||
253 | # end reproducibility substitutions | ||
254 | |||
217 | # We need to ensure the --sysroot option in CC is preserved | 255 | # We need to ensure the --sysroot option in CC is preserved |
218 | if [ -e "${S}/tools/perf/Makefile.perf" ]; then | 256 | if [ -e "${S}/tools/perf/Makefile.perf" ]; then |
219 | sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf | 257 | sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf |