From f64f561e6f5aee05ae93af7443e144453fe31700 Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Mon, 12 Sep 2016 01:13:55 +0300 Subject: debug/gdb: Add comments for untrivial flags. The necessity of --without-libexpat-prefix is not obvious and needs comments. Signed-off-by: Kirill K. Smirnov diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index ac0d857..ac9a657 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -68,6 +68,10 @@ do_debug_gdb_build() { cd "${CT_BUILD_DIR}/build-gdb-cross" cross_extra_config=("${extra_config[@]}") + + # For gdb-cross this combination of flags forces + # gdb configure to fall back to default '-lexpat' flag + # which is acceptable. cross_extra_config+=("--with-expat") cross_extra_config+=("--without-libexpat-prefix") @@ -169,6 +173,16 @@ do_debug_gdb_build() { native_extra_config+=("--with-curses") fi + # Target libexpat resides in sysroot and does not have + # any dependencies, so just passing '-lexpat' to gcc is enough. + # + # By default gdb configure looks for expat in '$prefix/lib' + # directory. In our case '$prefix/lib' resolves to '/usr/lib' + # 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. native_extra_config+=("--with-expat") native_extra_config+=("--without-libexpat-prefix") -- cgit v0.10.2-6-g49f6