summaryrefslogtreecommitdiffstats
path: root/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch')
-rw-r--r--patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch159
1 files changed, 159 insertions, 0 deletions
diff --git a/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch b/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch
new file mode 100644
index 000000000..279e10a95
--- /dev/null
+++ b/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch
@@ -0,0 +1,159 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 27 Jun 2013 15:51:43 +0200
+Subject: Mac: Use libc++ instead of stdlibc++.
+
+- Add a missing include file to process_iterator_mac.cc.
+- Disable Chromium clang plugins.
+- Add a use_libcpp variable to common.gypi that can be used
+ to build with libc++ instead of libstdc++.
+ In this case several warnings also must be disabled,
+ And the mac deployment target must be bumped to 10.7.
+- ext/hash_map and ext/hash_set are deprecated.
+ Use unordered containers as a replacement.
+---
+ base/process/process_iterator_mac.cc | 1 +
+ build/common.gypi | 30 +++++++++++++++++++++++++++---
+ third_party/protobuf/config.h | 27 ++++++++++++++-------------
+ 3 files changed, 42 insertions(+), 16 deletions(-)
+
+diff --git a/base/process/process_iterator_mac.cc b/base/process/process_iterator_mac.cc
+index 29daa2d..e35c2ae 100644
+--- a/base/process/process_iterator_mac.cc
++++ b/base/process/process_iterator_mac.cc
+@@ -7,6 +7,7 @@
+ #include <errno.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
++#include <unistd.h>
+
+ #include "base/logging.h"
+ #include "base/strings/string_util.h"
+diff --git a/build/common.gypi b/build/common.gypi
+index e13aba4..9961053 100644
+--- a/build/common.gypi
++++ b/build/common.gypi
+@@ -287,7 +287,7 @@
+ # Run tools/clang/scripts/update.sh to make sure they are compiled.
+ # This causes 'clang_chrome_plugins_flags' to be set.
+ # Has no effect if 'clang' is not set as well.
+- 'clang_use_chrome_plugins%': 1,
++ 'clang_use_chrome_plugins%': 0,
+
+ # Enable building with ASAN (Clang's -fsanitize=address option).
+ # -fsanitize=address only works with clang, but asan=1 implies clang=1
+@@ -1144,6 +1144,9 @@
+ # rlz codes for searches but do not use the library.
+ 'enable_rlz%': 0,
+
++ # Compile with libc++ instead of libstdc++.
++ 'use_libcpp%' : 0,
++
+ # Turns on the i18n support in V8.
+ 'v8_enable_i18n_support': 1,
+
+@@ -1414,10 +1417,10 @@
+ # someplace that Xcode doesn't know about, set mac_sdk_path to the
+ # path to the SDK; when set to a non-empty string, SDK detection
+ # based on mac_sdk_min will be bypassed entirely.
+- 'mac_sdk_min%': '10.6',
++ 'mac_sdk_min%': '10.7',
+ 'mac_sdk_path%': '',
+
+- 'mac_deployment_target%': '10.6',
++ 'mac_deployment_target%': '10.7',
+ },
+
+ 'mac_sdk_min': '<(mac_sdk_min)',
+@@ -1427,6 +1430,7 @@
+ # Compile in Breakpad support by default so that it can be
+ # tested, even if it is not enabled by default at runtime.
+ 'mac_breakpad_compiled_in%': 1,
++
+ 'conditions': [
+ # mac_product_name is set to the name of the .app bundle as it should
+ # appear on disk. This duplicates data from
+@@ -1997,6 +2001,16 @@
+ ['use_x11==1', {
+ 'defines': ['USE_X11=1'],
+ }],
++ ['use_libcpp==1', {
++ 'defines': ['USE_UNORDERED_CONTAINERS=1'],
++ 'cflags_cc': [
++ '-Wno-deprecated-declarations',
++ '-Wno-newline-eof',
++ '-Wno-unused-value',
++ '-Wno-unused-variable',
++ '-stdlib=libc++'
++ ],
++ }],
+ ['enable_one_click_signin==1', {
+ 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
+ }],
+@@ -3914,6 +3928,16 @@
+ '-Wno-deprecated-register',
+ ],
+ }],
++ ['use_libcpp==1', {
++ 'OTHER_CPLUSPLUSFLAGS': ['-stdlib=libc++'],
++ 'USE_LIBCPP': 'YES',
++ 'WARNING_CFLAGS': [
++ '-Wno-deprecated-declarations',
++ '-Wno-newline-eof',
++ '-Wno-unused-value',
++ '-Wno-unused-variable',
++ ],
++ }],
+ ['clang==1 and clang_use_chrome_plugins==1', {
+ 'OTHER_CFLAGS': [
+ '<@(clang_chrome_plugins_flags)',
+diff --git a/third_party/protobuf/config.h b/third_party/protobuf/config.h
+index dcc0041..affcf55 100644
+--- a/third_party/protobuf/config.h
++++ b/third_party/protobuf/config.h
+@@ -1,31 +1,32 @@
+ /* config.h. Generated from config.h.in by configure. */
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
+-/* the name of <hash_set> */
+-#define HASH_MAP_CLASS hash_map
++#if defined(USE_UNORDERED_CONTAINERS)
++
++#define HASH_MAP_H <unordered_map>
++#define HASH_SET_H <unordered_set>
++#define HASH_NAMESPACE std
++#define HASH_MAP_CLASS unordered_map
++#define HASH_SET_CLASS unordered_set
+
+-/* the location of <hash_map> */
+-#if defined(USE_STLPORT)
+-#define HASH_MAP_H <hash_map>
+ #else
+-#define HASH_MAP_H <ext/hash_map>
+-#endif
+
+-/* the namespace of hash_map/hash_set */
+ #if defined(USE_STLPORT)
++#define HASH_MAP_H <hash_map>
++#define HASH_SET_H <hash_set>
+ #define HASH_NAMESPACE std
+ #else
++#define HASH_MAP_H <ext/hash_map>
++#define HASH_SET_H <ext/hash_set>
+ #define HASH_NAMESPACE __gnu_cxx
+ #endif
+
+ /* the name of <hash_set> */
++#define HASH_MAP_CLASS hash_map
++
++/* the name of <hash_set> */
+ #define HASH_SET_CLASS hash_set
+
+-/* the location of <hash_set> */
+-#if defined(USE_STLPORT)
+-#define HASH_SET_H <hash_set>
+-#else
+-#define HASH_SET_H <ext/hash_set>
+ #endif
+
+ /* Define to 1 if you have the <dlfcn.h> header file. */