Skip to content

Commit

Permalink
Makefile: honor CPPFLAGS variable
Browse files Browse the repository at this point in the history
Fix the following lintian warning:

I: isochron: hardening-no-fortify-functions usr/bin/isochron
N:
N:    This package provides an ELF binary that lacks the use of fortified libc
N:    functions. Either there are no potentially unfortified functions called
N:    by any routines, all unfortified calls have already been fully validated
N:    at compile-time, or the package was not built with the default Debian
N:    compiler flags defined by dpkg-buildflags. If built using
N:    dpkg-buildflags directly, be sure to import CPPFLAGS.
N:
N:    NB: Due to false-positives, Lintian ignores some unprotected functions
N:    (e.g. memcpy).
N:
N:    Refer to https://wiki.debian.org/Hardening and
N:    https://bugs.debian.org/673112 for details.
N:
N:    Severity: info
N:
N:    Check: binaries

Signed-off-by: Vladimir Oltean <[email protected]>
  • Loading branch information
vladimiroltean committed Jun 23, 2022
1 parent fe232cc commit acda921
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
VERSION := $(shell ./setlocalversion)
MY_CFLAGS := -DVERSION=\"${VERSION}\" $(CFLAGS)
MY_CFLAGS += -Wall -Wextra -Werror -Wno-error=sign-compare \
MY_CPPFLAGS := -DVERSION=\"${VERSION}\" $(CPPFLAGS)
MY_CPPFLAGS += $(shell ./toolchain_deps.sh "$(CC)" "$(MY_CPPFLAGS)")
MY_CFLAGS := -Wall -Wextra -Werror -Wno-error=sign-compare \
-Wno-error=missing-field-initializers \
-Wno-unused-parameter
MY_CFLAGS += $(shell ./toolchain_deps.sh "$(CC)" "$(MY_CFLAGS)")
-Wno-unused-parameter $(CFLAGS)
MY_LDFLAGS := $(LDFLAGS)
CHECK := sparse
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
Expand Down Expand Up @@ -91,9 +91,9 @@ $(TARGET): $(objs)
$(CC) $^ -o $@ $(MY_LDFLAGS) -lm -pthread

%.o: %.c
$(CC) $(MY_CFLAGS) -MMD -c $< -o $@
$(CC) $(MY_CPPFLAGS) $(MY_CFLAGS) -MMD -c $< -o $@
ifeq ($(C),1)
$(CHECK) $(CHECKFLAGS) $(MY_CFLAGS) $<
$(CHECK) $(CHECKFLAGS) $(MY_CPPFLAGS) $(MY_CFLAGS) $<
endif

clean:
Expand Down

0 comments on commit acda921

Please sign in to comment.