* [meta-oe][PATCH v2] gcc-6.2: Add fix for missing no-PIE flags
@ 2017-02-12 20:20 Stephen Arnold
2017-02-13 0:03 ` Khem Raj
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Arnold @ 2017-02-12 20:20 UTC (permalink / raw)
To: openembedded-core
From: Stephen Arnold <stephen.arnold42@gmail.com>
Fixes build on hardened PAX host with gcc-5 (linker error on relocs).
Completes no-PIE config by adding to ALL_* flags variables.
Borrowed from Gentoo gcc patches, tested on 2 hardened amd64 hosts.
Upstream-Status: Inappropriate [configuration]
Commited by: Gentoo Toolchain Project <toolchain@gentoo.org>
Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com>
---
meta/recipes-devtools/gcc/gcc-6.2.inc | 1 +
.../gcc/gcc-6.2/0054_all_nopie-all-flags.patch | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
create mode 100644 meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
diff --git a/meta/recipes-devtools/gcc/gcc-6.2.inc b/meta/recipes-devtools/gcc/gcc-6.2.inc
index b118995e1d..1a50d3a0d4 100644
--- a/meta/recipes-devtools/gcc/gcc-6.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-6.2.inc
@@ -78,6 +78,7 @@ SRC_URI = "\
file://0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
+ file://0054_all_nopie-all-flags.patch \
${BACKPORTS} \
"
BACKPORTS = ""
diff --git a/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch b/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
new file mode 100644
index 0000000000..0e103cb1ee
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
@@ -0,0 +1,17 @@
+We need to pass NO_PIE_CFLAGS to ALL_* so gcc doesn't fail when
+we compile it with older gcc and pie.
+
+--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200
++++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200
+@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
+ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
+
+ # This is the variable to use when using $(COMPILER).
+-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
+
+ # This is the variable to use when using $(LINKER).
+-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
+
+ # Build and host support libraries.
--
2.11.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [meta-oe][PATCH v2] gcc-6.2: Add fix for missing no-PIE flags
2017-02-12 20:20 [meta-oe][PATCH v2] gcc-6.2: Add fix for missing no-PIE flags Stephen Arnold
@ 2017-02-13 0:03 ` Khem Raj
0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2017-02-13 0:03 UTC (permalink / raw)
To: Stephen Arnold; +Cc: Patches and discussions about the oe-core layer
On Sun, Feb 12, 2017 at 12:20 PM, Stephen Arnold <sarnold@vctlabs.com> wrote:
> From: Stephen Arnold <stephen.arnold42@gmail.com>
>
> Fixes build on hardened PAX host with gcc-5 (linker error on relocs).
> Completes no-PIE config by adding to ALL_* flags variables.
> Borrowed from Gentoo gcc patches, tested on 2 hardened amd64 hosts.
>
> Upstream-Status: Inappropriate [configuration]
>
> Commited by: Gentoo Toolchain Project <toolchain@gentoo.org>
> Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com>
the patch is ok but please add this patch header to the gcc patch
itself not to OE patch. Secondly, gitify the patch on top of gcc-6
e.g.
https://github.com/kraj/gcc/tree/oe/gcc-6-branch
> ---
> meta/recipes-devtools/gcc/gcc-6.2.inc | 1 +
> .../gcc/gcc-6.2/0054_all_nopie-all-flags.patch | 17 +++++++++++++++++
> 2 files changed, 18 insertions(+)
> create mode 100644 meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-6.2.inc b/meta/recipes-devtools/gcc/gcc-6.2.inc
> index b118995e1d..1a50d3a0d4 100644
> --- a/meta/recipes-devtools/gcc/gcc-6.2.inc
> +++ b/meta/recipes-devtools/gcc/gcc-6.2.inc
> @@ -78,6 +78,7 @@ SRC_URI = "\
> file://0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
> file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
> file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
> + file://0054_all_nopie-all-flags.patch \
> ${BACKPORTS} \
> "
> BACKPORTS = ""
> diff --git a/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch b/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
> new file mode 100644
> index 0000000000..0e103cb1ee
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-6.2/0054_all_nopie-all-flags.patch
> @@ -0,0 +1,17 @@
> +We need to pass NO_PIE_CFLAGS to ALL_* so gcc doesn't fail when
> +we compile it with older gcc and pie.
> +
> +--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200
> ++++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200
> +@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
> + ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
> +
> + # This is the variable to use when using $(COMPILER).
> +-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
> ++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
> +
> + # This is the variable to use when using $(LINKER).
> +-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
> ++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
> +
> + # Build and host support libraries.
> --
> 2.11.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-13 0:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-12 20:20 [meta-oe][PATCH v2] gcc-6.2: Add fix for missing no-PIE flags Stephen Arnold
2017-02-13 0:03 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox