From ff9b701489c4a1ea4ff36232d2d7c09905808d6d Mon Sep 17 00:00:00 2001 From: Antonio Gomes Date: Tue, 23 Sep 2014 18:51:11 -0400 Subject: [PATCH] [Tizen][dev] Fix TV build TV profile builds with "legacy" Tizen 2.2.1 packages. Patch adapts our build so mobile (now with Tizen 2.3) and TV profiles able to co-exist. Additionally, since common trunk switched to m39-based chromium sourcebase, ld step fails with "memory exhausted" error (bug 6629) and cpio fails to create dev packages off of the 2.1Gb libchromium-efl.so (bug 6457). In order to unblock developers, patch extends the solution used in debug builds already: set 'no-keep-memory' linker option. Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=5676 Change-Id: I56108fe50abb7296c0fc27be7bd055fa237c84ca Signed-off-by: Antonio Gomes --- tizen_src/build/build_mobile.sh | 5 ++++- tizen_src/build/build_tv.sh | 11 +++++++---- .../browser/device_sensors/data_fetcher_impl_tizen.h | 6 +++++- tizen_src/impl/browser/motion/MotionUI.h | 7 ++++++- tizen_src/impl/chromium-efl.gypi | 13 +++++++++++++ tizen_src/impl/common/version_info.cc | 6 ++++-- tizen_src/packaging/chromium-efl.spec | 18 ++++++++++++------ 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/tizen_src/build/build_mobile.sh b/tizen_src/build/build_mobile.sh index bc4f54b..af91540 100755 --- a/tizen_src/build/build_mobile.sh +++ b/tizen_src/build/build_mobile.sh @@ -7,11 +7,14 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P) ${SCRIPTDIR}/apply_patches.sh +TIZEN_VERSION="chromium_efl_tizen_version 2.3" + if [ ! -f "$HOME/.gbs.conf" ]; then CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf" PROFILE_FLAG="-P tizenmb_v2.3" fi -gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental "$@" +gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \ + --define "${TIZEN_VERSION}" "$@" ${SCRIPTDIR}/apply_patches.sh -r diff --git a/tizen_src/build/build_tv.sh b/tizen_src/build/build_tv.sh index 822f89a..f6daf6a 100755 --- a/tizen_src/build/build_tv.sh +++ b/tizen_src/build/build_tv.sh @@ -7,11 +7,14 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P) ${SCRIPTDIR}/apply_patches.sh -GBS_CONF=$HOME/.gbs.conf -if [ ! -f $GBS_CONF ]; then - GBS_CONF=${SCRIPTDIR}/gbs.conf +TIZEN_VERSION="chromium_efl_tizen_version 2.2.1" + +if [ ! -f "$HOME/.gbs.conf" ]; then + CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf" + PROFILE_FLAG="-P tizentv_product" fi -gbs --conf $GBS_CONF build -P tizentv_product -A armv7l --incremental "$@" +gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \ + --define "${TIZEN_VERSION}" "$@" ${SCRIPTDIR}/apply_patches.sh -r diff --git a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h index cc6602d..ba44ae8 100644 --- a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h +++ b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h @@ -20,7 +20,11 @@ #ifndef DATA_FETCHER_IMPL_TIZEN_H_ #define DATA_FETCHER_IMPL_TIZEN_H_ -#include +#ifndef TIZEN_LEGACY_V_2_2_1 +#include +#else +#include +#endif #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" diff --git a/tizen_src/impl/browser/motion/MotionUI.h b/tizen_src/impl/browser/motion/MotionUI.h index 4bc00ea..a6f5bc4 100755 --- a/tizen_src/impl/browser/motion/MotionUI.h +++ b/tizen_src/impl/browser/motion/MotionUI.h @@ -22,7 +22,12 @@ #include #include -#include +#ifndef TIZEN_LEGACY_V_2_2_1 +#include +#else +#include +#endif + class MotionUI { public: diff --git a/tizen_src/impl/chromium-efl.gypi b/tizen_src/impl/chromium-efl.gypi index 14fbcbe..1f274cc 100644 --- a/tizen_src/impl/chromium-efl.gypi +++ b/tizen_src/impl/chromium-efl.gypi @@ -7,6 +7,7 @@ 'clang': 0, }], ], + 'chromium_efl_tizen_version%': '2.3', }, 'target_defaults': { 'defines': [ @@ -41,6 +42,18 @@ # Non-arm builds will ingore it in any case. '__ARM_PCS', ], + 'conditions': [ + ['chromium_efl_tizen_version=="2.3"', { + 'defines': [ + 'TIZEN_V_2_3=1', + ], + }], + ['chromium_efl_tizen_version=="2.2.1"', { + 'defines': [ + 'TIZEN_LEGACY_V_2_2_1=1', + ], + }], + ], 'sources/': [ ['exclude', 'browser/device_sensors/data_fetcher_shared_memory_default.cc$'], ], diff --git a/tizen_src/impl/common/version_info.cc b/tizen_src/impl/common/version_info.cc index a4ed21a..dd6eab3 100644 --- a/tizen_src/impl/common/version_info.cc +++ b/tizen_src/impl/common/version_info.cc @@ -15,10 +15,12 @@ #include "common/version_info.h" #if defined(OS_TIZEN) -#include "system_info.h" +#ifndef TIZEN_LEGACY_V_2_2_1 #include "system_info_internal.h" +#else +#include "system_info.h" +#endif #endif - #include "common/version_info_efl.h" namespace EflWebView { diff --git a/tizen_src/packaging/chromium-efl.spec b/tizen_src/packaging/chromium-efl.spec index eeaaeca..2d54aef 100755 --- a/tizen_src/packaging/chromium-efl.spec +++ b/tizen_src/packaging/chromium-efl.spec @@ -161,16 +161,19 @@ export LD_RUN_PATH=%{_libdir} #set build mode %if 0%{?_debug_mode} %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Debug - # Building the RPM in the GBS chroot fails with errors such as - # /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld: - # failed to set dynamic section sizes: Memory exhausted - # For now, work around it by passing a GNU ld-specific flag that optimizes the - # linker for memory usage. - export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" %else %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Release %endif +# Building the RPM in the GBS chroot fails with errors such as +# /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld: +# failed to set dynamic section sizes: Memory exhausted +# For now, work around it by passing a GNU ld-specific flag that optimizes the +# linker for memory usage. See bugs: +# - http://107.108.218.239/bugzilla/show_bug.cgi?id=6457 +# - http://107.108.218.239/bugzilla/show_bug.cgi?id=6629 +export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" + if type ccache &> /dev/null; then source build/ccache_env.sh %{OUTPUT_BUILD_PROFILE_TARGET} fi @@ -185,6 +188,9 @@ fi %if 0%{?_remove_webcore_debug_symbols:1} -Dremove_webcore_debug_symbols=1 \ %endif +%if 0%{?chromium_efl_tizen_version:1} + -Dchromium_efl_tizen_version=%{chromium_efl_tizen_version} \ +%endif -Dwebdb_dir="%{CHROMIUM_WEBDB_DIR}"/data/db \ -Dbuilding_for_tizen_"%{OUTPUT_BUILD_PROFILE_TARGET}"=1 %endif -- 2.7.4