]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add build define to manually enable -rdynamic LD flag 1315/head
authorCasey McGinty <casey.mcginty@gmail.com>
Wed, 12 Sep 2018 21:00:08 +0000 (14:00 -0700)
committerCasey McGinty <casey.mcginty@gmail.com>
Wed, 12 Sep 2018 21:00:08 +0000 (14:00 -0700)
programs/Makefile
programs/README.md

index 6c39c983099e3152d3c261f0da70ba2b0e127e27..f1a96325cbf7af8fb6251855e40cde99c0473f71 100644 (file)
@@ -40,8 +40,6 @@ CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
            -DXXH_NAMESPACE=ZSTD_
 ifeq ($(OS),Windows_NT)   # MinGW assumed
 CPPFLAGS   += -D__USE_MINGW_ANSI_STDIO   # compatibility with %zu formatting
-else
-DEBUGFLAGS_LD+= -rdynamic  # Enable backtrace symbol names for Linux/Darwin
 endif
 CFLAGS  ?= -O3
 DEBUGFLAGS+=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
@@ -134,6 +132,15 @@ else
 LZ4_MSG := $(NO_LZ4_MSG)
 endif
 
+# enable backtrace symbol names for Linux/Darwin
+ALL_SYMBOLS := 0
+ifeq (,$(filter Windows%, $(OS)))
+ifeq ($(ALL_SYMBOLS), 1)
+DEBUGFLAGS_LD+=-rdynamic
+endif
+endif
+
+
 .PHONY: default
 default: zstd-release
 
index 0fa033ccf9db06afbcb485f83d7ddb358fa4b6f7..804cb8b0a73fc0e0cbca12927d2169a066cdd2da 100644 (file)
@@ -61,6 +61,13 @@ There are however other Makefile targets that create different variations of CLI
   In which case, linking stage will fail if `lz4` library cannot be found.
   This is useful to prevent silent feature disabling.
 
+- __ALL_SYMBOLS__ : `zstd` can display a stack backtrace if the execution
+  generates a runtime exception. By default, this feature may be
+  degraded/disabled on some platforms unless additional compiler directives are
+  applied. When triaging a runtime issue, enabling this feature can provided
+  more context to determine the location of the fault.
+  Example : `make zstd ALL_SYMBOLS=1`
+
 
 #### Aggregation of parameters
 CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined into `-b1e18i1`.