Skip to contentSkip to conversation

krb5: Add -fPIC to compile flags

PATCH In review Khem Raj 2 participants 3 messages Nov 3, 2016

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 krb5: Add -fPIC to compile flags

Fixes errors on x86_64 e.g.
errors.so: relocation R_X86_64_PC32 against symbol `k5_vset_error' can not be used when making a shared object; recompile with -fPIC

---
 meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb +2 -2
index e2d0594..06f7f90 100644
@@ -51,8 +51,8 @@ CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regc
                   ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
                   ac_cv_file__etc_TIMEZONE=no"
 
-CFLAGS_append = " -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
-LDFLAGS_append = " -lpthread"
+CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
+LDFLAGS_append = " -pthread"
 
 FILES_${PN} += "${datadir}/gnats"
 FILES_${PN}-doc += "${datadir}/examples"
Signature · 1 line
2.10.2
author
#1 lore raw

PATCH 2/2 Disable PIE for libvdpau

---
 meta-oe/conf/distro/include/meta_oe_security_flags.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta-oe/conf/distro/include/meta_oe_security_flags.inc +5 -0
index 2559948..e57cc5b 100644
@@ -12,3 +12,8 @@ SECURITY_CFLAGS_pn-cpufrequtils = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-libcec = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-libmodplug = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-libcdio = "${SECURITY_NO_PIE_CFLAGS}"
+
+#| /mnt/b/build/tmp-glibc/sysroots/intel-corei7-64/usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
+#| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:86: undefined reference to `__init_array_start'
+
+SECURITY_CFLAGS_pn-libvdpau = "${SECURITY_NO_PIE_CFLAGS}"
Signature · 1 line
2.10.2
#2 lore raw
In reply to Khem Raj
Quoted 20 lines · Khem Raj

Fixes errors on x86_64 e.g.
errors.so: relocation R_X86_64_PC32 against symbol `k5_vset_error' can not be used when making a shared object; recompile with -fPIC

---
 meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
meta- renamed from meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb +0 -0

oe/recipes-connectivity/krb5/krb5_1.13.6.bb
index e2d0594..06f7f90 100644

meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb +0 -0
@@ -51,8 +51,8 @@ CACHED_CONFIGUREVARS +=

"krb5_cv_attr_constructor_destructor=yes ac_cv_func_regc ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
                   ac_cv_file__etc_TIMEZONE=no"

meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regc · line 55

Quoted 4 lines
meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb +2 -2
-CFLAGS_append = " -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
-LDFLAGS_append = " -lpthread"
+CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
+LDFLAGS_append = " -pthread"

Hm, it would be useful to add -pthread to CFLAGS as well in this case. That flag is doing more than just adding the library to the linker command line, see gcc -dumpspecs

Cheers,
Andre'

Quoted 6 lines


 FILES_${PN} += "${datadir}/gnats"
 FILES_${PN}-doc += "${datadir}/examples"
--
2.10.2