@@ -108,8 +108,9 @@ This directory contains several subdirectories:
use the tarball image generated in +images/+ and extract it as
root. Compared to +staging/+, +target/+ contains only the files and
libraries needed to run the selected target applications: the
- development files (headers, etc.) are not present, the binaries are
- stripped.
+ development files (headers, etc.) are not present. The binaries are stripped
+ in the generation of the root filesystem but are left unstripped in
+ +target/+.
* +host/+ contains the installation of tools compiled for the host
that are needed for the proper execution of Buildroot, including the
@@ -35,15 +35,18 @@ Then, on the host, you should start the cross gdb using the following
command line:
----------------------------
-<buildroot>/output/host/bin/<tuple>-gdb -x <buildroot>/output/staging/usr/share/buildroot/gdbinit foo
+<buildroot>/output/host/bin/<tuple>-gdb -x <buildroot>/output/target/usr/share/buildroot/gdbinit foo
----------------------------
Of course, +foo+ must be available in the current directory, built
with debugging symbols. Typically you start this command from the
-directory where +foo+ is built (and not from +output/target/+ as the
-binaries in that directory are stripped).
+directory where +foo+ is built or from from +output/target/+, as in
-The +<buildroot>/output/staging/usr/share/buildroot/gdbinit+ file will tell the
+----------------------------
+<buildroot>/output/host/bin/<tuple>-gdb -x <buildroot>/output/target/usr/share/buildroot/gdbinit output/target/usr/bib/foo
+----------------------------
+
+The +<buildroot>/output/target/usr/share/buildroot/gdbinit+ file will tell the
cross gdb where to find the libraries of the target.
Finally, to connect to the target from the cross gdb:
@@ -186,6 +186,7 @@ $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): $$(ROOTFS_$(2)_DEPENDENCIES)
mkdir -p $$(ROOTFS_$(2)_DIR)
rsync -auH \
--exclude=/$$(notdir $$(TARGET_DIR_WARNING_FILE)) \
+ --exclude=/usr/share/buildroot \
$$(BASE_TARGET_DIR)/ \
$$(TARGET_DIR)
@@ -458,8 +458,8 @@ check_toolchain_ssp = \
# Generate gdbinit file for use with Buildroot
#
gen_gdbinit_file = \
- mkdir -p $(STAGING_DIR)/usr/share/buildroot/ ; \
- echo "set sysroot $(STAGING_DIR)" > $(STAGING_DIR)/usr/share/buildroot/gdbinit
+ mkdir -p $(TARGET_DIR)/usr/share/buildroot/ ; \
+ echo "set sysroot $(TARGET_DIR)" > $(TARGET_DIR)/usr/share/buildroot/gdbinit
# Given a path, determine the relative prefix (../) needed to return to the
# root level. Note that the last component is treated as a file component; use a
@@ -469,7 +469,7 @@ endef
#
# Generate gdbinit file for use with Buildroot
#
-define TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT
+define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBINIT
$(Q)if test -f $(TARGET_CROSS)gdb ; then \
$(call MESSAGE,"Installing gdbinit"); \
$(gen_gdbinit_file); \
@@ -569,7 +569,6 @@ define $(2)_INSTALL_STAGING_CMDS
$$(TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK)
$$(TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS)
$$(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER)
- $$(TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT)
endef
# Even though we're installing things in both the staging, the host
@@ -579,6 +578,7 @@ define $(2)_INSTALL_TARGET_CMDS
$$(TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK)
$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS)
$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBSERVER)
+ $$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBINIT)
$$(TOOLCHAIN_EXTERNAL_FIXUP_UCLIBCNG_LDSO)
endef