mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge pull request #4344 from HiassofT/le10-remote-gdb
Support building of a remote/cross gdb
This commit is contained in:
commit
4018c2ec1c
@ -208,6 +208,7 @@ setup_pkg_config_host() {
|
||||
}
|
||||
|
||||
setup_toolchain() {
|
||||
local have_gold="no"
|
||||
if [ "$LTO_SUPPORT" = "yes" ]; then
|
||||
if flag_enabled "lto-parallel" "no"; then
|
||||
TARGET_CFLAGS+=" $FLAGS_OPTIM_LTO_PARALLEL $FLAGS_OPTIM_LTO_NO_FAT"
|
||||
@ -233,13 +234,20 @@ setup_toolchain() {
|
||||
# gold flag
|
||||
if flag_enabled "gold" "$GOLD_SUPPORT" "only-disable"; then
|
||||
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_GOLD"
|
||||
have_gold="yes"
|
||||
fi
|
||||
|
||||
# compiler optimization, descending priority: speed, size, default
|
||||
if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then
|
||||
TARGET_CFLAGS+=" $CFLAGS_OPTIM_DEBUG"
|
||||
TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_DEBUG"
|
||||
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_DEBUG"
|
||||
if [ "${SPLIT_DEBUG_INFO}" = "yes" -a "${have_gold}" = "yes" ]; then
|
||||
TARGET_CFLAGS+=" $CFLAGS_OPTIM_DEBUG_SPLIT"
|
||||
TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_DEBUG_SPLIT"
|
||||
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_DEBUG_SPLIT"
|
||||
else
|
||||
TARGET_CFLAGS+=" $CFLAGS_OPTIM_DEBUG"
|
||||
TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_DEBUG"
|
||||
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_DEBUG"
|
||||
fi
|
||||
elif flag_enabled "speed" "no"; then
|
||||
TARGET_CFLAGS+=" $CFLAGS_OPTIM_SPEED"
|
||||
TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_SPEED"
|
||||
|
@ -43,6 +43,10 @@ CXXFLAGS_OPTIM_SIZE="$CFLAGS_OPTIM_SIZE"
|
||||
CFLAGS_OPTIM_DEBUG="-ggdb -Os"
|
||||
CXXFLAGS_OPTIM_DEBUG="$CFLAGS_OPTIM_DEBUG"
|
||||
LDFLAGS_OPTIM_DEBUG="-ggdb"
|
||||
# split debug settings (requires gold)
|
||||
CFLAGS_OPTIM_DEBUG_SPLIT="-gsplit-dwarf -Os"
|
||||
CXXFLAGS_OPTIM_DEBUG_SPLIT="$CFLAGS_OPTIM_DEBUG_SPLIT"
|
||||
LDFLAGS_OPTIM_DEBUG_SPLIT="-Wl,--gdb-index"
|
||||
|
||||
# position-independent code
|
||||
CFLAGS_OPTIM_PIC="-fPIC -DPIC"
|
||||
|
@ -9,10 +9,11 @@ PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.gnu.org/software/gdb/"
|
||||
PKG_URL="https://ftp.gnu.org/gnu/gdb/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_DEPENDS_TARGET="toolchain zlib ncurses expat"
|
||||
PKG_DEPENDS_HOST="toolchain:host zlib:host ncurses:host expat:host"
|
||||
PKG_LONGDESC="GNU Project debugger, allows you to see what is going on inside another program while it executes."
|
||||
PKG_BUILD_FLAGS="+size"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="bash_cv_have_mbstate_t=set \
|
||||
PKG_CONFIGURE_OPTS_COMMON="bash_cv_have_mbstate_t=set \
|
||||
--disable-shared \
|
||||
--enable-static \
|
||||
--with-auto-load-safe-path=/ \
|
||||
@ -22,7 +23,6 @@ PKG_CONFIGURE_OPTS_TARGET="bash_cv_have_mbstate_t=set \
|
||||
--with-intel-pt=no \
|
||||
--with-babeltrace=no \
|
||||
--with-expat=yes \
|
||||
--with-libexpat-prefix=${SYSROOT_PREFIX}/usr \
|
||||
--disable-source-highlight \
|
||||
--disable-nls \
|
||||
--disable-sim \
|
||||
@ -36,6 +36,12 @@ PKG_CONFIGURE_OPTS_TARGET="bash_cv_have_mbstate_t=set \
|
||||
--enable-libssp \
|
||||
--disable-werror"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="${PKG_CONFIGURE_OPTS_COMMON} \
|
||||
--with-libexpat-prefix=${SYSROOT_PREFIX}/usr"
|
||||
|
||||
PKG_CONFIGURE_OPTS_HOST="${PKG_CONFIGURE_OPTS_COMMON} \
|
||||
--target=${TARGET_NAME}"
|
||||
|
||||
pre_configure_target() {
|
||||
CC_FOR_BUILD="$HOST_CC"
|
||||
CFLAGS_FOR_BUILD="$HOST_CFLAGS"
|
||||
|
@ -60,6 +60,12 @@ PKG_CONFIGURE_OPTS_TARGET="--without-ada \
|
||||
--disable-home-terminfo \
|
||||
--disable-assertions"
|
||||
|
||||
PKG_CONFIGURE_OPTS_HOST="--enable-termcap \
|
||||
--with-termlib \
|
||||
--with-shared \
|
||||
--enable-pc-files \
|
||||
--without-manpages"
|
||||
|
||||
post_makeinstall_target() {
|
||||
cp misc/ncurses-config $TOOLCHAIN/bin
|
||||
chmod +x $TOOLCHAIN/bin/ncurses-config
|
||||
|
@ -24,3 +24,7 @@ fi
|
||||
if build_with_debug && [ "$VALGRIND" = "yes" ]; then
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET valgrind"
|
||||
fi
|
||||
|
||||
if [ "$REMOTE_GDB" = "yes" ]; then
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gdb:host"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user