Skip to content

Commit

Permalink
gdb: Use correct libexpat for native build
Browse files Browse the repository at this point in the history
The native gdb needs the version of libexpat built for the target. On
some systems gdb's configure will find the one from the build machine.
Use --with-expat= to point at the correct one for the target.

Fixes: 2092

Signed-off-by: Chris Packham <judge.packham@gmail.com>
  • Loading branch information
cpackham committed Mar 13, 2024
1 parent ecc5e41 commit 6ad7b96
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions scripts/build/debug/300-gdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,7 @@ do_debug_gdb_build()
# where libexpat for build platform lives, which is
# unacceptable for cross-compiling.
#
# To prevent this '--without-libexpat-prefix' flag must be passed.
# Thus configure falls back to '-lexpat', which is exactly what we want.
#
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
# It conflicts with a static build: GDB's configure script will find the shared
# version of expat and will attempt to link that, despite the -static flag.
# The link will fail, and configure will abort with "expat missing or unusable"
# message.
native_extra_config+=("--with-expat")
native_extra_config+=("--without-libexpat-prefix")
native_extra_config+=("--with-expat=${CT_BUILDTOOLS_PREFIX_DIR}")

do_gdb_backend \
buildtype=native \
Expand Down

0 comments on commit 6ad7b96

Please sign in to comment.