linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf, liblk: Fix _FORTIFY_SOURCE builds
@ 2013-03-03 19:25 Borislav Petkov
  2013-03-03 20:36 ` Arnaldo Carvalho de Melo
  2013-03-21 11:03 ` [tip:perf/core] tools lib lk: " tip-bot for Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2013-03-03 19:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: LKML, Borislav Petkov

From: Borislav Petkov <bp@suse.de>

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.

Reported-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 tools/lib/lk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 
 LIBFILE = liblk.a
 
-CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
+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)
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf, liblk: Fix _FORTIFY_SOURCE builds
  2013-03-03 19:25 [PATCH] perf, liblk: Fix _FORTIFY_SOURCE builds Borislav Petkov
@ 2013-03-03 20:36 ` Arnaldo Carvalho de Melo
  2013-03-21 11:03 ` [tip:perf/core] tools lib lk: " tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-03-03 20:36 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: LKML, Borislav Petkov

Em Sun, Mar 03, 2013 at 08:25:33PM +0100, Borislav Petkov escreveu:
> 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.

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] tools lib lk: Fix _FORTIFY_SOURCE builds
  2013-03-03 19:25 [PATCH] perf, liblk: Fix _FORTIFY_SOURCE builds Borislav Petkov
  2013-03-03 20:36 ` Arnaldo Carvalho de Melo
@ 2013-03-21 11:03 ` tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-03-21 11:03 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, tglx, bp, jolsa

Commit-ID:  b28b130719af6e7f56e0bbdac38ba703a36ba5d5
Gitweb:     http://git.kernel.org/tip/b28b130719af6e7f56e0bbdac38ba703a36ba5d5
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Sun, 3 Mar 2013 20:25:33 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Mar 2013 13:06:01 -0300

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>
---
 tools/lib/lk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile
index 8cf576f..926cbf3 100644
--- a/tools/lib/lk/Makefile
+++ b/tools/lib/lk/Makefile
@@ -10,7 +10,7 @@ LIB_OBJS += $(OUTPUT)debugfs.o
 
 LIBFILE = liblk.a
 
-CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
+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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-21 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-03 19:25 [PATCH] perf, liblk: Fix _FORTIFY_SOURCE builds Borislav Petkov
2013-03-03 20:36 ` Arnaldo Carvalho de Melo
2013-03-21 11:03 ` [tip:perf/core] tools lib lk: " tip-bot for Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).