Skip to content

Commit 2e7248b

Browse files
icegoodth0ma7
authored andcommitted
Create proper debug configuration
for at least spk/ffmpeg To check against https://github.com/icegood/spksrc/tree/fix/libpng_debug_builds at it fixes png bug Applicable for issue #6176 Signed-off-by: Serhii Ivanov <[email protected]>
1 parent bfa039f commit 2e7248b

File tree

11 files changed

+55
-26
lines changed

11 files changed

+55
-26
lines changed

cross/ffmpeg6/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ COMMENT = FFmpeg is a complete, cross-platform solution to record, convert and
1010
LICENSE = GPLv2
1111

1212
CONFIGURE_ARGS = --target-os=linux --cross-prefix=$(TC_PATH)$(TC_PREFIX) --prefix=$(INSTALL_PREFIX)
13-
CONFIGURE_ARGS += --extra-cflags="-I$(WORK_DIR)/install$(INSTALL_PREFIX)/include"
14-
CONFIGURE_ARGS += --extra-ldflags="-L$(WORK_DIR)/install$(INSTALL_PREFIX)/lib"
15-
CONFIGURE_ARGS += --extra-libs="-lxml2 -ldl -lm" --pkg-config=/usr/bin/pkg-config --ranlib=$(RANLIB)
13+
# no own pkg-config in toolchain:
14+
CONFIGURE_ARGS += --pkg-config=/usr/bin/pkg-config
1615
CONFIGURE_ARGS += --enable-cross-compile --enable-rpath --enable-pic
1716
CONFIGURE_ARGS += --enable-shared
1817
CONFIGURE_ARGS += --enable-gpl --enable-version3
19-
CONFIGURE_ARGS += --disable-debug
18+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
19+
CONFIGURE_ARGS += --enable-debug=3 --disable-stripping --disable-optimizations --assert-level=2 --enable-ftrapv
20+
else
21+
CONFIGURE_ARGS += --disable-debug --enable-stripping
22+
endif
2023
CONFIGURE_ARGS += --disable-static
2124
CONFIGURE_ARGS += --disable-doc
2225

@@ -214,7 +217,7 @@ endif
214217

215218
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH))
216219
CONFIGURE_ARGS += --arch=arm --enable-neon --enable-thumb --disable-armv6 --disable-armv6t2 --disable-vfp --disable-armv5te
217-
ifneq ($(findstring $(ARCH),alpine),$(ARCH))
220+
ifeq ($(findstring alpine,$(ARCH)),alpine)
218221
CONFIGURE_ARGS += --extra-cflags=-DSYNO_ALPINE_NEON
219222
endif
220223
endif

cross/glibc-2.28/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ CONFIGURE_ARGS += --enable-stack-protector=strong
3030
CONFIGURE_ARGS += --with-headers=$(TC_SYSROOT)/usr/include
3131
CONFIGURE_ARGS += ac_cv_prog_MAKEINFO=false
3232

33-
ADDITIONAL_CFLAGS = -O2
34-
3533
include ../../mk/spksrc.cross-cc.mk
3634

3735
.PHONY: glibc_configure_target

cross/libtheora/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ GNU_CONFIGURE = 1
1616
CONFIGURE_ARGS = --disable-static
1717
CONFIGURE_ARGS += --disable-examples
1818
CONFIGURE_ARGS += --disable-spec
19-
ADDITIONAL_CFLAGS = -Os
19+
20+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
21+
COMPILE_MAKE_OPTIONS = debug
22+
endif
2023

2124
include ../../mk/spksrc.cross-cc.mk

cross/libvorbis/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ LICENSE = BSD
1313

1414
GNU_CONFIGURE = 1
1515
CONFIGURE_ARGS = --disable-static
16-
ADDITIONAL_CFLAGS = -Os
16+
17+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
18+
COMPILE_MAKE_OPTIONS = debug
19+
endif
1720

1821
include ../../mk/spksrc.cross-cc.mk

cross/nettle/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ ifeq ($(call version_lt,${TCVERSION},6.0)$(call version_gt,${TCVERSION},2.0),11)
2020
CONFIGURE_ARGS += --disable-assembler
2121
endif
2222

23-
ADDITIONAL_CFLAGS = -O2
24-
2523
include ../../mk/spksrc.cross-cc.mk

cross/x264/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ GNU_CONFIGURE = 1
1818
CONFIGURE_ARGS = --enable-shared
1919
CONFIGURE_ARGS += --enable-pic
2020
CONFIGURE_ARGS += --disable-opencl
21-
CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX)
2221
CONFIGURE_ARGS += --cross-prefix=$(TC_PATH)$(TC_PREFIX)
2322

2423
include ../../mk/spksrc.cross-cc.mk

mk/spksrc.configure.mk

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@ endif
3636

3737
REAL_CONFIGURE_ARGS =
3838
ifneq ($(strip $(GNU_CONFIGURE)),)
39-
REAL_CONFIGURE_ARGS += $(TC_CONFIGURE_ARGS)
40-
REAL_CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX)
41-
# DSM7 appdir
42-
ifeq ($(call version_ge, ${TCVERSION}, 7.0),1)
43-
REAL_CONFIGURE_ARGS += --localstatedir=$(INSTALL_PREFIX_VAR)
44-
endif
39+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
40+
REAL_CONFIGURE_ARGS += --enable-debug --disable-strip
41+
else
42+
REAL_CONFIGURE_ARGS += --enable-strip
43+
endif
44+
REAL_CONFIGURE_ARGS += $(TC_CONFIGURE_ARGS)
45+
REAL_CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX)
46+
# DSM7 appdir
47+
ifeq ($(call version_ge, ${TCVERSION}, 7.0),1)
48+
REAL_CONFIGURE_ARGS += --localstatedir=$(INSTALL_PREFIX_VAR)
49+
endif
4550
endif
4651
REAL_CONFIGURE_ARGS += $(CONFIGURE_ARGS)
4752

mk/spksrc.cross-cmake-env.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ endif
66

77
# We normally build regular Release
88
ifeq ($(strip $(CMAKE_BUILD_TYPE)),)
9-
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Release
9+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
10+
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
11+
endif
12+
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Release
1013
else
11-
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
14+
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
1215
endif
1316

1417
# Set the default install prefix

mk/spksrc.cross-env.mk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ TOOLKIT_ROOT = $(WORK_DIR)/../../../toolkit/syno-$(ARCH)-$(TCVERSION)/work
2121
ENV += TOOLKIT_ROOT=$(TOOLKIT_ROOT)
2222
endif
2323

24+
ADDITIONAL_CFLAGS := $(patsubst -O%,,$(ADDITIONAL_CFLAGS))
25+
ADDITIONAL_CPPFLAGS := $(patsubst -O%,,$(ADDITIONAL_CPPFLAGS))
26+
ADDITIONAL_CXXFLAGS := $(patsubst -O%,,$(ADDITIONAL_CXXFLAGS))
2427
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
25-
GCC_DEBUG_FLAGS = -O0 -g3
26-
ADDITIONAL_CFLAGS := $(patsubst -O%,,$(ADDITIONAL_CFLAGS)) $(GCC_DEBUG_FLAGS)
27-
ADDITIONAL_CPPFLAGS := $(patsubst -O%,,$(ADDITIONAL_CPPFLAGS)) $(GCC_DEBUG_FLAGS)
28-
ADDITIONAL_CXXFLAGS := $(patsubst -O%,,$(ADDITIONAL_CXXFLAGS)) $(GCC_DEBUG_FLAGS)
28+
# other options to consider:
29+
#GCC_DEBUG_FLAGS += -fsanitize=address -fsanitize=undefined -fstack-protector-all
30+
GCC_DEBUG_FLAGS = -ggdb3 -g3
31+
else
32+
GCC_DEBUG_FLAGS = -O3 -fomit-frame-pointer
2933
endif
34+
ADDITIONAL_CFLAGS := $(ADDITIONAL_CFLAGS) $(GCC_DEBUG_FLAGS)
35+
ADDITIONAL_CPPFLAGS := $(ADDITIONAL_CPPFLAGS) $(GCC_DEBUG_FLAGS)
36+
ADDITIONAL_CXXFLAGS := $(ADDITIONAL_CXXFLAGS) $(GCC_DEBUG_FLAGS)
3037

3138
# gcc:
3239
# -g0 deactivates debug information generation

mk/spksrc.cross-meson-env.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ endif
1414
# Set other build options
1515
# We normally build regular Release
1616
ifeq ($(strip $(MESON_BUILD_TYPE)),)
17-
CONFIGURE_ARGS += -Dbuildtype=release
17+
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
18+
CONFIGURE_ARGS += -Dbuildtype=debug
19+
else
20+
CONFIGURE_ARGS += -Dbuildtype=release
21+
endif
1822
else
19-
CONFIGURE_ARGS += -Dbuildtype=$(MESON_BUILD_TYPE)
23+
CONFIGURE_ARGS += -Dbuildtype=$(MESON_BUILD_TYPE)
2024
endif
2125

2226
# Generic cross-file and native-file configurations

0 commit comments

Comments
 (0)