Comment 3 for bug 1206200

Revision history for this message
Seth Arnold (seth-arnold) wrote : Re: Perf allows buildd user to run arbitrary code as another user

I believe the correct thing to do is modify debian/rules.d/2-binary-arch.mk

Add DESTDIR=/usr to the make invocation.

This may have more consequences beyond fixing the use of HOME in the resulting binary, however.

$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
        @echo Debug: $@
ifeq ($(do_tools),true)
ifeq ($(do_tools_perf),true)
        cd $(builddirpa)/tools/perf && \
                make HAVE_CPLUS_DEMANGLE=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPYTHON=1 NO_LIBPERL=1 PYTHON=python2.7
endif
        if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
                cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE); \
                cd $(builddirpa)/tools/power/x86/turbostat && make CROSS_COMPILE=$(CROSS_COMPILE); \
                if [ "$(do_hyperv)" = "true" ]; then \
                        cd $(builddirpa)/tools/hv && make CROSS_COMPILE=$(CROSS_COMPILE); \
                fi; \
        fi
endif
        @touch $@