<div dir="ltr">Hi,<div>any comments on this commit?</div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 13, 2017 at 9:00 PM, Florin Sarbu <span dir="ltr">&lt;<a href="mailto:samentu1@gmail.com" target="_blank">samentu1@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Link libssp_nonshared.a only for ppc/musl because glibc already<br>
provides the content for libssp_nonshared in libc_nonshared.a and<br>
therefore we dont need to make it universal.<br>
<br>
(From OE-Core rev: c08247e3c7c004a40281d4010186a9<wbr>ace86e0e47)<br>
<br>
Signed-off-by: Florin Sarbu &lt;<a href="mailto:florin@resin.io">florin@resin.io</a>&gt;<br>
---<br>
 meta/recipes-devtools/gcc/gcc-<wbr>6.3.inc              |  2 +-<br>
 ...shared-to-link-commandline-<wbr>for-musl-targe.patch | 87 ++++++++++++++++++++++<br>
 .../gcc/gcc-6.3/0041-ssp_<wbr>nonshared.patch           | 28 -------<br>
 3 files changed, 88 insertions(+), 29 deletions(-)<br>
 create mode 100644 meta/recipes-devtools/gcc/gcc-<wbr>6.3/0041-Add-ssp_nonshared-to-<wbr>link-commandline-for-musl-<wbr>targe.patch<br>
 delete mode 100644 meta/recipes-devtools/gcc/gcc-<wbr>6.3/0041-ssp_nonshared.patch<br>
<br>
diff --git a/meta/recipes-devtools/gcc/<wbr>gcc-6.3.inc b/meta/recipes-devtools/gcc/<wbr>gcc-6.3.inc<br>
index d74f12c466..5c81a33af0 100644<br>
--- a/meta/recipes-devtools/gcc/<wbr>gcc-6.3.inc<br>
+++ b/meta/recipes-devtools/gcc/<wbr>gcc-6.3.inc<br>
@@ -71,7 +71,7 @@ SRC_URI = &quot;\<br>
            file://0038-Search-target-<wbr>sysroot-gcc-version-specific-<wbr>dirs-with.patch \<br>
            file://0039-Fix-various-_FOR_<wbr>BUILD-and-related-variables.<wbr>patch \<br>
            file://0040-nios2-Define-MUSL_<wbr>DYNAMIC_LINKER.patch \<br>
-           file://0041-ssp_nonshared.<wbr>patch \<br>
+           file://0041-Add-ssp_nonshared-<wbr>to-link-commandline-for-musl-<wbr>targe.patch \<br>
            file://0042-gcc-libcpp-<wbr>support-ffile-prefix-map-old-<wbr>new.patch \<br>
            file://0043-Reuse-fdebug-<wbr>prefix-map-to-replace-ffile-<wbr>prefix-map.patch \<br>
            file://0044-gcc-final.c-<wbr>fdebug-prefix-map-support-to-<wbr>remap-sourc.patch \<br>
diff --git a/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-Add-ssp_<wbr>nonshared-to-link-commandline-<wbr>for-musl-targe.patch b/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-Add-ssp_<wbr>nonshared-to-link-commandline-<wbr>for-musl-targe.patch<br>
new file mode 100644<br>
index 0000000000..29b7ce72d2<br>
--- /dev/null<br>
+++ b/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-Add-ssp_<wbr>nonshared-to-link-commandline-<wbr>for-musl-targe.patch<br>
@@ -0,0 +1,87 @@<br>
+From 210f6b3b82084cc756e02b8bc12f90<wbr>9a43b14ee8 Mon Sep 17 00:00:00 2001<br>
+From: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>
+Date: Tue, 27 Jun 2017 18:10:54 -0700<br>
+Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets<br>
+<br>
+when -fstack-protector options are enabled we need to<br>
+link with ssp_shared on musl since it does not provide<br>
+the __stack_chk_fail_local() so essentially it provides<br>
+libssp but not libssp_nonshared something like<br>
+TARGET_LIBC_PROVIDES_SSP_BUT_<wbr>NOT_SSP_NONSHARED<br>
+ where-as for glibc the needed symbols<br>
+are already present in libc_nonshared library therefore<br>
+we do not need any library helper on glibc based systems<br>
+but musl needs the libssp_noshared from gcc<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>
+---<br>
+ gcc/config/linux.h          |  7 +++++++<br>
+ gcc/config/rs6000/linux.h   | 10 ++++++++++<br>
+ gcc/config/rs6000/linux64.h | 10 ++++++++++<br>
+ 3 files changed, 27 insertions(+)<br>
+<br>
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h<br>
+index 2e683d0c430..1b4df798671 100644<br>
+--- a/gcc/config/linux.h<br>
++++ b/gcc/config/linux.h<br>
+@@ -182,6 +182,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see<br>
+     { GCC_INCLUDE_DIR, &quot;GCC&quot;, 0, 1, 0, 0 },           \<br>
+     { 0, 0, 0, 0, 0, 0 }                              \<br>
+   }<br>
++#ifdef TARGET_LIBC_PROVIDES_SSP<br>
++#undef LINK_SSP_SPEC<br>
++#define LINK_SSP_SPEC &quot;%{fstack-protector|fstack-<wbr>protector-all&quot; \<br>
++                     &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit&quot; \<br>
++                     &quot;:-lssp_nonshared}&quot;<br>
++#endif<br>
++<br>
+ #endif<br>
+<br>
+ #if (DEFAULT_LIBC == LIBC_UCLIBC) &amp;&amp; defined (SINGLE_LIBC) /* uClinux */<br>
+diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h<br>
+index 684afd6c190..22cfa391b89 100644<br>
+--- a/gcc/config/rs6000/linux.h<br>
++++ b/gcc/config/rs6000/linux.h<br>
+@@ -91,6 +91,16 @@<br>
+                                        &quot; -m elf32ppclinux&quot;)<br>
+ #endif<br>
+<br>
++/* link libssp_nonshared.a with musl */<br>
++#if DEFAULT_LIBC == LIBC_MUSL<br>
++#ifdef TARGET_LIBC_PROVIDES_SSP<br>
++#undef LINK_SSP_SPEC<br>
++#define LINK_SSP_SPEC &quot;%{fstack-protector|fstack-<wbr>protector-all&quot; \<br>
++                     &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit&quot; \<br>
++                     &quot;:-lssp_nonshared}&quot;<br>
++#endif<br>
++#endif<br>
++<br>
+ #undef LINK_OS_LINUX_SPEC<br>
+ #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL &quot; %{!shared: %{!static: \<br>
+   %{rdynamic:-export-dynamic} \<br>
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h<br>
+index 3b00ec0fcf0..8371f8d7b6b 100644<br>
+--- a/gcc/config/rs6000/linux64.h<br>
++++ b/gcc/config/rs6000/linux64.h<br>
+@@ -465,6 +465,16 @@ extern int dot_symbols;<br>
+                                          &quot; -m elf64ppc&quot;)<br>
+ #endif<br>
+<br>
++/* link libssp_nonshared.a with musl */<br>
++#if DEFAULT_LIBC == LIBC_MUSL<br>
++#ifdef TARGET_LIBC_PROVIDES_SSP<br>
++#undef LINK_SSP_SPEC<br>
++#define LINK_SSP_SPEC &quot;%{fstack-protector|fstack-<wbr>protector-all&quot; \<br>
++                     &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit&quot; \<br>
++                     &quot;:-lssp_nonshared}&quot;<br>
++#endif<br>
++#endif<br>
++<br>
+ #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 &quot; %{!shared: %{!static: \<br>
+   %{rdynamic:-export-dynamic} \<br>
+   -dynamic-linker &quot; GNU_USER_DYNAMIC_LINKER32 &quot;}} \<br>
+--<br>
+2.13.2<br>
+<br>
diff --git a/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-ssp_nonshared.<wbr>patch b/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-ssp_nonshared.<wbr>patch<br>
deleted file mode 100644<br>
index 0744529741..0000000000<br>
--- a/meta/recipes-devtools/gcc/<wbr>gcc-6.3/0041-ssp_nonshared.<wbr>patch<br>
+++ /dev/null<br>
@@ -1,28 +0,0 @@<br>
-From 551a5db7acb56e085a101f1c222d51<wbr>b2c1b039a4 Mon Sep 17 00:00:00 2001<br>
-From: Szabolcs Nagy &lt;<a href="mailto:nsz@port70.net">nsz@port70.net</a>&gt;<br>
-Date: Sat, 7 Nov 2015 14:58:40 +0000<br>
-Subject: [PATCH 41/46] ssp_nonshared<br>
-<br>
----<br>
-Upstream-Status: Inappropriate [OE Configuration]<br>
-<br>
- gcc/gcc.c | 3 ++-<br>
- 1 file changed, 2 insertions(+), 1 deletion(-)<br>
-<br>
-diff --git a/gcc/gcc.c b/gcc/gcc.c<br>
-index 2812819..9de96ee 100644<br>
---- a/gcc/gcc.c<br>
-+++ b/gcc/gcc.c<br>
-@@ -863,7 +863,8 @@ proper position among the other output files.  */<br>
- #ifndef LINK_SSP_SPEC<br>
- #ifdef TARGET_LIBC_PROVIDES_SSP<br>
- #define LINK_SSP_SPEC &quot;%{fstack-protector|fstack-<wbr>protector-all&quot; \<br>
--                     &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit:}&quot;<br>
-+                     &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit&quot; \<br>
-+                     &quot;:-lssp_nonshared}&quot;<br>
- #else<br>
- #define LINK_SSP_SPEC &quot;%{fstack-protector|fstack-<wbr>protector-all&quot; \<br>
-                      &quot;|fstack-protector-strong|<wbr>fstack-protector-explicit&quot; \<br>
---<br>
-2.8.2<br>
-<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.6<br>
<br>
</font></span></blockquote></div><br></div>