glibc: Enable static PIE support

Message ID 20180228204607.16416-1-raj.khem@gmail.com
State New
Headers show
Series
  • glibc: Enable static PIE support
Related show

Commit Message

Khem Raj Feb. 28, 2018, 8:46 p.m.
go programs when compiled with PIE fails otherwise on aarch64

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 meta/recipes-core/glibc/glibc_2.27.bb | 1 +
 1 file changed, 1 insertion(+)

-- 
2.16.2

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Ross Burton March 1, 2018, 8:35 a.m. | #1
Would this be the cause of glibc failing to build like this on PPC?

|
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc/build/build/tmp/work/ppc7400-poky-linux/glibc/2.27-r0/recipe-sysroot-native/usr/bin/powerpc-poky-linux.gcc-cross-initial-powerpc/../../libexec/powerpc-poky-linux.gcc-cross-initial-powerpc/gcc/powerpc-poky-linux/7.3.0/ld:
read-only segment has dynamic relocations.

The previous glibc run was all green, added this patch and it fails.

Ross

On 28 February 2018 at 20:46, Khem Raj <raj.khem@gmail.com> wrote:

> go programs when compiled with PIE fails otherwise on aarch64

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  meta/recipes-core/glibc/glibc_2.27.bb | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/meta/recipes-core/glibc/glibc_2.27.bb

> b/meta/recipes-core/glibc/glibc_2.27.bb

> index e9d4117a47..62db3e9d02 100644

> --- a/meta/recipes-core/glibc/glibc_2.27.bb

> +++ b/meta/recipes-core/glibc/glibc_2.27.bb

> @@ -81,6 +81,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \

>                  --enable-bind-now \

>                  --enable-stack-protector=strong \

>                  --enable-stackguard-randomization \

> +                --enable-static-pie \

>                  ${GLIBC_EXTRA_OECONF}"

>

>  EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"

> --

> 2.16.2

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<div dir="ltr">Would this be the cause of glibc failing to build like this on PPC?<br><br>| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc/build/build/tmp/work/ppc7400-poky-linux/glibc/2.27-r0/recipe-sysroot-native/usr/bin/powerpc-poky-linux.gcc-cross-initial-powerpc/../../libexec/powerpc-poky-linux.gcc-cross-initial-powerpc/gcc/powerpc-poky-linux/7.3.0/ld: read-only segment has dynamic relocations.<div><br></div><div>The previous glibc run was all green, added this patch and it fails.</div><div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 February 2018 at 20:46, Khem Raj <span dir="ltr">&lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@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">go programs when compiled with PIE fails otherwise on aarch64<br>
<br>
Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>

---<br>
 meta/recipes-core/glibc/<a href="http://glibc_2.27.bb" rel="noreferrer" target="_blank">glibc_<wbr>2.27.bb</a> | 1 +<br>
 1 file changed, 1 insertion(+)<br>
<br>
diff --git a/meta/recipes-core/glibc/<a href="http://glibc_2.27.bb" rel="noreferrer" target="_blank">glib<wbr>c_2.27.bb</a> b/meta/recipes-core/glibc/<a href="http://glibc_2.27.bb" rel="noreferrer" target="_blank">glib<wbr>c_2.27.bb</a><br>
index e9d4117a47..62db3e9d02 100644<br>
--- a/meta/recipes-core/glibc/<a href="http://glibc_2.27.bb" rel="noreferrer" target="_blank">glib<wbr>c_2.27.bb</a><br>
+++ b/meta/recipes-core/glibc/<a href="http://glibc_2.27.bb" rel="noreferrer" target="_blank">glib<wbr>c_2.27.bb</a><br>
@@ -81,6 +81,7 @@ EXTRA_OECONF = &quot;--enable-kernel=${OLDEST_<wbr>KERNEL} \<br>
                 --enable-bind-now \<br>
                 --enable-stack-protector=<wbr>strong \<br>
                 --enable-stackguard-<wbr>randomization \<br>
+                --enable-static-pie \<br>
                 ${GLIBC_EXTRA_OECONF}&quot;<br>
<br>
 EXTRA_OECONF += &quot;${@get_libc_fpu_setting(bb, d)}&quot;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.16.2<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj March 1, 2018, 9:56 a.m. | #2
On Thu, Mar 1, 2018 at 12:35 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Would this be the cause of glibc failing to build like this on PPC?

>

> |

> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc/build/build/tmp/work/ppc7400-poky-linux/glibc/2.27-r0/recipe-sysroot-native/usr/bin/powerpc-poky-linux.gcc-cross-initial-powerpc/../../libexec/powerpc-poky-linux.gcc-cross-initial-powerpc/gcc/powerpc-poky-linux/7.3.0/ld:

> read-only segment has dynamic relocations.

>


yes, I think we need to enable this option only for x86/x86_64/aarch64
since they alone support static PIE and may be we should limit this
to only with security_flags are enabled.

> The previous glibc run was all green, added this patch and it fails.

>

> Ross

>

> On 28 February 2018 at 20:46, Khem Raj <raj.khem@gmail.com> wrote:

>>

>> go programs when compiled with PIE fails otherwise on aarch64

>>

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> ---

>>  meta/recipes-core/glibc/glibc_2.27.bb | 1 +

>>  1 file changed, 1 insertion(+)

>>

>> diff --git a/meta/recipes-core/glibc/glibc_2.27.bb

>> b/meta/recipes-core/glibc/glibc_2.27.bb

>> index e9d4117a47..62db3e9d02 100644

>> --- a/meta/recipes-core/glibc/glibc_2.27.bb

>> +++ b/meta/recipes-core/glibc/glibc_2.27.bb

>> @@ -81,6 +81,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \

>>                  --enable-bind-now \

>>                  --enable-stack-protector=strong \

>>                  --enable-stackguard-randomization \

>> +                --enable-static-pie \

>>                  ${GLIBC_EXTRA_OECONF}"

>>

>>  EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"

>> --

>> 2.16.2

>>

>> --

>> _______________________________________________

>> Openembedded-core mailing list

>> Openembedded-core@lists.openembedded.org

>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>

>

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-core/glibc/glibc_2.27.bb b/meta/recipes-core/glibc/glibc_2.27.bb
index e9d4117a47..62db3e9d02 100644
--- a/meta/recipes-core/glibc/glibc_2.27.bb
+++ b/meta/recipes-core/glibc/glibc_2.27.bb
@@ -81,6 +81,7 @@  EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
                 --enable-bind-now \
                 --enable-stack-protector=strong \
                 --enable-stackguard-randomization \
+                --enable-static-pie \
                 ${GLIBC_EXTRA_OECONF}"
 
 EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"