glibc: Enable static PIE support

Submitted by Khem Raj on Feb. 28, 2018, 8:46 p.m. | Patch ID: 148488

Details

Message ID 20180228204607.16416-1-raj.khem@gmail.com
State New
Headers 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(+)

Patch hide | download patch | download mbox

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)}"

Comments

Ross Burton March 1, 2018, 8:35 a.m.
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
>
Khem Raj March 1, 2018, 9:56 a.m.
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
>
>