[gnome-continuous-yocto/gnomeostree-3.28-rocko: 6141/8267] distutils-base.bbclass: Do not use -pie with hardening



commit 0d1418026b378389a1668761d6429a94e6c047f8
Author: Khem Raj <raj khem gmail com>
Date:   Fri Jun 2 09:01:50 2017 -0700

    distutils-base.bbclass: Do not use -pie with hardening
    
    Fix build when PIE is turned on. It tries to build
    .so file using -pie and -shared flags together because
    its doing compile and link in same step CFLAGS and LDFLAGS
    are combined and does not work, ending in errors e.g.
    
    | 
/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/python-pygpgme/0.3-r0/recipe-sysroot/usr/l
    ib/Scrt1.o: In function `_start_c':
    | /usr/src/debug/musl/1.1.16+gitAUTOINC+179766aa2e-r0/git/crt/crt1.c:17: undefined reference to `main'
    | collect2: error: ld returned 1 exit status
    
    This error while cryptic is due to the fact that we are
    building a shared library but also pass -pie flag to the link
    step after specify LDHSARED ( which is -shared linker flags )
    
    we can not use -pie when doing shared libs. This is true for all the python
    modules inheriting setup tools
    
    Disable the pie flags thusly for all modules using setuptools since
    this setting is done in setuptools makefiles which are then used
    during module compiles
    
    (From OE-Core rev: 4b5d55228ed2565570d0e93cfea4efa8cbb789ea)
    
    Signed-off-by: Khem Raj <raj khem gmail com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/classes/distutils-base.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass
index 9f398d7..d6137c4 100644
--- a/meta/classes/distutils-base.bbclass
+++ b/meta/classes/distutils-base.bbclass
@@ -2,3 +2,5 @@ DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') =
 RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
 
 inherit distutils-common-base pythonnative
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]