![Borislav Petkov](/assets/img/avatar_default.png)
Jiri Olsa triggers the following build error: SUBDIR ../lib/lk/ CC debugfs.o In file included from /usr/include/errno.h:29:0, from debugfs.c:1: /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] This is because enabling buffer overflow checks through _FORTIFY_SOURCE require compiler optimizations to be enabled too. However, those are not. Enable them by simply copying the perf optimization level. It can be expanded later if we want to support debug builds, etc. Signed-off-by: Borislav Petkov <bp@suse.de> Reported-by: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1362338733-8718-1-git-send-email-bp@alien8.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
36 lines
776 B
Makefile
36 lines
776 B
Makefile
include ../../scripts/Makefile.include
|
|
|
|
# guard against environment variables
|
|
LIB_H=
|
|
LIB_OBJS=
|
|
|
|
LIB_H += debugfs.h
|
|
|
|
LIB_OBJS += $(OUTPUT)debugfs.o
|
|
|
|
LIBFILE = liblk.a
|
|
|
|
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
|
|
EXTLIBS = -lpthread -lrt -lelf -lm
|
|
ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
|
ALL_LDFLAGS = $(LDFLAGS)
|
|
|
|
RM = rm -f
|
|
|
|
$(LIBFILE): $(LIB_OBJS)
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS)
|
|
|
|
$(LIB_OBJS): $(LIB_H)
|
|
|
|
$(OUTPUT)%.o: %.c
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
|
$(OUTPUT)%.s: %.c
|
|
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
|
|
$(OUTPUT)%.o: %.S
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
|
|
|
clean:
|
|
$(RM) $(LIB_OBJS) $(LIBFILE)
|
|
|
|
.PHONY: clean
|