diff --git a/Makefile b/Makefile index 5fa37a432238eba44bbbd8446445218cf1a4bc79..afdbc4c8a7f7d561a7d33f3ebb048f1b066c3fa8 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ GLUON_SITE_VERSION ?= $(shell scripts/getversion.sh '$(GLUON_SITEDIR)') GLUON_MULTIDOMAIN ?= 0 GLUON_AUTOREMOVE ?= 0 -GLUON_DEBUG ?= 0 +GLUON_DEBUG ?= 1 GLUON_MINIFY ?= 1 # Can be overridden via environment/command line/... to use the Gluon diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index daa7f537146c7e06f371702f08ed3b2ce5351523..332ffc99177270a77c82630f95dea651c6d936b9 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -255,8 +255,17 @@ GLUON_AUTOREMOVE as it significantly increases incremental build times. GLUON_DEBUG - Setting ``GLUON_DEBUG=1`` will provide firmware images including debugging symbols usable with GDB or - similar tools. Requires a device or target with at least 16 MB of flash space, e.g. `x86-64`. Unset by default. + The following values are supported: + + - ``0``: Remove symbol tables and debug information as well as most section and other + information not strictly necessary for execution using ``sstrip``. This saves a small amount + of flash space over the default ``strip`` command (roughly 70kiB for ath79), but makes any + kind of binary analysis much more difficult, as common tools like objdump and gdb can't + handle such files at all. + - ``1``: Remove symbol tables and debug information from binaries using the standard ``strip`` + command. This is the default. + - ``2``: Include debugging symbols usable with GDB or similar tools in all binaries of the image. + Requires a device or target with at least 16 MB of flash space, e.g. ``x86-64``. GLUON_MINIFY Setting ``GLUON_MINIFY=0`` will omit the minification of scripts during the build process. By diff --git a/targets/generic b/targets/generic index 80beb7ee92adefc81959d2359fc7d36c9deb3b09..125375e30b672938c2ee3324cbc4dc27b9f7be36 100644 --- a/targets/generic +++ b/targets/generic @@ -84,13 +84,16 @@ config('GLUON_MULTIDOMAIN', istrue(env.GLUON_MULTIDOMAIN)) config('AUTOREMOVE', istrue(env.GLUON_AUTOREMOVE)) -if istrue(env.GLUON_DEBUG) then +if (tonumber(env.GLUON_DEBUG) or 0) > 1 then config('DEBUG', true) config('NO_STRIP', true) config('USE_STRIP', false) config('USE_SSTRIP', false) try_config('TARGET_ROOTFS_PARTSIZE', 500) +elseif istrue(env.GLUON_DEBUG) then + config('USE_STRIP', true) + config('USE_SSTRIP', false) end config('GLUON_MINIFY', istrue(env.GLUON_MINIFY))