[packages/chromium-browser] - build nacl with crossnacl toolchain

draenog draenog at pld-linux.org
Sun Jul 8 00:50:31 CEST 2012


commit 5997e180a0b7f0af188fe49a474e002c684177d1
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Jul 7 10:08:53 2012 +0000

    - build nacl with crossnacl toolchain
    
    Changed files:
        chromium-browser.spec -> 1.214
        nacl-build-irt.patch -> 1.1
        nacl-linkingfix.patch -> 1.1

 chromium-browser.spec | 43 +++++++++++++++++++++++++++++++++++++++----
 nacl-build-irt.patch  | 40 ++++++++++++++++++++++++++++++++++++++++
 nacl-linkingfix.patch | 20 ++++++++++++++++++++
 3 files changed, 99 insertions(+), 4 deletions(-)
---
diff --git a/chromium-browser.spec b/chromium-browser.spec
index e6b8012..501db8d 100644
--- a/chromium-browser.spec
+++ b/chromium-browser.spec
@@ -7,7 +7,7 @@
 %bcond_without	cups			# with cups
 %bcond_without	gconf			# with GConf
 %bcond_without	pulseaudio		# with pulseaudio
-%bcond_with		nacl			# build Native Client support
+%bcond_without	nacl			# build Native Client support
 %bcond_without	sandboxing		# with sandboxing
 %bcond_with		selinux			# with SELinux (need policy first)
 %bcond_with		shared_libs		# with shared libs
@@ -21,7 +21,7 @@
 %bcond_without	system_vpx		# with system vpx
 %bcond_without	system_yasm		# with system yasm
 %bcond_without	system_zlib		# with system zlib
-%bcond_without	libjpegturbo		# use libjpeg-turbo features
+%bcond_without	libjpegturbo	# use libjpeg-turbo features
 %bcond_with		verbose			# verbose build (V=1)
 
 # TODO
@@ -52,7 +52,7 @@
 Summary:	A WebKit powered web browser
 Name:		chromium-browser
 Version:	20.0.1132.47
-Release:	1
+Release:	2
 License:	BSD, LGPL v2+ (ffmpeg)
 Group:		X11/Applications/Networking
 Source0:	http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}-%{version}.tar.xz
@@ -80,6 +80,8 @@ Patch11:	chromium-revert-jpeg-swizzle-r2.patch
 Patch12:	tcmalloc.patch
 Patch13:	%{name}-c++.patch
 Patch14:	chromium-alignment-r0.patch
+Patch15:	nacl-build-irt.patch
+Patch16:	nacl-linkingfix.patch
 URL:		http://www.chromium.org/Home
 %{?with_gconf:BuildRequires:	GConf2-devel}
 BuildRequires:	OpenGL-GLU-devel
@@ -87,6 +89,10 @@ BuildRequires:	alsa-lib-devel
 BuildRequires:	atk-devel
 BuildRequires:	bison
 BuildRequires:	bzip2-devel
+%{?with_nacl:BuildRequires:	crossnacl-binutils >= 2.20.1}
+%{?with_nacl:BuildRequires:	crossnacl-gcc >= 4.4.3}
+%{?with_nacl:BuildRequires:	crossnacl-gcc-c++ >= 4.4.3}
+%{?with_nacl:BuildRequires:	crossnacl-newlib >= 1.18.0}
 %{?with_cups:BuildRequires:	cups-devel}
 BuildRequires:	dbus-glib-devel
 BuildRequires:	expat-devel
@@ -112,7 +118,6 @@ BuildRequires:	libxml2-devel
 BuildRequires:	libxslt-devel
 BuildRequires:	lzma
 BuildRequires:	minizip-devel
-%{?with_nacl:BuildRequires:	nacl-toolchain-newlib >= 0.6941}
 BuildRequires:	nspr-devel
 BuildRequires:	nss-devel >= 1:3.12.3
 BuildRequires:	pam-devel
@@ -226,6 +231,8 @@ cd src
 %patch12 -p0
 %patch13 -p0
 %patch14 -p0
+%patch15 -p1
+%patch16 -p1
 cd ..
 
 cd src
@@ -233,6 +240,34 @@ sh -x clean-source.sh %{!?with_system_v8:v8=0} %{!?with_nacl:nacl=0} libxml=0
 
 %build
 cd src
+
+%if %{with nacl}
+rm -rf native_client/toolchain/linux_x86_newlib
+# Make symlinks for nacl
+cd native_client/toolchain
+install -d linux_x86_newlib/x86_64-nacl/bin
+install -d linux_x86_newlib/x86_64-nacl/lib
+install -d linux_x86_newlib/x86_64-nacl/lib32
+install -d linux_x86_newlib/x86_64-nacl/nacl/include/bits
+install -d linux_x86_newlib/x86_64-nacl/nacl/include/machine
+install -d linux_x86_newlib/x86_64-nacl/nacl/include/sys
+cd linux_x86_newlib/x86_64-nacl/bin
+ln -s %{_bindir}/x86_64-nacl-gcc gcc
+ln -s %{_bindir}/x86_64-nacl-g++ g++
+ln -s %{_bindir}/x86_64-nacl-ar ar
+ln -s %{_bindir}/x86_64-nacl-as as
+ln -s %{_bindir}/x86_64-nacl-ranlib ranlib
+ln -s %{_bindir}/x86_64-nacl-strip x86-64-nacl-strip
+ln -s %{_bindir}/x86_64-nacl-strip strip
+ln -s %{_prefix}/x86_64-nacl/lib/*.a ../lib/
+ln -s %{_prefix}/x86_64-nacl/lib/32/*.a ../lib32/
+cd ../nacl/include
+for i in $(find %{_prefix}/x86_64-nacl/include -type f | grep -v "c++"); do
+	ln -s $i ${i#%{_prefix}/x86_64-nacl/include/}
+done
+cd ../../../../../..
+%endif
+
 test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
 %ifarch %{ix86}
 	-Dtarget_arch=ia32 \
diff --git a/nacl-build-irt.patch b/nacl-build-irt.patch
new file mode 100644
index 0000000..ff7e5de
--- /dev/null
+++ b/nacl-build-irt.patch
@@ -0,0 +1,40 @@
+--- chromium-browser-20.0.1132.47/native_client/SConstruct~	2012-06-28 16:03:20.000000000 +0300
++++ chromium-browser-20.0.1132.47/native_client/SConstruct	2012-07-07 01:27:46.054400799 +0300
+@@ -3329,7 +3329,7 @@
+     #### ALPHABETICALLY SORTED ####
+     ], ppapi_scons_files['nonvariant_test_scons_files'])
+ 
+-nacl_env.Append(BUILD_SCONSCRIPTS=irt_variant_tests + nonvariant_tests)
++#nacl_env.Append(BUILD_SCONSCRIPTS=irt_variant_tests + nonvariant_tests)
+ 
+ # ----------------------------------------------------------
+ # Possibly install an sdk by downloading it
+diff -up chromium-17.0.963.46/native_client/site_scons/site_tools/naclsdk.py.buildnacl chromium-17.0.963.46/native_client/site_scons/site_tools/naclsdk.py
+--- chromium-17.0.963.46/native_client/site_scons/site_tools/naclsdk.py.buildnacl	2012-01-27 03:03:50.000000000 -0500
++++ chromium-17.0.963.46/native_client/site_scons/site_tools/naclsdk.py	2012-02-13 17:09:38.402988894 -0500
+@@ -138,18 +138,21 @@ def _SetEnvForX86Sdk(env, sdk_path):
+   # does not run under Cygwin and does not follow Cygwin symlinks.
+   if env['TARGET_SUBARCH'] == default_subarch:
+     libsuffix = 'lib'
+-    as_mode_flag = ''
+-    ld_mode_flag = ''
++    cc_mode_flag = ' -m%s -L/usr/x86_64-nacl/lib/%s' % (env['TARGET_SUBARCH'], env['TARGET_SUBARCH'])
++    as_mode_flag = ' --%s' % env['TARGET_SUBARCH']
++    if env['TARGET_SUBARCH'] == '64':
++      ld_mode_flag = ' -melf64_nacl'
++    else:
++      ld_mode_flag = ' -melf_nacl'
+   else:
+     libsuffix = 'lib%s' % env['TARGET_SUBARCH']
++    cc_mode_flag = '-m%s' % env['TARGET_SUBARCH']
+     as_mode_flag = '--%s' % env['TARGET_SUBARCH']
+     if env['TARGET_SUBARCH'] == '64':
+       ld_mode_flag = ' -melf64_nacl'
+     else:
+       ld_mode_flag = ' -melf_nacl'
+ 
+-  cc_mode_flag = '-m%s' % env['TARGET_SUBARCH']
+-
+   env.Replace(# Replace header and lib paths.
+               # where to put nacl extra sdk headers
+               # TODO(robertm): switch to using the mechanism that
diff --git a/nacl-linkingfix.patch b/nacl-linkingfix.patch
new file mode 100644
index 0000000..0e9f188
--- /dev/null
+++ b/nacl-linkingfix.patch
@@ -0,0 +1,20 @@
+diff -up chromium-9.0.600.0/native_client/src/trusted/service_runtime/service_runtime.gyp.linking-fix chromium-9.0.600.0/native_client/src/trusted/service_runtime/service_runtime.gyp
+--- chromium-9.0.600.0/native_client/src/trusted/service_runtime/service_runtime.gyp.linking-fix	2010-12-03 06:56:29.000000000 -0500
++++ chromium-9.0.600.0/native_client/src/trusted/service_runtime/service_runtime.gyp	2010-12-13 12:56:50.063551554 -0500
+@@ -187,6 +187,16 @@
+                     'linux/arm/sel_segments.c',
+                   ],
+                 }],
++                ['target_arch=="ia32"', {
++                  'sources': [
++                    'linux/nacl_signal_32.c',
++                  ],
++                }],
++                ['target_arch=="x64"', {
++                  'sources': [
++                    'linux/nacl_signal_64.c',
++                  ],
++                }],
+               ],
+             }],
+             ['OS=="linux" or OS=="mac" or OS=="FreeBSD"', {


More information about the test mailing list