]> git.tue.mpg.de Git - paraslash.git/commitdiff
build: Activate warnings and LTO on *BSD.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 13 Nov 2022 00:33:17 +0000 (01:33 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 11 Mar 2023 18:16:40 +0000 (19:16 +0100)
Newer versions of BSD ship compilers/packages which no longer
throw warnings, so activate the warnings on all platforms. Also LTO
(link-time optimization) seems to work on the test machines now,
so activate this as well.

Tested on FreeBSD-13.1 with clang-13.0.0 and on NetBSD-9.3 with
gcc-7.5.0.

Makefile.real

index 95b6863010b5e0281a5d6cb41a784e78f0305857..21cef7c7518178589721c530d94e56908d25b7d2 100644 (file)
@@ -119,6 +119,7 @@ CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
 CPPFLAGS += -I$(lls_suite_dir)
 CPPFLAGS += -I$(yy_build_dir)
 CPPFLAGS += $(lopsub_cppflags)
+CPPFLAGS += -Wunused-macros
 
 STRICT_CFLAGS += -fno-strict-aliasing
 STRICT_CFLAGS += -ftrapv
@@ -133,6 +134,11 @@ STRICT_CFLAGS += -Wredundant-decls
 STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas
 STRICT_CFLAGS += -Wdeclaration-after-statement
 STRICT_CFLAGS += -Wformat -Wformat-security -Wmissing-format-attribute
+STRICT_CFLAGS += -fdata-sections -ffunction-sections
+STRICT_CFLAGS += -Wstrict-prototypes
+STRICT_CFLAGS += -Wshadow
+
+LDFLAGS += -Wl,--gc-sections
 
 ifeq ($(ENABLE_UBSAN), yes)
        STRICT_CFLAGS += -fsanitize=undefined
@@ -141,12 +147,7 @@ endif
 
 ifeq ($(uname_s),Linux)
        # these cause warnings on *BSD
-       CPPFLAGS += -Wunused-macros
-       STRICT_CFLAGS += -fdata-sections -ffunction-sections
-       STRICT_CFLAGS += -Wstrict-prototypes
-       STRICT_CFLAGS += -Wshadow
        STRICT_CFLAGS += -Wunused -Wall
-       LDFLAGS += -Wl,--gc-sections
 endif
 
 cc-option = $(shell \