Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@openwide.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv2 09/12] gcc/4.7: add patch to warn about unsafe header paths
Date: Mon, 08 Dec 2014 23:52:38 +0100	[thread overview]
Message-ID: <54862BB6.8040306@openwide.fr> (raw)
In-Reply-To: <1417470913-1280-10-git-send-email-thomas.petazzoni@free-electrons.com>

Hi Thomas,

Le 01/12/2014 22:55, Thomas Petazzoni a ?crit :
> This commit adds a patch to gcc borrowed from CodeSourcery/Yocto that
> warns about unsafe include paths (i.e /usr/include,
> /usr/local/include, etc.). The patch was adapted to gcc 4.7.4, and
> modified to support the BR_COMPILER_PARANOID_UNSAFE_PATH environment
> variable to error out instead of just warn when unsafe paths are
> used. Even though erroring out can be chosen by passing
> -Werror=poison-system-directories, we are not sure this option in
> CFLAGS will always be passed, so having an environment variable
> guarantees it will always be passed, and also allows to have an
> identical behavior to the external toolchain wrapper.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---

Tested-by: Romain Naour <romain.naour@openwide.fr>

Tested with the following internal toolchain

BR2_i386=y
BR2_ARCH="i686"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="i686"
BR2_ARCH_HAS_ATOMICS=y
BR2_x86_i686=y

BR2_COMPILER_PARANOID_UNSAFE_PATH=y

BR2_TOOLCHAIN=y
BR2_TOOLCHAIN_USES_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT=y

BR2_KERNEL_HEADERS_3_17=y
BR2_DEFAULT_KERNEL_HEADERS="3.17.4"

BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_LIBC="glibc"
BR2_PACKAGE_GLIBC=y
BR2_GLIBC_VERSION_2_20=y
BR2_GLIBC_VERSION_STRING="2.20"

BR2_BINUTILS_VERSION_2_22=y
BR2_BINUTILS_VERSION="2.22"

BR2_GCC_VERSION_4_7_X=y
BR2_GCC_VERSION="4.7.4"

$ make O=test/paranoid-4/ iprutils

/home/naourr/git/buildroot/test/paranoid-4/host/usr/bin/i686-buildroot-linux-gnu-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os
-Wall -DIPR_MAJOR_RELEASE=2 -DIPR_MINOR_RELEASE=4 -DIPR_FIX_LEVEL=2
-DIPR_FIX_DATE='"(June 10, 2014)"' -DIPR_VERSION_STR='"2.4.2 (June 10, 2014)"'
-DIPR_RELEASE=1 -I. -I/usr/include/ncurses -o iprlib.o -c iprlib.c

cc1: erreur: include location "/usr/include/ncurses" is unsafe for
cross-compilation [-Werror=poison-system-directories]

cc1: some warnings being treated as errors
gzip -f -c iprconfig.8 > iprconfig.8.gz
make[1]: *** [iprlib.o] Erreur 1

Thanks

-- 
Romain Naour

OPEN WIDE Ing?nierie - Paris
23/25, rue Daviel| 75013 PARIS
http://ingenierie.openwide.fr

Le blog des technologies libres et embarqu?es :
http://www.linuxembedded.fr

  reply	other threads:[~2014-12-08 22:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 21:55 [Buildroot] [PATCHv2 00/12] Paranoid header and library path checking Thomas Petazzoni
2014-12-01 21:55 ` [Buildroot] [PATCHv2 01/12] toolchain-external: instrument wrapper to warn about unsafe paths Thomas Petazzoni
2014-12-06 16:57   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 02/12] binutils/2.24: add patch to warn about unsafe library paths Thomas Petazzoni
2014-12-08 22:51   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 03/12] binutils/2.23: " Thomas Petazzoni
2014-12-06 17:23   ` Romain Naour
2014-12-08 21:55     ` Romain Naour
2014-12-08 22:51   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 04/12] binutils/2.22: " Thomas Petazzoni
2014-12-08 22:51   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 05/12] binutils/arc-4.8-R3: " Thomas Petazzoni
2014-12-08 22:58   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 06/12] gcc/4.9: add patch to warn about unsafe header paths Thomas Petazzoni
2014-12-08 22:52   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 07/12] gcc/4.8: " Thomas Petazzoni
2014-12-08 22:52   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 08/12] gcc/arc-4.8-R3: " Thomas Petazzoni
2014-12-08 22:59   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 09/12] gcc/4.7: " Thomas Petazzoni
2014-12-08 22:52   ` Romain Naour [this message]
2014-12-01 21:55 ` [Buildroot] [PATCHv2 10/12] gcc: enable poison system directories option Thomas Petazzoni
2014-12-01 21:55 ` [Buildroot] [PATCHv2 11/12] binutils: " Thomas Petazzoni
2014-12-08 22:55   ` Romain Naour
2014-12-01 21:55 ` [Buildroot] [PATCHv2 12/12] Add option for paranoid unsafe path checking Thomas Petazzoni
2014-12-06 17:08   ` Romain Naour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54862BB6.8040306@openwide.fr \
    --to=romain.naour@openwide.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox