diff options
author | Borislav Petkov <bp@suse.de> | 2013-03-03 14:25:33 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:06:01 -0400 |
commit | b28b130719af6e7f56e0bbdac38ba703a36ba5d5 (patch) | |
tree | 8ed12f2c55b75a7e1db5c0c2dbc7de67441a8805 | |
parent | 5a439645eaf3c0c64ae303ca57f9a4467cbdc6f3 (diff) |
tools lib lk: Fix _FORTIFY_SOURCE builds
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>
-rw-r--r-- | tools/lib/lk/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile index 8cf576f1a003..926cbf3efc7f 100644 --- a/tools/lib/lk/Makefile +++ b/tools/lib/lk/Makefile | |||
@@ -10,7 +10,7 @@ LIB_OBJS += $(OUTPUT)debugfs.o | |||
10 | 10 | ||
11 | LIBFILE = liblk.a | 11 | LIBFILE = liblk.a |
12 | 12 | ||
13 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC | 13 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC |
14 | EXTLIBS = -lpthread -lrt -lelf -lm | 14 | EXTLIBS = -lpthread -lrt -lelf -lm |
15 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 | 15 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
16 | ALL_LDFLAGS = $(LDFLAGS) | 16 | ALL_LDFLAGS = $(LDFLAGS) |