Skip to contentSkip to conversation

Btrfs-progs: -U_FORTIFY_SOURCE before -D

PATCH In review Ian Kumlien 4 participants 6 messages Feb 8, 2013 – Feb 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs-progs: -U_FORTIFY_SOURCE before -D

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Which makes it hard to tell if something breaks or not.

---

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index afd6cb2..ae3abdc 100644
@@ -1,5 +1,5 @@
 CC = gcc
-AM_CFLAGS = -Wall -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
+AM_CFLAGS = -Wall -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
 CFLAGS = -g -O1
 objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
 	  root-tree.o dir-item.o file-item.o inode-item.o \
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 8 lines · On Sat, 9 Feb 2013 00:30:21 +0100 Ian Kumlien <[email protected]> wrote:

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Which makes it hard to tell if something breaks or not.

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

Unfortunately it's a gentoo specific gcc bug. I'd suggest reporting it to bugs.gentoo.org. That -D by default breaks linux's perf as well (due to -D_FOTIFY_SOURCE=2 -Werror in perf sources).

Current workaround is to pass AM_CFLAGS to make:
make AM_CFLAGS=stuff_w/o_fortify_source
It's what gentoo's live ebuild does.

Signature · 1 line
  Sergei
#2 lore raw
Quoted 7 lines · Sergei Trofimovich
Quoted 4 lines · On Sat, 9 Feb 2013 00:30:21 +0100 Ian Kumlien <[email protected]> wrote:

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Quoted 8 lines
Quoted 4 lines

Which makes it hard to tell if something breaks or not.

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

Unfortunately it's a gentoo specific gcc bug. I'd suggest reporting it to bugs.gentoo.org. That -D by default breaks linux's perf as well (due to -D_FOTIFY_SOURCE=2 -Werror in perf sources).

Is it? There is a workaround in the android build system for compilers on ubuntu.

Where can i find that bug report?

This is not a emerge, this is a normal system build.

Quoted 3 lines

Current workaround is to pass AM_CFLAGS to make:
make AM_CFLAGS=stuff_w/o_fortify_source
It's what gentoo's live ebuild does.

I can't see it here in the live ebuild...

Quoted 3 lines
Signature · 1 line
  Sergei
#3 lore raw
Quoted 13 lines · On Sat, 9 Feb 2013 19:57:20 +0100 Ian Kumlien <[email protected]> wrote:
Quoted 12 lines · Sergei Trofimovich
Quoted 8 lines · On Sat, 9 Feb 2013 00:30:21 +0100 Ian Kumlien <[email protected]> wrote:

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Which makes it hard to tell if something breaks or not.

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

Quoted 8 lines
Quoted 3 lines

Unfortunately it's a gentoo specific gcc bug. I'd suggest reporting it to bugs.gentoo.org. That -D by default breaks linux's perf as well (due to -D_FOTIFY_SOURCE=2 -Werror in perf sources).

Is it? There is a workaround in the android build system for compilers on ubuntu.

Where can i find that bug report?

I think you need to fill the new one.

Quoted 1 line

This is not a emerge, this is a normal system build.

Yeah, gentoo has patched gcc specs so you get -D_FORTIFY_SOURCE=2 in gcc command line by default.

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.0/gentoo/10_all_default-fortify-source.patch?view=markup

Quoted 5 lines
Quoted 3 lines

Current workaround is to pass AM_CFLAGS to make:
make AM_CFLAGS=stuff_w/o_fortify_source
It's what gentoo's live ebuild does.

I can't see it here in the live ebuild...

sys-fs/btrfs-progs/btrfs-progs-9999.ebuild:
...

src_compile() {
        emake \
                CC="$(tc-getCC)" \
                AM_CFLAGS=-D_FILE_OFFSET_BITS=64 \
                ...
}

This line overrides in-Makefiles AM_CFLAGS.

Signature · 1 line
  Sergei
#4 lore raw
Quoted 25 lines · Sergei Trofimovich
Quoted 13 lines · On Sat, 9 Feb 2013 19:57:20 +0100 Ian Kumlien <[email protected]> wrote:
Quoted 12 lines · Sergei Trofimovich
Quoted 8 lines · On Sat, 9 Feb 2013 00:30:21 +0100 Ian Kumlien <[email protected]> wrote:

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Which makes it hard to tell if something breaks or not.

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

Quoted 8 lines
Quoted 3 lines

Unfortunately it's a gentoo specific gcc bug. I'd suggest reporting it to bugs.gentoo.org. That -D by default breaks linux's perf as well (due to -D_FOTIFY_SOURCE=2 -Werror in perf sources).

Is it? There is a workaround in the android build system for compilers on ubuntu.

Where can i find that bug report?

Quoted 8 lines

I think you need to fill the new one.

Quoted 1 line

This is not a emerge, this is a normal system build.

Yeah, gentoo has patched gcc specs so you get -D_FORTIFY_SOURCE=2 in gcc command line by default.

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.0/gentoo/10_all_default-fortify-source.patch?view=markup

Actually they don't patch the specs they patch the source.

If they'd patched the specs i would have found it, i actually checked gcc -dumpspecs

Again, is there any harm in adding this patch? Apparently other distors has done the same...

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Current workaround is to pass AM_CFLAGS to make:
make AM_CFLAGS=stuff_w/o_fortify_source
It's what gentoo's live ebuild does.

I can't see it here in the live ebuild...

sys-fs/btrfs-progs/btrfs-progs-9999.ebuild:
...

Quoted 8 lines
src_compile() {
        emake \
                CC="$(tc-getCC)" \
                AM_CFLAGS=-D_FILE_OFFSET_BITS=64 \
                ...
}

This line overrides in-Makefiles AM_CFLAGS.

Must have changed recently... Was it changed on the 4:th, 5 days ago?

Quoted 3 lines
Signature · 1 line
  Sergei
#5 lore raw
In reply to Sergei Trofimovich
Quoted 12 lines · Sergei Trofimovich
Quoted 8 lines · On Sat, 9 Feb 2013 00:30:21 +0100 Ian Kumlien <[email protected]> wrote:

My builds are cluttered with:
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Which makes it hard to tell if something breaks or not.

I don't know about you, but bilding with
GCC 4.7.2 on gentoo, this is a issue.

Quoted 7 lines

Unfortunately it's a gentoo specific gcc bug. I'd suggest reporting it to bugs.gentoo.org. That -D by default breaks linux's perf as well (due to -D_FOTIFY_SOURCE=2 -Werror in perf sources).

Current workaround is to pass AM_CFLAGS to make:
make AM_CFLAGS=stuff_w/o_fortify_source
It's what gentoo's live ebuild does.

The fortify flag was added without a special reason, it's good to have it. I'm ok with adding the forced undefine to keep the build quiet and working as specified in the Makefile.

david