]> code.ossystems Code Review - openembedded-core.git/commit
grub2: fix build on gcc where _FORTIFY_SOURCE is defined
authorMartin Jansa <martin.jansa@gmail.com>
Tue, 22 Aug 2017 22:10:20 +0000 (00:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Aug 2017 07:44:41 +0000 (08:44 +0100)
commitf5302b0ad2942f7705d46c33949ebc1c5ddf3f58
tree2cf400e8f91fa28821fbe4a4f77ab5c3c1f3ed87
parent5c89539edb17d01ffe82a1b2e7d092816003ecf3
grub2: fix build on gcc where _FORTIFY_SOURCE is defined

* e.g. with gentoo gcc-7.1 they define _FORTIFY_SOURCE by default with:
  https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/7.1.0/gentoo/10_all_default-fortify-source.patch?view=markup
  which results in following error while building grub-efi-native:
  ./config-util.h:1504:48: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
               || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
                                                  ^~~~~~~~~~~~~~~
  this part comes from gnulib and it's used only for Apple and BSD,
  so we can ignore it, but we cannot add -Wno-error=expansion-to-defined
  because this warning was introduced only in gcc-7 and older gcc
  will fail with:
  cc1: error: -Werror=expansion-to-defined: no option -Wexpansion-to-defined
  use #pragma to work around this

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch [new file with mode: 0644]
meta/recipes-bsp/grub/grub2.inc