Commit Graph

9 Commits

Author SHA1 Message Date
Khem Raj 7a04ee8941 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

Backport notes:
In master, this commit is reverted in master in favor of using GCCPIE =
"--enable-default-pie" in security_flags.inc. However, backporting that change
introduces many merge conflicts and will be a serious maintenance issue, so I
think it's safest to just backport this small change, which fixes build failures
in python-cffi and likely other recipes.

For completeness, this is the list of commits in OE-core master that will
supersede this change:

- 1c7e195c94764d680a12a49b870f04cd58860f81
  "gcc: Introduce a knob to configure gcc to default to PIE"
- e93765ffb5718b0fce84f0b8123963176dea95e4
  "security_flags.inc: Delete pinnings for SECURITY_NO_PIE_CFLAGS"
- fcfe6d4ab4460f8358e13023022a5e909941ca93
  distutils,setuptools: Delete use of SECURITY_NO_PIE_CFLAGS

(From OE-Core rev: 739c69e8eb464d184ef652e7e7a4d4b234a5b5f9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:11:58 +00:00
Stefan Müller-Klieser d5b602c254 distutils-common-base.bbclass: remove EXTRA_OEMAKE workaround
The default of EXTRA_OEMAKE is already empty since commit:

OE-Core rev: aeb653861a0ec39ea7a014c0622980edcbf653fa
bitbake.conf: Remove unhelpful default value for EXTRA_OEMAKE

(From OE-Core rev: 641ab36095eb72898ec808e655014bbc5900eb95)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 09:58:40 +01:00
Alexander Kanavin 03da683a55 python3-dir.bbclass: add a separate class for Python 3
This is much cleaner than sharing python-dir.bbclass between python 2
and 3 classes, and doing confusing overrides in them.

(From OE-Core rev: 3891fcec863602a0ae6d0f3d305ea50a79a205d9)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Andreas Müller 9dea876e09 distutils-common-base: do not set PACKAGES - use defaults from bitbake.conf
it took me a while to understand why PACKAGE_BEFORE_PN did not work...

(From OE-Core rev: 50f0a2a041df679f06c0b93a0472905e8c129bd4)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:32:00 +00:00
Richard Purdie e0890b662e meta: Drop now pointless manual -dbg packaging
With the autodebug package generation logic, specifically setting FILES_${PN}-dbg
isn't needed in most cases, we can remove them.

(From OE-Core rev: 3ab59d49dd7c18e194b58d1248b4b87709b5a738)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-16 11:56:30 +00:00
Joshua Lock 5f0dfecd53 distutils-common-base: add to, don't set, FILES_${PN}
If we set FILES_${PN} and a recipe inherits other classes that
modify FILES_${PN} *before* distutils-common-base is included, any
changes to FILES_${PN} made by those classes are lost.

Instead, append the additional directories we want to include in
FILES_${PN}

(From OE-Core rev: f6478e8c73f9cfb79d1f7680b7bf3ff957eb51cb)

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:39 +01:00
Stefan Herbrechtsmeier 6809295d2f distutils-common-base: Create staticdev pacakge for static libraries
(From OE-Core rev: 0c4c3ebfedd06b2b8f36747bc0c0d986f05420cf)

Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-21 16:56:00 +00:00
Koen Kooi 6f31e13e81 distutils(-common-base) bbclass: sync with OE
When using python recipes imported from OE (e.g. python-cheetah) parsing only succeeds when python has already been built due to the PYTHON_DIR references.

This commit syncs the classes with OE to make it work, but keeps the *.pyo removal from yocto.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-01-20 21:37:00 +00:00
Richard Purdie 288e62a221 distutils: Sync with OE.dev
Signed-off-by: Richard Purdie <richard@rex.(none)>
2009-12-05 23:18:02 +00:00