This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1 of 2] cross-gdb: add XML support


# HG changeset patch
# User "BenoÃt THÃBAUDEAU" <benoit.thebaudeau@advansee.com>
# Date 1306235318 -7200
# Node ID 420687b63c9775201e84e40f76b4c176996e3bda
# Parent  230d50dd23230a2b09fb390d771f5628a1c7342f
cross-gdb: add XML support

This patch adds XML support to cross-gdb so that the target description can be
parsed. This avoids possible runtime malfunctions, and the following GDB warning:
"Can not parse XML target description; XML support was disabled at compile time"

Signed-off-by: "BenoÃt THÃBAUDEAU" <benoit.thebaudeau@advansee.com>

diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -16,6 +16,7 @@
 
     if [ "${CT_GDB_CROSS}" = y ]; then
         do_gdb=y
+        do_expat=y
     fi
 
     if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
@@ -100,8 +101,34 @@
 
     if [ "${CT_GDB_CROSS}" = "y" ]; then
         local -a cross_extra_config
+        local -a gdb_cross_CFLAGS
 
         CT_DoStep INFO "Installing cross-gdb"
+
+        if [ "${do_expat}" = "y" ]; then
+            CT_DoLog EXTRA "Building static host expat"
+
+            mkdir -p "${CT_BUILD_DIR}/host-expat-build"
+            cd "${CT_BUILD_DIR}/host-expat-build"
+
+            CT_DoExecLog CFG                                                \
+            "${CT_SRC_DIR}/expat-${CT_DEBUG_GDB_EXPAT_VERSION}/configure"   \
+                --build=${CT_BUILD}                                         \
+                --host=${CT_HOST}                                           \
+                --prefix="${CT_BUILD_DIR}/static-host"                      \
+                --enable-static                                             \
+                --disable-shared
+
+            CT_DoExecLog ALL make ${JOBSFLAGS}
+            CT_DoExecLog ALL make install
+
+            cross_extra_config+=("--with-expat")
+            cross_extra_config+=("--with-libexpat-prefix=${CT_BUILD_DIR}/static-host")
+            # There's no better way to tell gdb where to find -lexpat... :-(
+            gdb_cross_CFLAGS+=("-I${CT_BUILD_DIR}/static-host/include")
+            gdb_cross_CFLAGS+=("-L${CT_BUILD_DIR}/static-host/lib")
+        fi # do_expat
+
         CT_DoLog EXTRA "Configuring cross-gdb"
 
         mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
@@ -127,6 +154,7 @@
         CT_DoExecLog CFG                                \
         CC="${CC_for_gdb}"                              \
         LD="${LD_for_gdb}"                              \
+        CFLAGS="${gdb_cross_CFLAGS[*]}"                 \
         "${gdb_cross_configure}"                        \
             --build=${CT_BUILD}                         \
             --host=${CT_HOST}                           \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]