[PossiblyDoNotCarryForward] [Tizen] Make it possible to run libchromium-efl.so with...
authorAntonio Gomes <a1.gomes@samsung.com>
Tue, 23 Dec 2014 22:34:59 +0000 (14:34 -0800)
committerJongsoo Yoon <join.yoon@samsung.com>
Fri, 20 Nov 2015 13:34:09 +0000 (22:34 +0900)
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>
src/base/cpu.cc

index 692494a..c298d57 100644 (file)
@@ -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.