From 141831da85135539a2069e8bd31557159efaa552 Mon Sep 17 00:00:00 2001 From: "Rick Farina (Zero_Chaos)" Date: Fri, 13 Dec 2024 17:25:51 -0500 Subject: [PATCH] proper revert2? --- .../opensnitch-ebpf-module-1.6.6.ebuild | 74 ++++++++++++++ .../pyinstaller/pyinstaller-3.6-r1.ebuild | 49 +++++++++ .../pyinstaller/pyinstaller-6.2.0.ebuild | 54 ++++++++++ .../pentoo-mobile/pentoo-mobile-2024.3.ebuild | 40 ++++++++ sys-devel/autofdo/Manifest | 2 + sys-devel/autofdo/autofdo-0.18.ebuild | 30 ++++++ sys-devel/autofdo/autofdo-0.19.ebuild | 34 +++++++ sys-devel/autofdo/autofdo-9999.ebuild | 29 ++++++ sys-devel/autofdo/files/disable-rpath.diff | 12 +++ sys-devel/autofdo/files/link-atomic.diff | 30 ++++++ sys-devel/autofdo/files/link-libgflags.diff | 78 +++++++++++++++ sys-devel/autofdo/files/link-libglog.diff | 99 +++++++++++++++++++ 12 files changed, 531 insertions(+) create mode 100644 app-admin/opensnitch-ebpf-module/opensnitch-ebpf-module-1.6.6.ebuild create mode 100644 dev-python/pyinstaller/pyinstaller-3.6-r1.ebuild create mode 100644 dev-python/pyinstaller/pyinstaller-6.2.0.ebuild create mode 100644 pentoo/pentoo-mobile/pentoo-mobile-2024.3.ebuild create mode 100644 sys-devel/autofdo/Manifest create mode 100644 sys-devel/autofdo/autofdo-0.18.ebuild create mode 100644 sys-devel/autofdo/autofdo-0.19.ebuild create mode 100644 sys-devel/autofdo/autofdo-9999.ebuild create mode 100644 sys-devel/autofdo/files/disable-rpath.diff create mode 100644 sys-devel/autofdo/files/link-atomic.diff create mode 100644 sys-devel/autofdo/files/link-libgflags.diff create mode 100644 sys-devel/autofdo/files/link-libglog.diff diff --git a/app-admin/opensnitch-ebpf-module/opensnitch-ebpf-module-1.6.6.ebuild b/app-admin/opensnitch-ebpf-module/opensnitch-ebpf-module-1.6.6.ebuild new file mode 100644 index 00000000000..53e4514f1ef --- /dev/null +++ b/app-admin/opensnitch-ebpf-module/opensnitch-ebpf-module-1.6.6.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-info + +DESCRIPTION="eBPF process monitor module for opensnitch" +HOMEPAGE="https://github.com/evilsocket/opensnitch" +# NOTE: app-admin/opensnitch and this ebuild share the same source +SRC_URI=" + https://github.com/evilsocket/opensnitch/archive/refs/tags/v${PV}.tar.gz -> opensnitch-${PV}.gh.tar.gz +" + +S="${WORKDIR}/opensnitch-${PV}" +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="amd64" +IUSE="dist-kernel" + +EBPF_DIR=ebpf_prog +MINKV=5.5 # only compatible with kernels >= 5.5 + +RDEPEND=" + dist-kernel? ( virtual/dist-kernel:= ) + ~app-admin/opensnitch-$PV +" + +DEPEND=" + virtual/linux-sources + >=sys-kernel/linux-headers-${MINKV} +" + +BDEPEND=" + sys-devel/bc + sys-devel/clang + sys-devel/llvm +" + +RESTRICT="strip test" +QA_PREBUILT="*" + +pkg_setup() { + # see https://github.com/evilsocket/opensnitch/discussions/978 + local CONFIG_CHECK=" + CGROUP_BPF + BPF_EVENTS + FTRACE_SYSCALLS + KPROBES_ON_FTRACE + KPROBE_EVENTS + UPROBE_EVENTS + " + + linux-info_pkg_setup + kernel_is -ge ${MINKV//./ } || die "Kernel version at least ${MINKV} required" +} + +src_compile() { + MODULES_MAKEARGS+=( + ARCH="x86" + EXTRA_FLAGS="-fno-stack-protector -fcf-protection" + KERNEL_DIR="${KV_DIR}" + KERNEL_HEADERS=/usr # gentoo installs linux-headers to /usr + ) + emake "${MODULES_MAKEARGS[@]}" -C "$EBPF_DIR" || die + llvm-strip -g "$EBPF_DIR"/opensnitch*.o +} + +src_install(){ + insinto /usr/lib/opensnitchd/ebpf/ + doins "$EBPF_DIR"/opensnitch.o + doins "$EBPF_DIR"/opensnitch-dns.o + doins "$EBPF_DIR"/opensnitch-procs.o +} diff --git a/dev-python/pyinstaller/pyinstaller-3.6-r1.ebuild b/dev-python/pyinstaller/pyinstaller-3.6-r1.ebuild new file mode 100644 index 00000000000..db51de85daa --- /dev/null +++ b/dev-python/pyinstaller/pyinstaller-3.6-r1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE='threads(+)' + +inherit distutils-r1 + +DESCRIPTION="Program converting Python programs into stand-alone executables" +HOMEPAGE="https://www.pyinstaller.org" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/pyinstaller/pyinstaller" + EGIT_BRANCH="develop" +else + MY_PN="PyInstaller" + MY_P="${MY_PN}-${PV}" + SRC_URI="https://github.com/pyinstaller/pyinstaller/releases/download/v${PV}/${MY_P}.tar.gz" + KEYWORDS="amd64 ~arm64 x86" + + S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="clang debug doc leak-detector" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +QA_PREBUILT="usr/lib/python*/site-packages/PyInstaller/bootloader/Linux-*" + +RDEPEND="${PYTHON_DEPS} + sys-libs/zlib + >=dev-python/macholib-1.8[${PYTHON_USEDEP}] + dev-python/altgraph[${PYTHON_USEDEP}] + >=dev-python/pefile-2018.08.08[${PYTHON_USEDEP}]" +DEPEND="${RDEPEND} + leak-detector? ( dev-libs/boehm-gc ) + clang? ( sys-devel/clang ) + !clang? ( sys-devel/gcc )" + +src_install() { + distutils-r1_src_install + insinto /etc/revdep-rebuild + doins "${FILESDIR}"/50${PN} +} diff --git a/dev-python/pyinstaller/pyinstaller-6.2.0.ebuild b/dev-python/pyinstaller/pyinstaller-6.2.0.ebuild new file mode 100644 index 00000000000..0cdb0f75793 --- /dev/null +++ b/dev-python/pyinstaller/pyinstaller-6.2.0.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE='threads(+)' + +inherit distutils-r1 pypi + +DESCRIPTION="Program converting Python programs into stand-alone executables" +HOMEPAGE="https://www.pyinstaller.org" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/pyinstaller/pyinstaller" + EGIT_BRANCH="develop" +else +# MY_PN="PyInstaller" +# MY_P="${MY_PN}-${PV}" +# SRC_URI="https://github.com/pyinstaller/pyinstaller/releases/download/v${PV}/${MY_P}.tar.gz" + KEYWORDS="amd64 ~arm64 x86" + +# S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="clang debug doc leak-detector" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RESTRICT="test" + +QA_PREBUILT="usr/lib/python*/site-packages/PyInstaller/bootloader/Linux-*" + +RDEPEND="${PYTHON_DEPS} + sys-libs/zlib + dev-python/altgraph[${PYTHON_USEDEP}] + >=dev-python/pefile-2022.5.30[${PYTHON_USEDEP}] + >=dev-python/macholib-1.8[${PYTHON_USEDEP}] + >=dev-python/pyinstaller-hooks-contrib-2021.4[${PYTHON_USEDEP}] + >=dev-python/packaging-22.0[${PYTHON_USEDEP}] +" +DEPEND="${RDEPEND} + leak-detector? ( dev-libs/boehm-gc ) + clang? ( sys-devel/clang ) + !clang? ( sys-devel/gcc )" + +src_install() { + distutils-r1_src_install + insinto /etc/revdep-rebuild + doins "${FILESDIR}"/50${PN} +} diff --git a/pentoo/pentoo-mobile/pentoo-mobile-2024.3.ebuild b/pentoo/pentoo-mobile/pentoo-mobile-2024.3.ebuild new file mode 100644 index 00000000000..1f7d0a15114 --- /dev/null +++ b/pentoo/pentoo-mobile/pentoo-mobile-2024.3.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Pentoo mobile meta ebuild" +HOMEPAGE="https://www.pentoo.org" +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+android +ios pentoo-extra pentoo-full" + +#projects to add? +#https://github.com/504ensicslabs/lime +#https://github.com/mwrlabs/drozer +#https://github.com/mwrlabs/needle +#https://github.com/JesusFreke/smali + +PDEPEND="dev-util/frida-tools + pentoo-full? ( + dev-debug/dwarf-debugger + dev-util/objection + dev-util/lief + ) + android? ( dev-util/apktool + dev-util/dex2jar + dev-util/android-tools + pentoo-full? ( + dev-util/appmon + dev-python/apkid + app-misc/gplaycli + dev-util/androguard + ) + ) + ios? ( + app-pda/ideviceinstaller + app-pda/ifuse + app-pda/usbmuxd + pentoo-full? ( sys-devel/clang ) + )" diff --git a/sys-devel/autofdo/Manifest b/sys-devel/autofdo/Manifest new file mode 100644 index 00000000000..596a474b2c4 --- /dev/null +++ b/sys-devel/autofdo/Manifest @@ -0,0 +1,2 @@ +DIST autofdo-0.18.tar.gz 62947085 BLAKE2B 2aef2bf35787339b8be86104a484a9a76adb0b54abe272965941c38bf963c7f49062246aefb2f710807ad4d55058c6babd610ba7290fc4c2114bfb2599cd267b SHA512 7f3b735347f69846c085d1ccd528c6cccd098cb6c768bfddfe4e4d5eb53b750775257da2fbf62f046ea073b5a499149d23b57bdf6ee6282630a69ceda0f1dd12 +DIST autofdo-0.19.tar.gz 364598015 BLAKE2B 44647c8c172a0bb65cc8961171cb4acfe09cb6041230db8db3837337ff21bee5cebfb0124d1d6902bccc5c3820958a38774bd4428b12a4b56e384fb2572d99fa SHA512 774fec8ae240c44589519131efc24133eec96dc3387b5c6cd3c02182893e2896ae91241e93b70aa7d3baec803e9a3949a90ee215e1d58e254f0566d48e275e00 diff --git a/sys-devel/autofdo/autofdo-0.18.ebuild b/sys-devel/autofdo/autofdo-0.18.ebuild new file mode 100644 index 00000000000..52ba2681473 --- /dev/null +++ b/sys-devel/autofdo/autofdo-0.18.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools + +DESCRIPTION="System to simplify real-world deployment of feedback-directed optimization" +HOMEPAGE="https://gcc.gnu.org/wiki/AutoFDO" +SRC_URI="https://github.com/google/autofdo/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=">=sys-devel/llvm-5.0.1:* + sys-devel/gcc:*" + +RDEPEND="${DEPEND}" + +src_prepare(){ + #has Google forgot got change it? + sed -i "s|\[0.14\]|\[${PV}\]|" configure.ac + eautoreconf + eapply_user +} + +src_configure(){ + econf --with-llvm +} diff --git a/sys-devel/autofdo/autofdo-0.19.ebuild b/sys-devel/autofdo/autofdo-0.19.ebuild new file mode 100644 index 00000000000..75104150149 --- /dev/null +++ b/sys-devel/autofdo/autofdo-0.19.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools + +DESCRIPTION="System to simplify real-world deployment of feedback-directed optimization" +HOMEPAGE="https://gcc.gnu.org/wiki/AutoFDO" +#SRC_URI="https://github.com/google/autofdo/archive/${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI="https://github.com/google/autofdo/releases/download/0.19/0.19.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +#KEYWORDS="~amd64 ~x86" + +DEPEND=">=sys-devel/llvm-5.0.1:* + sys-devel/gcc:*" + +RDEPEND="${DEPEND}" + +src_prepare(){ + eapply "${FILESDIR}/disable-rpath.diff" + eapply "${FILESDIR}/link-atomic.diff" +# eapply "${FILESDIR}/link-libgflags.diff" +# eapply "${FILESDIR}/link-libglog.diff" + + eautoreconf + eapply_user +} + +src_configure(){ + econf --with-llvm +} diff --git a/sys-devel/autofdo/autofdo-9999.ebuild b/sys-devel/autofdo/autofdo-9999.ebuild new file mode 100644 index 00000000000..bdb03cd72ae --- /dev/null +++ b/sys-devel/autofdo/autofdo-9999.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit git-r3 autotools + +DESCRIPTION="System to simplify real-world deployment of feedback-directed optimization" +HOMEPAGE="https://gcc.gnu.org/wiki/AutoFDO" +EGIT_REPO_URI="https://github.com/kim-phillips-arm/autofdo.git" +#EGIT_COMMIT="" +EGIT_BRANCH="fixissue55try3" + +LICENSE="Apache-2.0" +SLOT="0" + +DEPEND=">=sys-devel/llvm-5.0.1:* + sys-devel/gcc:*" + +RDEPEND="${DEPEND}" + +src_prepare(){ + eautoreconf + eapply_user +} + +src_configure(){ + econf --with-llvm +} diff --git a/sys-devel/autofdo/files/disable-rpath.diff b/sys-devel/autofdo/files/disable-rpath.diff new file mode 100644 index 00000000000..f1490588ed1 --- /dev/null +++ b/sys-devel/autofdo/files/disable-rpath.diff @@ -0,0 +1,12 @@ +--- a/m4/ax_llvm.m4 ++++ b/m4/ax_llvm.m4 +@@ -67,8 +67,7 @@ AC_DEFUN([AX_LLVM], + -ldl -lpthread -ltinfo" + elif test "x$shared_mode" = "xshared"; then + rpath="$($ac_llvm_config_path --libdir)" +- LLVM_LDFLAGS="-Wl,-rpath $rpath \ +- $($ac_llvm_config_path --ldflags)" ++ LLVM_LDFLAGS="$($ac_llvm_config_path --ldflags)" + LLVM_LIBS="$($ac_llvm_config_path --libs $1)" + fi + diff --git a/sys-devel/autofdo/files/link-atomic.diff b/sys-devel/autofdo/files/link-atomic.diff new file mode 100644 index 00000000000..36f1a82b1a3 --- /dev/null +++ b/sys-devel/autofdo/files/link-atomic.diff @@ -0,0 +1,30 @@ +--- a/third_party/protobuf/configure.ac ++++ b/third_party/protobuf/configure.ac +@@ -189,6 +189,16 @@ AM_CONDITIONAL([HAVE_PTHREAD], [test "x$ + # We still keep this for improving pbconfig.h for unsupported platforms. + AC_CXX_STL_HASH + ++AC_MSG_CHECKING([whether linking wiht -latomic succeeds]) ++save_LIBS=$LIBS ++LIBS="$LIBS -latomic" ++AC_LINK_IFELSE( ++ [AC_LANG_SOURCE([int main() { return 0; }])], ++ [LIBATOMIC=-latomic; AC_MSG_RESULT(yes)], ++ [LIBATOMIC=; AC_MSG_RESULT(no)]) ++AC_SUBST(LIBATOMIC) ++LIBS=$save_LIBS ++ + case "$target_os" in + mingw* | cygwin* | win* | aix*) + ;; +--- a/third_party/protobuf/src/Makefile.am ++++ b/third_party/protobuf/src/Makefile.am +@@ -211,7 +211,7 @@ libprotobuf_lite_la_SOURCES = + google/protobuf/io/zero_copy_stream.cc \ + google/protobuf/io/zero_copy_stream_impl_lite.cc + +-libprotobuf_la_LIBADD = $(PTHREAD_LIBS) ++libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC) + libprotobuf_la_LDFLAGS = -version-info 15:1:0 -export-dynamic -no-undefined + if HAVE_LD_VERSION_SCRIPT + libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map diff --git a/sys-devel/autofdo/files/link-libgflags.diff b/sys-devel/autofdo/files/link-libgflags.diff new file mode 100644 index 00000000000..93a240d4abc --- /dev/null +++ b/sys-devel/autofdo/files/link-libgflags.diff @@ -0,0 +1,78 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -32,6 +32,8 @@ AM_CXXFLAGS = -std=gnu++11 -I./$(PROTOBU + LIBS += -lpthread + LIBELF = -lelf + ++LDADD_GFLAGS = -lgflags ++ + COMMON_PROFILE_CREATOR_FILES = addr2line.cc gcov.cc instruction_map.cc \ + module_grouper.cc profile_creator.cc \ + profile_writer.cc sample_reader.cc \ +@@ -40,39 +42,39 @@ COMMON_PROFILE_CREATOR_FILES = addr2line + + bin_PROGRAMS = create_gcov + create_gcov_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) create_gcov.cc +-create_gcov_LDADD = libquipper.a libglog.a libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++create_gcov_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_create_gcov_SOURCES = $(protoc_outputs) + $(am_create_gcov_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += dump_gcov + dump_gcov_SOURCES = profile_reader.cc symbol_map.cc module_grouper.cc gcov.cc \ + dump_gcov.cc +-dump_gcov_LDADD = libglog.a libgflags.a libsymbolize.a ++dump_gcov_LDADD = libglog.a $(LDADD_GFLAGS) libsymbolize.a + + bin_PROGRAMS += sample_merger + sample_merger_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) sample_merger.cc +-sample_merger_LDADD = libquipper.a libglog.a libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++sample_merger_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_sample_merger_SOURCES = $(protoc_outputs) + $(am_sample_merger_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_merger + profile_merger_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_merger.cc +-profile_merger_LDADD = libquipper.a libglog.a libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++profile_merger_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_merger_SOURCES = $(protoc_outputs) + $(am_profile_merger_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_diff + profile_diff_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_diff.cc +-profile_diff_LDADD = libquipper.a libglog.a libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++profile_diff_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_diff_SOURCES = $(protoc_outputs) + $(am_profile_diff_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_update + profile_update_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_update.cc +-profile_update_LDADD = libquipper.a libglog.a libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++profile_update_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_update_SOURCES = $(protoc_outputs) + $(am_profile_update_OBJECTS): $(protoc_outputs) + +@@ -80,7 +82,7 @@ bin_PROGRAMS += create_llvm_prof + create_llvm_prof_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) \ + llvm_profile_writer.cc create_llvm_prof.cc + create_llvm_prof_LDADD = $(LLVM_LDFLAGS) $(LLVM_LIBS) libquipper.a libglog.a \ +- libsymbolize.a libgflags.a $(LIBELF) $(PROTOBUF_DEP) ++ libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + create_llvm_prof_CXXFLAGS = $(LLVM_CXXFLAGS) -DCREATE_LLVM_PROF + nodist_create_llvm_prof_SOURCES = $(protoc_outputs) + $(am_create_llvm_prof_OBJECTS): $(protoc_outputs) +@@ -121,11 +123,6 @@ libglog_a_SOURCES = glog/src/glog/log_se + glog/src/signalhandler.cc \ + glog/src/base/mutex.h glog/src/base/googleinit.h \ + glog/src/base/commandlineflags.h glog/src/googletest.h +-libglog_a_CXXFLAGS = -DNO_THREADS +- +-noinst_LIBRARIES += libgflags.a +-libgflags_a_SOURCES = gflags/gflags.cc gflags/gflags_completions.cc \ +- gflags/gflags_reporting.cc + + noinst_LIBRARIES += libsymbolize.a + libsymbolize_a_SOURCES = symbolize/addr2line_inlinestack.cc \ diff --git a/sys-devel/autofdo/files/link-libglog.diff b/sys-devel/autofdo/files/link-libglog.diff new file mode 100644 index 00000000000..fd75c864ec7 --- /dev/null +++ b/sys-devel/autofdo/files/link-libglog.diff @@ -0,0 +1,99 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -27,12 +27,13 @@ $(protoc_outputs): $(protoc_inputs) $(PR + $(PROTOC) --cpp_out=`dirname $<` -I`dirname $<` $(protoc_inputs) + + ACLOCAL_AMFLAGS = -I m4 +-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/glog/src -I$(top_srcdir)/third_party/perf_data_converter/src/quipper -I./$(PROTOBUF)/src ++AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/third_party/perf_data_converter/src/quipper -I./$(PROTOBUF)/src + AM_CXXFLAGS = -std=gnu++11 -I./$(PROTOBUF)/src + LIBS += -lpthread + LIBELF = -lelf + + LDADD_GFLAGS = -lgflags ++LDADD_GLOG = -lglog + + COMMON_PROFILE_CREATOR_FILES = addr2line.cc gcov.cc instruction_map.cc \ + module_grouper.cc profile_creator.cc \ +@@ -42,46 +43,46 @@ COMMON_PROFILE_CREATOR_FILES = addr2line + + bin_PROGRAMS = create_gcov + create_gcov_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) create_gcov.cc +-create_gcov_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) ++create_gcov_LDADD = libquipper.a $(LDADD_GLOG) libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_create_gcov_SOURCES = $(protoc_outputs) + $(am_create_gcov_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += dump_gcov + dump_gcov_SOURCES = profile_reader.cc symbol_map.cc module_grouper.cc gcov.cc \ + dump_gcov.cc +-dump_gcov_LDADD = libglog.a $(LDADD_GFLAGS) libsymbolize.a ++dump_gcov_LDADD = $(LDADD_GLOG) $(LDADD_GFLAGS) libsymbolize.a + + bin_PROGRAMS += sample_merger + sample_merger_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) sample_merger.cc +-sample_merger_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) ++sample_merger_LDADD = libquipper.a $(LDADD_GLOG) libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_sample_merger_SOURCES = $(protoc_outputs) + $(am_sample_merger_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_merger + profile_merger_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_merger.cc +-profile_merger_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) ++profile_merger_LDADD = libquipper.a $(LDADD_GLOG) libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_merger_SOURCES = $(protoc_outputs) + $(am_profile_merger_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_diff + profile_diff_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_diff.cc +-profile_diff_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) ++profile_diff_LDADD = libquipper.a $(LDADD_GLOG) libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_diff_SOURCES = $(protoc_outputs) + $(am_profile_diff_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += profile_update + profile_update_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) profile_reader.cc \ + profile_update.cc +-profile_update_LDADD = libquipper.a libglog.a libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) ++profile_update_LDADD = libquipper.a $(LDADD_GLOG) libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + nodist_profile_update_SOURCES = $(protoc_outputs) + $(am_profile_update_OBJECTS): $(protoc_outputs) + + bin_PROGRAMS += create_llvm_prof + create_llvm_prof_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) \ + llvm_profile_writer.cc create_llvm_prof.cc +-create_llvm_prof_LDADD = $(LLVM_LDFLAGS) $(LLVM_LIBS) libquipper.a libglog.a \ ++create_llvm_prof_LDADD = $(LLVM_LDFLAGS) $(LLVM_LIBS) libquipper.a $(LDADD_GLOG) \ + libsymbolize.a $(LDADD_GFLAGS) $(LIBELF) $(PROTOBUF_DEP) + create_llvm_prof_CXXFLAGS = $(LLVM_CXXFLAGS) -DCREATE_LLVM_PROF + nodist_create_llvm_prof_SOURCES = $(protoc_outputs) +@@ -107,7 +108,6 @@ libquipper_a_SOURCES = \ + nodist_libquipper_a_SOURCES = $(protoc_outputs) + $(am_libquipper_a_OBJECTS): $(protoc_outputs) + +-noinst_LIBRARIES += libglog.a + libglog_a_SOURCES = glog/src/glog/log_severity.h \ + glog/src/logging.cc glog/src/raw_logging.cc \ + glog/src/vlog_is_on.cc \ +--- a/configure.ac ++++ b/configure.ac +@@ -7,7 +7,7 @@ + AC_PREREQ([2.68]) + AC_INIT([AutoFDO], [m4_esyscmd_s([git describe --abbrev=0 --tags])], [autofdo@googlegroups.com]) + AC_CONFIG_MACRO_DIR([m4]) +-AC_CONFIG_HEADERS(config.h glog/src/config.h) ++AC_CONFIG_HEADERS(config.h) + AM_INIT_AUTOMAKE([subdir-objects]) + + # Checks for the flag --with-protoc. +@@ -102,7 +102,5 @@ AC_SUBST(GMOCK_LIBS) + AS_IF([test -d third_party/perf_data_converter/src/quipper/base], + [rm -rf third_party/perf_data_converter/src/quipper/base]) + +-AC_CONFIG_FILES([Makefile glog/src/glog/logging.h \ +- glog/src/glog/raw_logging.h glog/src/glog/vlog_is_on.h \ +- glog/src/glog/stl_logging.h]) ++AC_CONFIG_FILES([Makefile]) + AC_OUTPUT