mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge pull request #2480 from HiassofT/le9-perf
install perf in development builds
This commit is contained in:
commit
7f93f94cc7
31
packages/debug/libunwind/package.mk
Normal file
31
packages/debug/libunwind/package.mk
Normal file
@ -0,0 +1,31 @@
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - https://libreelec.tv
|
||||
# Copyright (C) 2018-present Team LibreELEC
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# LibreELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="libunwind"
|
||||
PKG_VERSION="1.2.1"
|
||||
PKG_SHA256="3f3ecb90e28cbe53fba7a4a27ccce7aad188d3210bb1964a923a731a27a75acb"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.nongnu.org/libunwind/"
|
||||
PKG_URL="http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PKG_VERSION}.tar.gz"
|
||||
PKG_SECTION="debug"
|
||||
PKG_SHORTDESC="library to determine the call-chain of a program"
|
||||
PKG_LONGDESC="library to determine the call-chain of a program"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="--enable-static \
|
||||
--disable-shared"
|
@ -24,6 +24,7 @@ PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.gnu.org/software/binutils/"
|
||||
PKG_URL="http://ftpmirror.gnu.org/binutils/$PKG_NAME-$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS_HOST="ccache:host bison:host flex:host linux:host"
|
||||
PKG_DEPENDS_TARGET="toolchain binutils:host"
|
||||
PKG_SECTION="toolchain/devel"
|
||||
PKG_SHORTDESC="binutils: A GNU collection of binary utilities"
|
||||
PKG_LONGDESC="The GNU binutils are utilities of use when dealing with object files. the packages includes ld - the GNU linker, as - the GNU assembler, addr2line - converts addresses into filenames and line numbers, ar - a utility for creating, modifying and extracting from archives, c++filt - filter to demangle encoded C++ symbols, gprof - displays profiling information, nlmconv - converts object code into an NLM, nm - lists symbols from object files, objcopy - Copys and translates object files, objdump - displays information from object files, ranlib - generates an index to the contents of an archive, readelf - displays information from any ELF format object file, size - lists the section sizes of an object or archive file, strings - lists printable strings from files, strip - discards symbols as well as windres - a compiler for Windows resource files."
|
||||
@ -44,6 +45,21 @@ PKG_CONFIGURE_OPTS_HOST="--target=$TARGET_NAME \
|
||||
--enable-lto \
|
||||
--disable-nls"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="--target=$TARGET_NAME \
|
||||
--with-sysroot=$SYSROOT_PREFIX \
|
||||
--with-lib-path=$SYSROOT_PREFIX/lib:$SYSROOT_PREFIX/usr/lib \
|
||||
--without-ppl \
|
||||
--without-cloog \
|
||||
--disable-werror \
|
||||
--disable-multilib \
|
||||
--disable-libada \
|
||||
--disable-libssp \
|
||||
--disable-plugins \
|
||||
--disable-gold \
|
||||
--disable-ld \
|
||||
--disable-lto \
|
||||
--disable-nls"
|
||||
|
||||
pre_configure_host() {
|
||||
unset CPPFLAGS
|
||||
unset CFLAGS
|
||||
@ -60,3 +76,13 @@ makeinstall_host() {
|
||||
cp -v ../include/libiberty.h $SYSROOT_PREFIX/usr/include
|
||||
make install
|
||||
}
|
||||
|
||||
make_target() {
|
||||
make configure-host
|
||||
make -C libiberty libiberty.a
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $SYSROOT_PREFIX/usr/lib
|
||||
cp libiberty/libiberty.a $SYSROOT_PREFIX/usr/lib
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="elfutils"
|
||||
PKG_VERSION="0.168"
|
||||
PKG_SHA256="b88d07893ba1373c7dd69a7855974706d05377766568a7d9002706d5de72c276"
|
||||
PKG_VERSION="0.170"
|
||||
PKG_SHA256="1f844775576b79bdc9f9c717a50058d08620323c1e935458223a12f249c9e066"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://sourceware.org/elfutils/"
|
||||
@ -45,14 +45,21 @@ make_target() {
|
||||
make V=1 -C libelf libelf.a
|
||||
make V=1 -C libebl libebl.a
|
||||
make V=1 -C libdwfl libdwfl.a
|
||||
make V=1 -C libdwelf libdwelf.a
|
||||
make V=1 -C libdw libdw.a
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
make DESTDIR="$SYSROOT_PREFIX" -C libelf install-includeHEADERS install-pkgincludeHEADERS
|
||||
make DESTDIR="$SYSROOT_PREFIX" -C libdwfl install-pkgincludeHEADERS
|
||||
make DESTDIR="$SYSROOT_PREFIX" -C libdw install-includeHEADERS install-pkgincludeHEADERS
|
||||
|
||||
mkdir -p $SYSROOT_PREFIX/usr/lib
|
||||
cp libelf/libelf.a $SYSROOT_PREFIX/usr/lib
|
||||
cp libebl/libebl.a $SYSROOT_PREFIX/usr/lib
|
||||
cp libdwfl/libdwfl.a $SYSROOT_PREFIX/usr/lib
|
||||
cp libdw/libdw.a $SYSROOT_PREFIX/usr/lib
|
||||
|
||||
mkdir -p $SYSROOT_PREFIX/usr/include/elfutils
|
||||
cp version.h $SYSROOT_PREFIX/usr/include/elfutils
|
||||
}
|
||||
|
@ -29,6 +29,32 @@ PKG_SHORTDESC="linux26: The Linux kernel 2.6 precompiled kernel binary image and
|
||||
PKG_LONGDESC="This package contains a precompiled kernel image and the modules."
|
||||
PKG_IS_KERNEL_PKG="yes"
|
||||
|
||||
PKG_CFG_FILE="$PKG_NAME.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf"
|
||||
if [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$PKG_CFG_FILE
|
||||
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$PKG_CFG_FILE
|
||||
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$PKG_CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$PKG_CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_CFG_FILE
|
||||
elif [ -f $PKG_DIR/config/$PKG_VERSION/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_VERSION/$PKG_CFG_FILE
|
||||
elif [ -f $PKG_DIR/config/$LINUX/$PKG_CFG_FILE ]; then
|
||||
PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$LINUX/$PKG_CFG_FILE
|
||||
else
|
||||
PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_CFG_FILE
|
||||
fi
|
||||
|
||||
if [ "$DEVTOOLS" = "yes" ] && grep -q ^CONFIG_PERF_EVENTS= $PKG_KERNEL_CFG_FILE ; then
|
||||
PKG_BUILD_PERF="yes"
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET binutils elfutils libunwind zlib openssl"
|
||||
fi
|
||||
|
||||
case "$LINUX" in
|
||||
amlogic-3.10)
|
||||
PKG_VERSION="02fdb27"
|
||||
@ -74,34 +100,13 @@ if [ "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then
|
||||
fi
|
||||
|
||||
post_patch() {
|
||||
CFG_FILE="$PKG_NAME.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf"
|
||||
if [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$PKG_VERSION/$CFG_FILE
|
||||
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$LINUX/$CFG_FILE
|
||||
elif [ -n "$DEVICE" -a -f $PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/devices/$DEVICE/$PKG_NAME/$CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$PKG_VERSION/$CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$LINUX/$CFG_FILE
|
||||
elif [ -f $PROJECT_DIR/$PROJECT/$PKG_NAME/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PROJECT_DIR/$PROJECT/$PKG_NAME/$CFG_FILE
|
||||
elif [ -f $PKG_DIR/config/$PKG_VERSION/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_VERSION/$CFG_FILE
|
||||
elif [ -f $PKG_DIR/config/$LINUX/$CFG_FILE ]; then
|
||||
KERNEL_CFG_FILE=$PKG_DIR/config/$LINUX/$CFG_FILE
|
||||
else
|
||||
KERNEL_CFG_FILE=$PKG_DIR/config/$CFG_FILE
|
||||
fi
|
||||
|
||||
sed -i -e "s|^HOSTCC[[:space:]]*=.*$|HOSTCC = $TOOLCHAIN/bin/host-gcc|" \
|
||||
-e "s|^HOSTCXX[[:space:]]*=.*$|HOSTCXX = $TOOLCHAIN/bin/host-g++|" \
|
||||
-e "s|^ARCH[[:space:]]*?=.*$|ARCH = $TARGET_KERNEL_ARCH|" \
|
||||
-e "s|^CROSS_COMPILE[[:space:]]*?=.*$|CROSS_COMPILE = $PKG_TARGET_PREFIX|" \
|
||||
$PKG_BUILD/Makefile
|
||||
|
||||
cp $KERNEL_CFG_FILE $PKG_BUILD/.config
|
||||
cp $PKG_KERNEL_CFG_FILE $PKG_BUILD/.config
|
||||
if [ ! "$BUILD_ANDROID_BOOTIMG" = "yes" ]; then
|
||||
sed -i -e "s|^CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"$BUILD/image/initramfs.cpio\"|" $PKG_BUILD/.config
|
||||
sed -i -e '/^CONFIG_INITRAMFS_SOURCE=*./ a CONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0' $PKG_BUILD/.config
|
||||
@ -175,6 +180,25 @@ make_target() {
|
||||
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build
|
||||
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source
|
||||
|
||||
if [ "$PKG_BUILD_PERF" = "yes" ] ; then
|
||||
( cd tools/perf
|
||||
WERROR=0 \
|
||||
NO_LIBPERL=1 \
|
||||
NO_LIBPYTHON=1 \
|
||||
NO_SLANG=1 \
|
||||
NO_GTK2=1 \
|
||||
NO_LIBNUMA=1 \
|
||||
NO_LIBAUDIT=1 \
|
||||
NO_LZMA=1 \
|
||||
NO_SDT=1 \
|
||||
LDFLAGS="-ldw -ldwfl -lebl -lelf -ldl -lz" \
|
||||
EXTRA_PERFLIBS="-lebl" \
|
||||
make
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp perf $INSTALL/usr/bin
|
||||
)
|
||||
fi
|
||||
|
||||
( cd $ROOT
|
||||
rm -rf $BUILD/initramfs
|
||||
$SCRIPTS/install initramfs
|
||||
|
Loading…
x
Reference in New Issue
Block a user