summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gomes <a1.gomes@samsung.com>2014-12-23 14:34:59 -0800
committerJongsoo Yoon <join.yoon@samsung.com>2015-11-20 22:34:09 +0900
commitf5b1b03adae094cd108d43143d0d12fc3888d84d (patch)
treed449b82cdcbd734ab53cb7cc5ee6ba663151ac7e
parent971fca052e66e678708a89a5c4b845489c0666d9 (diff)
downloadv8-f5b1b03adae094cd108d43143d0d12fc3888d84d.tar.gz
v8-f5b1b03adae094cd108d43143d0d12fc3888d84d.tar.bz2
v8-f5b1b03adae094cd108d43143d0d12fc3888d84d.zip
[PossiblyDoNotCarryForward] [Tizen] Make it possible to run libchromium-efl.so with glibc 2.13
Chromium.org requires GCC 4.8 (or new enough Clang) to build latest sourcebase. Because of that, the default compiler version available in the latest development toolchain was overridden by prebuilt GCC 4.8 and compatible packages, including glibc 2.18 (from TV toolchain). On our mobile target (currently Tizen 2.3), we have available gblic 2.13, which contains some backward incompatible symbols in comparison to glibc 2.18. To fix that, we deploy a newer glibc in a custom location. This patch gets rid of the need of this custom glibc deployment, by not using the glibc 2.16 (or higher) symbol named getauxval, from <sys/auxv.h>. We fallback to the fallback implementation based on /proc/self/auxv analyzes. The following runtime error is fixed: (/lib/libc.so.6: version `GLIBC_2.16' not found (required by /usr/lib/libchromium-efl.so)). Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=9995 Reviewed by: Laszlo Gombos, Viatcheslav Ostapenko, SeungSeop Park Change-Id: I56d21f3559a8b4bd3943fc262ec19df0e9b1e26e Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
-rw-r--r--src/base/cpu.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/base/cpu.cc b/src/base/cpu.cc
index 692494afc..c298d5709 100644
--- a/src/base/cpu.cc
+++ b/src/base/cpu.cc
@@ -10,7 +10,7 @@
#if V8_OS_LINUX
#include <linux/auxvec.h> // AT_HWCAP
#endif
-#if V8_GLIBC_PREREQ(2, 16)
+#if V8_GLIBC_PREREQ(2, 16) && !defined(OS_TIZEN_MOBILE)
#include <sys/auxv.h> // getauxval()
#endif
#if V8_OS_QNX
@@ -110,7 +110,23 @@ static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
static uint32_t ReadELFHWCaps() {
uint32_t result = 0;
-#if V8_GLIBC_PREREQ(2, 16)
+
+ // The latest Tizen mobile development toolchains come with
+ // GCC 4.6.3 and glibc 2.13 available by default. These are also what
+ // is default available on the latest Tizen mobile targets (namely
+ // Tizen 2.3 and 2.4).
+ // In order to build chromium-efl, which requires at least GCC 4.8,
+ // we overrode the toolchain's GCC packages with pre-built GCC 4.8
+ // packages from the TV toolchain, including glibc 2.18 packages.
+ // So at build time, the condition below evaluates to 'true' and
+ // chromium-efl tied itself up against a glibc version >= than 2.16.
+ //
+ // glibc 2.13 (available on target) and 2.18 (available on the toolchain)
+ // are backward compatible apart from some symbols, including
+ // getauxval (below). In order to avoid runtime dependencies
+ // on glibc symbols not compatible with glibc 2.13, we fallback
+ // to the equivalent non-glibc2.16 implementation.
+#if V8_GLIBC_PREREQ(2, 16) && !defined(OS_TIZEN_MOBILE)
result = static_cast<uint32_t>(getauxval(AT_HWCAP));
#else
// Read the ELF HWCAP flags by parsing /proc/self/auxv.