void-packages/srcpkgs/7zip/patches/build_flags.patch

56 lines
1.9 KiB
Diff

adapted from https://sources.debian.org/patches/7zip/22.01+dfsg-4/0001-Accept-Debian-build-flags.patch/
and https://gitlab.alpinelinux.org/alpine/aports/-/raw/291a2b61d6e613fbe3ed057c1f2ee41fd2aea9ac/community/7zip/7-zip-flags.patch
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -24,7 +24,7 @@ PROGPATH_STATIC = $(O)/$(PROG)s
ifneq ($(CC), xlc)
-CFLAGS_WARN_WALL = -Werror -Wall -Wextra
+CFLAGS_WARN_WALL = -Wall -Wextra
endif
# for object file
@@ -45,12 +45,12 @@ CFLAGS_DEBUG = -g
else
CFLAGS_DEBUG = -DNDEBUG
ifneq ($(CC), $(CROSS_COMPILE)clang)
-LFLAGS_STRIP = -s
+LFLAGS_STRIP =
endif
endif
# CFLAGS_BASE_LIST = -S
-CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
+CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
$(CFLAGS_DEBUG) -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-fPIC
@@ -111,7 +111,7 @@ endif
else
-LDFLAGS = $(LDFLAGS_STATIC)
+LDFLAGS = $(VOID_LDFLAGS) $(LDFLAGS_STATIC)
# -z force-bti
# -s is not required for clang, do we need it for GCC ???
@@ -169,7 +169,7 @@ endif
-CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) -o $@
+CFLAGS = $(VOID_CFLAGS) $(VOID_CPPFLAGS) $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) -o $@
ifdef IS_MINGW
@@ -210,7 +210,7 @@ CXX_WARN_FLAGS =
#-Wno-invalid-offsetof
#-Wno-reorder
-CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(CXX_INCLUDE_FLAGS) -o $@
+CXXFLAGS = $(VOID_CXXFLAGS) $(VOID_CPPFLAGS) $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(CXX_INCLUDE_FLAGS) -o $@
STATIC_TARGET=
ifdef COMPL_STATIC