]> code.ossystems Code Review - openembedded-core.git/commitdiff
python3-native: Avoid use of getentropy/getrandom
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Aug 2017 13:00:21 +0000 (14:00 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Aug 2017 23:01:45 +0000 (00:01 +0100)
getentropy/random() is only available in glibc 2.25+ and uninative may relocate
binaries onto systems that don't have this function. For now, force the code to
the older codepaths until we can come up with a better solution for this kind of
issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3-native_3.5.3.bb

index 3467d29d4ef348f86a7183af63690cf48d919e49..db0e7b9bd8ee914acf542dc710133e8bfa485f83 100644 (file)
@@ -44,7 +44,8 @@ inherit native
 
 require python-native-${PYTHON_MAJMIN}-manifest.inc
 
-EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+# uninative may be used on pre glibc 2.25 systems which don't have getentropy
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip ac_cv_func_getentropy=no"
 
 EXTRA_OEMAKE = '\
   LIBC="" \
@@ -59,6 +60,7 @@ PYTHONLSBOPTS = ""
 
 do_configure_append() {
        autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+       sed -i -e 's,#define HAVE_GETRANDOM 1,/\* #undef HAVE_GETRANDOM \*/,' ${B}/pyconfig.h
 }
 
 do_install() {