Actions
Bug #5401
openUnable to compile on Gentoo - getting error: "_FORTIFY_SOURCE" redefined
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-12-06
Due date:
% Done:
0%
Estimated time:
Found in version:
4.3-1529/commit c8bbae504 (probably even in previous ones) and later
Affected Versions:
Description
Couple of revisions back I'm not able to compile pulled source on Gentoo.
After doing "./configure --prefix=/opt/tvheadend" and "make" after a while I'll get this:
Building src/webui/static/intl/tvh.uk.js.gz
Building src/webui/static/intl/tvh.zh.js.gz
Building src/webui/static/intl/tvh.zh-Hans.js.gz
WEBUI std finished
make[3]: Leaving directory '/opt/tvheadend/src-new'
make -f Makefile.webui WEBUI=debug compile-debug
make[3]: Entering directory '/opt/tvheadend/src-new'
WEBUI debug finished
make[3]: Leaving directory '/opt/tvheadend/src-new'
make[2]: Leaving directory '/opt/tvheadend/src-new'
CC src/version.o
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>: note: this is the location of the previous definition
cc1: error: unrecognized command line option '-Wno-stringop-truncation' [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [Makefile:714: /opt/tvheadend/src-new/build.linux/src/version.o] Error 1
I'm able to fix that by doing this:
diff --git a/Makefile b/Makefile
index 007a35e77..783d9a9a0 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ CFLAGS += -g
ifeq ($(CONFIG_CCDEBUG),yes)
CFLAGS += -O0
else
-CFLAGS += -O2 -D_FORTIFY_SOURCE=2
+CFLAGS += -O2
endif
ifeq ($(CONFIG_PIE),yes)
CFLAGS += -fPIE
@@ -53,7 +53,7 @@ CFLAGS += -Wall -Wwrite-strings -Wno-deprecated-declarations
CFLAGS += -Wmissing-prototypes
CFLAGS += -fms-extensions -funsigned-char -fno-strict-aliasing
ifeq ($(COMPILER), gcc)
-CFLAGS += -Wno-stringop-truncation -Wno-stringop-overflow
+#CFLAGS += -Wno-stringop-truncation -Wno-stringop-overflow
endif
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I${BUILDDIR} -I${ROOTDIR}/src -I${ROOTDIR}
but I'm not sure if that is a correct approach.
This is with gcc 7.3.0/glibc 2.27.
I think this broke somewhere around here 75074cb.
Thank you.
Actions