aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChris Copeland <chris@chrisnc.net>2023-08-15 02:06:29 -0700
committerChris Packham <judge.packham@gmail.com>2023-09-24 16:12:58 +1300
commit6146b5a6409c8019b37da9f7948ace614324b1dc (patch)
tree6032454db5b8091b290e91e57d1c1bd3a30d09a6 /scripts
parentf22be3a6251c852f321188184f199ffc1d4c156d (diff)
downloadcrosstool-ng-6146b5a6409c8019b37da9f7948ace614324b1dc.tar.gz
crosstool-ng-6146b5a6409c8019b37da9f7948ace614324b1dc.tar.bz2
crosstool-ng-6146b5a6409c8019b37da9f7948ace614324b1dc.zip
use -all-static when building a static gdb
gdb is linked with libtool, which has a different meaning for -static, and -all-static must be used to get a static executable. The binutils build script already uses this option for static builds. Also remove unnecessary -static from cflags for the gdb build. Signed-off-by: Chris Copeland <chris@chrisnc.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/debug/300-gdb.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index e23298c7..8860b541 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -255,6 +255,7 @@ do_gdb_backend()
{
local host prefix destdir cflags ldflags static buildtype subdir includedir
local -a extra_config
+ local -a extra_make_flags
for arg in "$@"; do
case "$arg" in
@@ -285,7 +286,6 @@ do_gdb_backend()
fi
if [ "${static}" = "y" ]; then
- cflags+=" -static"
ldflags+=" -static"
# There is no static libsource-highlight
extra_config+=("--disable-source-highlight")
@@ -347,8 +347,14 @@ do_gdb_backend()
--disable-werror \
"${extra_config[@]}" \
+ if [ "${static}" = "y" ]; then
+ extra_make_flags+=("LDFLAGS=${ldflags} -all-static")
+ CT_DoLog EXTRA "Prepare gdb for static build"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS} configure-host
+ fi
+
CT_DoLog EXTRA "Building ${buildtype} gdb"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS}
+ CT_DoExecLog ALL make "${extra_make_flags[@]}" ${CT_JOBSFLAGS}
CT_DoLog EXTRA "Installing ${buildtype} gdb"
CT_DoExecLog ALL make install ${destdir:+DESTDIR="${destdir}"}