Update to using Chromium from git (since there is no more SVN)

Mechanically/high-volume-wise this required duplicating some of the build/
and yasm/ build bits, since they're in the main Chrome repo.
More messy is the url/ situation: there is a version available, but not completely
up-to-date one, in fact one that's older than our base and what we were using from svn,
so we need to do weird compatibility massaging.
(I've also picked up newest RE2, which required some sync up changes).
This commit is contained in:
Maks Orlovich
2016-09-02 11:15:12 -04:00
parent 5d3bede980
commit 1188016590
25 changed files with 5224 additions and 111 deletions
+2 -8
View File
@@ -1,14 +1,9 @@
Makefile
!third_party/libjpeg_turbo/yasm/source/config/linux/Makefile
*.mk
*.Makefile
out/*
testing/*
build/android/*
build/mac/*
build/linux/*
build/internal/*
build/win/*
build/ios/*
build/gyp_helper.pyc
build/landmine_utils.pyc
build/temp_gyp/*
@@ -19,7 +14,7 @@ third_party/boringssl/*
third_party/chromium/src/base/*
third_party/chromium/src/build/*
third_party/chromium/src/net/base/*
third_party/chromium/src/url/*
third_party/chromium/src/googleurl/*
third_party/chromium_deps/*
third_party/closure_library/*
third_party/domain_registry_provider/*
@@ -33,7 +28,6 @@ third_party/httpd24/src/*
third_party/icu/*
third_party/jsoncpp/src/*
third_party/libjpeg_turbo/src/*
third_party/libjpeg_turbo/yasm/*
third_party/libpng/src/*
third_party/libwebp/*
third_party/mod_spdy/*
+11 -61
View File
@@ -17,12 +17,10 @@ vars = {
# that don't end with a trailing slash to http. We therefore try to make sure
# all https URLs include the trailing slash, but it's unclear if SVN actually
# respects this.
"chromium_trunk": "https://src.chromium.org/svn/trunk/",
"chromium_git": "https://chromium.googlesource.com",
# We don't include @ inside the revision here as is customary since
# we want to pass this into a -D flag
"chromium_revision_num": "256281",
"chromium_deps_root": "src/third_party/chromium_deps",
"libpagespeed_svn_root": "https://github.com/pagespeed/page-speed/trunk/",
"libpagespeed_trunk": "https://github.com/pagespeed/page-speed/trunk/lib/trunk/",
@@ -113,33 +111,11 @@ vars = {
deps = {
# Fetch dependent DEPS so we can sync our other dependencies relative
# to them.
Var("chromium_deps_root"):
File(Var("chromium_trunk") + "src/DEPS@" + Var("chromium_revision_num")),
# Other dependencies.
"src/build/temp_gyp":
Var("libpagespeed_trunk") + "src/build/temp_gyp/" +
Var("libpagespeed_revision"),
# We check 'build/android' out of Chromium repo to get
# 'android/cpufeatures.gypi', which is needed to compile libwebp.
"src/build/android":
Var("chromium_trunk") + "src/build/android/@" +
Var("chromium_revision_num"),
"src/build/ios":
Var("chromium_trunk") + "src/build/ios/@" + Var("chromium_revision_num"),
"src/build/internal":
Var("chromium_trunk") + "src/build/internal/@" +
Var("chromium_revision_num"),
"src/build/linux":
Var("chromium_trunk") + "src/build/linux/@" + Var("chromium_revision_num"),
"src/build/mac":
Var("chromium_trunk") + "src/build/mac/@" + Var("chromium_revision_num"),
"src/build/win":
Var("chromium_trunk") + "src/build/win/@" + Var("chromium_revision_num"),
# TODO(huibao): Remove references to libpagespeed.
"src/third_party/giflib":
Var("libpagespeed_svn_root") + "deps/giflib-4.1.6/",
@@ -148,21 +124,13 @@ deps = {
Var("libpagespeed_svn_root") + "deps/optipng-0.7.4/",
"src/third_party/zlib": Var("libpagespeed_svn_root") + "deps/zlib-1.2.5/",
# Yasm assember is required for libjpeg_turbo.
"src/third_party/libjpeg_turbo/yasm":
Var("chromium_trunk") + "src/third_party/yasm/@" +
Var("chromium_revision_num"),
"src/third_party/libjpeg_turbo/yasm/source/patched-yasm":
Var("chromium_trunk") + "deps/third_party/yasm/patched-yasm/@" +
Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/deps/yasm/patched-yasm@7da28c6c7c6a1387217352ce02b31754deb54d2a",
"src/third_party/libjpeg_turbo/src":
Var("chromium_trunk") + "deps/third_party/libjpeg_turbo/@" +
Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/deps/libjpeg_turbo/@7260e4d8b8e1e40b17f03fafdf1cd83296900f76",
"src/testing":
Var("chromium_trunk") + "src/testing/@" + Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/src/testing/@3207604f790d18c626e9dcb1a09874618c68844b",
"src/testing/gtest": Var("gtest_src") + Var("gtest_revision"),
"src/testing/gmock": Var("gmock_src") + Var("gmock_revision"),
@@ -186,16 +154,14 @@ deps = {
Var("apache_httpd24_src") + "os/" + Var("apache_httpd24_revision"),
"src/third_party/chromium/src/base":
Var("chromium_trunk") + "src/base/@" + Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/src/base@ccf3c2f324c4ae0d1aa878921b7c98f7deca5ee8",
"src/third_party/chromium/src/build":
Var("chromium_trunk") + "src/build/@" + Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/src/build/@06b7bd9c7a8adb3708db8df4dc058de94f0d5554",
"src/third_party/chromium/src/net/base":
Var("chromium_trunk") + "src/net/base@" + Var("chromium_revision_num"),
"src/third_party/chromium/src/url":
Var("chromium_trunk") + "src/url@" + Var("chromium_revision_num"),
# This revision is before headers got moved to main chromium repo.
"src/third_party/chromium/src/googleurl":
Var("chromium_git") + "/external/google-url@405b6e1798f88e85291820b30344723512e0c38f",
"src/third_party/closure_library":
Var("closure_library") + Var("closure_library_revision"),
@@ -224,7 +190,7 @@ deps = {
"src/third_party/libwebp": Var("libwebp_src") + Var("libwebp_revision"),
"src/tools/clang":
Var("chromium_trunk") + "src/tools/clang/@" + Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/src/tools/clang/@bf272f7b05896b9a18de8497383f8b873a86cfbc",
# This is the same commit as the version from svn included from chromium_deps,
# but the svn is down, so we take it from chromium-git.
@@ -232,13 +198,11 @@ deps = {
Var("chromium_git") + "/external/gyp@" + "0fb31294ae844bbf83eba05876b7a241b66f1e99",
"src/third_party/modp_b64":
Var("chromium_trunk") + "src/third_party/modp_b64/@" +
Var("chromium_revision_num"),
Var("chromium_git") + "/chromium/src/third_party/modp_b64/@aae60754fa997799e8037f5e8ca1f56d58df763d",
# RE2.
"src/third_party/re2/src":
Var("chromium_trunk") + "src/third_party/re2/@" +
Var("chromium_revision_num"),
"https://github.com/google/re2.git/@78dd4fa1f86bafbf5a5eb006778d9e6e27297af6",
# Comment to disable HTTPS fetching via serf. See also the
# references in src/third_party/serf/serf.gyp.
@@ -264,20 +228,6 @@ deps = {
}
deps_os = {
"win": {
"src/third_party/cygwin": From(Var("chromium_deps_root")),
"src/third_party/python_26":
Var("chromium_trunk") + "tools/third_party/python_26/@" +
Var("chromium_revision_num"),
},
"mac": {
},
"unix": {
},
}
include_rules = [
# Everybody can use some things.
"+base",
@@ -0,0 +1,41 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to provide an action that
# combines a directory of shared libraries and an incomplete APK into a
# standalone APK.
#
# To use this, create a gyp action with the following form:
# {
# 'action_name': 'some descriptive action name',
# 'variables': {
# 'inputs': [ 'input_path1', 'input_path2' ],
# 'input_apk_path': '<(unsigned_apk_path)',
# 'output_apk_path': '<(unsigned_standalone_apk_path)',
# 'libraries_top_dir': '<(libraries_top_dir)',
# },
# 'includes': [ 'relative/path/to/create_standalone_apk_action.gypi' ],
# },
{
'message': 'Creating standalone APK: <(output_apk_path)',
'variables': {
'inputs': [],
},
'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/create_standalone_apk.py',
'<(input_apk_path)',
'>@(inputs)',
],
'outputs': [
'<(output_apk_path)',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/create_standalone_apk.py',
'--libraries-top-dir=<(libraries_top_dir)',
'--input-apk-path=<(input_apk_path)',
'--output-apk-path=<(output_apk_path)',
],
}
+56
View File
@@ -0,0 +1,56 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to provide a rule that dexes
# compiled java files. If proguard_enabled == "true" and CONFIGURATION_NAME ==
# "Release", then it will dex the proguard_enabled_input_path instead of the
# normal dex_input_paths/dex_generated_input_paths.
#
# To use this, create a gyp target with the following form:
# {
# 'action_name': 'some name for the action'
# 'actions': [
# 'variables': {
# 'dex_input_paths': [ 'files to dex (when proguard is not used) and add to input paths' ],
# 'dex_generated_input_dirs': [ 'dirs that contain generated files to dex' ],
#
# # For targets that use proguard:
# 'proguard_enabled': 'true',
# 'proguard_enabled_input_path': 'path to dex when using proguard',
# },
# 'includes': [ 'relative/path/to/dex_action.gypi' ],
# ],
# },
#
{
'message': 'Creating dex file: <(output_path)',
'variables': {
'dex_input_paths': [],
'dex_generated_input_dirs': [],
'proguard_enabled%': 'false',
'proguard_enabled_input_path%': '',
'dex_no_locals%': 0,
},
'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/util/md5_check.py',
'<(DEPTH)/build/android/gyp/dex.py',
'>@(dex_input_paths)',
],
'outputs': [
'<(output_path)',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/dex.py',
'--dex-path=<(output_path)',
'--android-sdk-tools=<(android_sdk_tools)',
'--configuration-name=<(CONFIGURATION_NAME)',
'--proguard-enabled=<(proguard_enabled)',
'--proguard-enabled-input-path=<(proguard_enabled_input_path)',
'--no-locals=<(dex_no_locals)',
'>@(dex_input_paths)',
'>@(dex_generated_input_dirs)',
]
}
+40
View File
@@ -0,0 +1,40 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to provide an action that
# signs and zipaligns an APK.
#
# To use this, create a gyp action with the following form:
# {
# 'action_name': 'some descriptive action name',
# 'variables': {
# 'input_apk_path': 'relative/path/to/input.apk',
# 'output_apk_path': 'relative/path/to/output.apk',
# },
# 'includes': [ '../../build/android/finalize_apk.gypi' ],
# },
#
{
'message': 'Signing/aligning <(_target_name) APK: <(input_apk_path)',
'variables': {
'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore',
},
'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/finalize_apk.py',
'<(keystore_path)',
'<(input_apk_path)',
],
'outputs': [
'<(output_apk_path)',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/finalize_apk.py',
'--android-sdk-root=<(android_sdk_root)',
'--unsigned-apk-path=<(input_apk_path)',
'--final-apk-path=<(output_apk_path)',
'--keystore-path=<(keystore_path)',
],
}
+53
View File
@@ -0,0 +1,53 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to provide a rule that
# instruments either java class files, or jars.
{
'variables': {
'instr_type%': 'jar',
'input_path%': '',
'output_path%': '',
'stamp_path%': '',
'extra_instr_args': [
'--coverage-file=<(_target_name).em',
'--sources-file=<(_target_name)_sources.txt',
],
'emma_jar': '<(android_sdk_root)/tools/lib/emma.jar',
'conditions': [
['emma_instrument != 0', {
'extra_instr_args': [
'--sources=<(java_in_dir)/src >(additional_src_dirs) >(generated_src_dirs)',
'--src-root=<(DEPTH)',
'--emma-jar=<(emma_jar)',
'--filter-string=<(emma_filter)',
],
'conditions': [
['instr_type == "jar"', {
'instr_action': 'instrument_jar',
}, {
'instr_action': 'instrument_classes',
}]
],
}, {
'instr_action': 'copy',
'extra_instr_args': [],
}]
]
},
'inputs': [
'<(DEPTH)/build/android/gyp/emma_instr.py',
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/pylib/utils/command_option_parser.py',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/emma_instr.py',
'<(instr_action)',
'--input-path=<(input_path)',
'--output-path=<(output_path)',
'--stamp=<(stamp_path)',
'<@(extra_instr_args)',
]
}
+39
View File
@@ -0,0 +1,39 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to provide a rule to
# run lint on java/class files.
{
'action_name': 'lint_<(_target_name)',
'message': 'Linting <(_target_name)',
'variables': {
'conditions': [
['chromium_code != 0 and android_lint != 0 and never_lint == 0', {
'is_enabled': '--enable',
}, {
'is_enabled': '',
}]
]
},
'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/lint.py',
'<(DEPTH)/build/android/lint/suppressions.xml',
'<(DEPTH)/build/android/AndroidManifest.xml',
],
'action': [
'python', '<(DEPTH)/build/android/gyp/lint.py',
'--lint-path=<(android_sdk_root)/tools/lint',
'--config-path=<(DEPTH)/build/android/lint/suppressions.xml',
'--processed-config-path=<(config_path)',
'--manifest-path=<(DEPTH)/build/android/AndroidManifest.xml',
'--result-path=<(result_path)',
'--product-dir=<(PRODUCT_DIR)',
'--src-dirs=>(src_dirs)',
'--classes-dir=<(classes_dir)',
'--stamp=<(stamp_path)',
'<(is_enabled)',
],
}
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Outputs host CPU architecture in format recognized by gyp."""
import platform
import re
import sys
def main():
host_arch = platform.machine()
# Convert machine type to format recognized by gyp.
if re.match(r'i.86', host_arch) or host_arch == 'i86pc':
host_arch = 'ia32'
elif host_arch in ['x86_64', 'amd64']:
host_arch = 'x64'
elif host_arch.startswith('arm'):
host_arch = 'arm'
# platform.machine is based on running kernel. It's possible to use 64-bit
# kernel with 32-bit userland, e.g. to give linker slightly more memory.
# Distinguish between different userland bitness by querying
# the python binary.
if host_arch == 'x64' and platform.architecture()[0] == '32bit':
host_arch = 'ia32'
print host_arch
return 0
if __name__ == '__main__':
sys.exit(main())
@@ -184,6 +184,8 @@ TEST_F(RedirectOnSizeLimitFilterTest, TestFlushBeforeLimit) {
TEST_F(RedirectOnSizeLimitFilterTest, TestEscapingAndFlush) {
SetupDriver(100);
// Depending on the version of Chromium GURL used, we get different quoting
// for a single-quote. Either is acceptable.
static const char kOutput[] =
"<html>"
"<input type=\"text\"/>"
@@ -193,6 +195,15 @@ TEST_F(RedirectOnSizeLimitFilterTest, TestEscapingAndFlush) {
"<script type=\"text/javascript\">alert('123');</script>"
"</html>";
static const char kOutputAlt[] =
"<html>"
"<input type=\"text\"/>"
"<script type=\"text/javascript\">"
"window.location=\"http://test.com/in.html?\\'(&PageSpeed=off\";"
"</script>"
"<script type=\"text/javascript\">alert('123');</script>"
"</html>";
html_parse()->StartParse("http://test.com/in.html?'(");
html_parse()->ParseText(
"<html><input type=\"text\"/>"
@@ -204,7 +215,7 @@ TEST_F(RedirectOnSizeLimitFilterTest, TestEscapingAndFlush) {
"<table><tr><td>blah</td></tr></table></html>");
html_parse()->FinishParse();
EXPECT_STREQ(kOutput, output_);
EXPECT_TRUE((kOutput == output_) || (kOutputAlt == output_)) << output_;
}
} // namespace net_instaweb
+1
View File
@@ -418,6 +418,7 @@
'pagespeed_thread',
'<(DEPTH)/third_party/re2/re2.gyp:re2',
'<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
'<(DEPTH)/url/url.gyp:url_lib',
],
},
{
+3 -3
View File
@@ -27,9 +27,9 @@
#include "pagespeed/kernel/base/string_util.h"
#include "third_party/chromium/src/url/gurl.h"
#include "third_party/chromium/src/url/url_parse.h"
#include "third_party/chromium/src/url/url_util.h"
#include "third_party/chromium/src/googleurl/src/gurl.h"
#include "third_party/chromium/src/googleurl/src/url_parse.h"
#include "third_party/chromium/src/googleurl/src/url_util.h"
namespace net_instaweb {
+1 -1
View File
@@ -26,7 +26,7 @@
using re2::RE2;
namespace re2 {
const RE2::CannedOptions posix_syntax = RE2::POSIX_SYNTAX;
const RE2::CannedOptions posix_syntax = RE2::POSIX;
} // namespace re2
typedef re2::StringPiece Re2StringPiece;
+20
View File
@@ -0,0 +1,20 @@
--- frontends/tasm/tasm.c
+++ frontends/tasm/tasm.c
@@ -224,7 +224,9 @@
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
- "Compiled on " __DATE__ ".",
"Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};
--- frontends/yasm/yasm.c
+++ frontends/yasm/yasm.c
@@ -213,7 +213,9 @@
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
- "Compiled on " __DATE__ ".",
"Copyright (c) 2001-2011 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};
+142
View File
@@ -0,0 +1,142 @@
Name: yasm
URL: http://www.tortall.net/projects/yasm/
Version: 1.2.0
License: 2-clause or 3-clause BSD licensed, with the exception of bitvect, which is triple-licensed under the Artistic license, GPL, and LGPL
License File: source/patched-yasm/COPYING
License Android Compatible: yes
Security Critical: no
With these patches merged:
* https://github.com/yasm/yasm/commit/a2cbb10ee1b90b73647667ac849c74d65761d412
* https://github.com/yasm/yasm/commit/01ab853e68ef8aeded716d6f5b34895200f66a51
* https://github.com/yasm/yasm/commit/82fafa7b5619e702c8681c959ade0746498e3cbc
* https://github.com/yasm/yasm/commit/2bd66514b6b100887c19d8598da38347b3cff40e
* https://github.com/yasm/yasm/commit/ab19547382660d81e0b4a0232dccb38f44c52a36
* https://github.com/yasm/yasm/commit/9728322335cba96500861ef766b1546d096e5600
* CHROMIUM.diff: this patch makes yasm deterministic.
See also the yasm.gyp file for a description of the yasm build process.
Instructions for recreating the yasm.gyp file.
1) Get a clean version of the yasm source tree. The clean tree can be found
at:
src/third_party/yasm/source/yasm
2) Run configure on the pristine source from a different directory (eg.,
/tmp/yasm_build). Running configure from another directory will keep
the source tree clean.
3) Next, capture all the output from a build of yasm. We will use the build
log as a reference for making the yasm.gyp file.
make yasm > yasm_build_log 2> yasm_build_err
4) Check yasm_build_err to see if there are any anomalies beyond yasm's
compiler warnings.
5) Grab the generated Makefile, libyasm-stdint.h, config.h, and put into
the correct platform location. For android platform, copy the files
generated for linux, but make sure that ENABLE_NLS is not defined to
allow mac host compiles to work. For ios, copy the files from mac.
src/third_party/yasm/source/config/[platform]
While we do not directly use the "Makefile" to build, it is needed by
the "genmodule" subprogram as input for creating the available modules
list.
6) Make sure all the subprograms are represented in yasm.gyp.
grep '^gcc' yasm_build_log |
grep -v ' -DHAVE_CONFIG_H '
The yasm build creates a bunch of subprograms that in-turn generate
more .c files in the build. Luckily the commands to generate the
subprogram do not have -DHAVE_CONFIG_H as a cflag.
From this list, make sure all the subprograms that are build have
appropriate targets in the yasm.gyp.
You will notice, when you get to the next step, that there are some
.c source files that are compiled both for yasm, and for genperf.
Those should go into the genperf_libs target so that they can be
shared by the genperf and yasm targets. Find those files by appending
| grep 'gp-'
to the command above.
7) Find all the source files used to build yasm proper.
grep -E '^gcc' yasm_build_log |
grep ' -DHAVE_CONFIG_H ' |
awk '{print $NF }' |
sed -e "s/'\.\/'\`//" | # Removes some garbage from the build line.
sort -u |
sed -e "s/\(.*\)/'\1',/" # Add quotes to each line.
Reversing the -DHAVE_CONFIG_H filter from the command above should
list the compile lines for yasm proper.
This should get you close, but you will need to manually examine this
list. However, some of the built products are still included in the
command above. Generally, if the source file is in the root directory,
it's a generated file.
Inspect the current yasm.gyp for a list of the subprograms and their
outputs.
Update the sources list in the yasm target accordingly. Read step #9
as well if you update the source list to avoid problems.
8) Update the actions for each of the subprograms.
Here is the real fun. For each subprogram created, you will need to
update the actions and rules in yasm.gyp that invoke the subprogram to
generate the files needed by the rest of the build.
I don't have any good succinct instructions for this. Grep the build
log for each subprogram invocation (eg., "./genversion"), look at
its command inputs and output, then verify our yasm.gyp does something
similar.
The good news is things likely only link or compile if this is done
right so you'll know if there is a problem.
Again, refer to the existing yasm.gyp for a guide to how the generated
files are used.
Here are a few gotchas:
1) genmodule, by default, writes module.c into the current
directory. This does not play nicely with gyp. We patch the
source during build to allow specifying a specific output file.
2) Most of the generated files, even though they are .c files, are
#included by other files in the build. Make sure they end up
in a directory that is in the include path for the build.
One of <(shared_generated_dir) or <(generated_dir) should work.
3) Some of the genperf output is #included while others need to be
compiled directly. That is why there are 2 different rules for
.gperf files in two targets.
9) Check for python scripts that are run.
grep python yasm_build_log
Yasm uses python scripts to generate the assembly code description
files in C++. Make sure to get these put into the gyp file properly as
well. An example is gen_x86_insn.py for x86 assembly.
Note that at least the gen_x86_insn.py script suffers from the same
problem as genmacro in that it outputs to the current directory by
default. The yasm.gyp build patches this file before invoking it to
allow specifying an output directory.
10) Recreate the 'AdditionalOptions!': [ '/analyze' ] block so that VC++
/analyze builds won't fail.
11) If all that's is finished, attempt to build....and cross your fingers.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,173 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Command name to run C preprocessor */
#define CPP_PROG "gcc -E"
/* */
#define ENABLE_NLS 1
/* Define to 1 if you have the `abort' function. */
#define HAVE_ABORT 1
/* */
/* #undef HAVE_CATGETS */
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
/* #undef HAVE_CFLOCALECOPYCURRENT */
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#define HAVE_DCGETTEXT 1
/* Define to 1 if you have the <direct.h> header file. */
/* #undef HAVE_DIRECT_H */
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* */
#define HAVE_GETTEXT 1
/* Define to 1 if you have the GNU C Library */
#define HAVE_GNU_C_LIBRARY 1
/* Define if you have the iconv() function and it works. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* */
/* #undef HAVE_LC_MESSAGES */
/* Define to 1 if you have the <libgen.h> header file. */
#define HAVE_LIBGEN_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mergesort' function. */
/* #undef HAVE_MERGESORT */
/* Define to 1 if you have the `popen' function. */
#define HAVE_POPEN 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* */
/* #undef HAVE_STPCPY */
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strcmpi' function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the `stricmp' function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strsep' function. */
#define HAVE_STRSEP 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `toascii' function. */
#define HAVE_TOASCII 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `_stricmp' function. */
/* #undef HAVE__STRICMP */
/* Name of package */
#define PACKAGE "yasm"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-yasm@tortall.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "yasm"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "yasm 1.2.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "yasm"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.2.0"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* The size of `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */
/* The size of `int', as computed by sizeof. */
/* #undef SIZEOF_INT */
/* The size of `long', as computed by sizeof. */
/* #undef SIZEOF_LONG */
/* The size of `short', as computed by sizeof. */
/* #undef SIZEOF_SHORT */
/* The size of `void*', as computed by sizeof. */
/* #undef SIZEOF_VOIDP */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.2.0"
/* Define if using the dmalloc debugging malloc package */
/* #undef WITH_DMALLOC */
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
@@ -0,0 +1,9 @@
#ifndef _YASM_LIBYASM_STDINT_H
#define _YASM_LIBYASM_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "yasm HEAD"
/* generated using gcc -std=gnu99 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
Submodule third_party/libjpeg_turbo/yasm/source/patched-yasm added at 7da28c6c7c
+589
View File
@@ -0,0 +1,589 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The yasm build process creates a slew of small C subprograms that
# dynamically generate files at various point in the build process. This makes
# the build integration moderately complex.
#
# There are three classes of dynamically generated files:
# 1) C source files that should be included in the build (eg., lc3bid.c)
# 2) C source files that are #included by static C sources (eg., license.c)
# 3) Intermediate files that are used as input by other subprograms to
# further generate files in category #1 or #2. (eg., version.mac)
#
# This structure is represented with the following targets:
# 1) yasm -- Sources, flags for the main yasm executable. Also has most of
# of the actions and rules that invoke the subprograms.
# 2) config_sources -- Checked in version of files generated by manually
# running configure that are used by all binaries.
# 3) generate_files -- Actions and rules for files of type #3.
# 4) genperf_libs -- Object files shared between yasm and the genperf
# subprogram.
# 5) genmacro, genmodule, etc. -- One executable target for each subprogram.
#
# You will notice that a lot of the action targets seem very similar --
# especially for genmacro invocations. This makes it seem like they should
# be a rule. The problem is that the correct invocation cannot be inferred
# purely from the file name, or extension. Nor is it obvious whether the
# output should be processed as a source or not. Thus, we are left with a
# large amount of repetitive code.
{
'variables': {
'yasm_include_dirs': [
'source/config/<(OS)',
'source/patched-yasm',
],
# The cflags used by any target that will be directly linked into yasm.
# These are specifically not used when building the subprograms. While
# it would probably be safe to use these flags there as well, the
# ./configure based build does not use the same flags between the main
# yasm executable, and its subprograms.
'yasm_defines': ['HAVE_CONFIG_H'],
'yasm_cflags': [
'-std=c89',
'-pedantic',
],
# Locations for various generated artifacts.
'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/yasm',
'generated_dir': '<(INTERMEDIATE_DIR)/third_party/yasm',
# Various files referenced by multiple targets.
'version_file': 'version.mac', # Generated by genversion.
'genmodule_source': 'genmodule_outfile.c',
},
'target_defaults': {
# Silence warnings in libc++ builds (C code doesn't need this flag).
'ldflags!': [ '-stdlib=libc++', ],
# https://crbug.com/489901
'cflags!': [ '-fsanitize=bounds' ],
},
'targets': [
{
'target_name': 'yasm',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [
'config_sources',
'genmacro',
'genmodule',
'genperf',
'genperf_libs',
'generate_files', # Needed to generate gperf and instruction files.
'genstring',
're2c',
],
'variables': {
'clang_warning_flags': [
# yasm passes a `const elf_machine_sym*` through `void*`.
'-Wno-incompatible-pointer-types',
# reg3264type in x86expr.c is unused.
'-Wno-unused-local-typedef',
],
},
'conditions': [
['OS=="win"', {
# As of VS 2013 Update 3, building this project with /analyze hits an
# internal compiler error on elf-x86-amd64.c in release builds with
# the amd64_x86 compiler. This halts the build and prevents subsequent
# analysis. Therefore, /analyze is disabled for this project. See this
# bug for details:
# https://connect.microsoft.com/VisualStudio/feedback/details/1014799/internal-compiler-error-when-using-analyze
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions!': [ '/analyze:WX-' ]
},
},
}],
],
'sources': [
'source/patched-yasm/frontends/yasm/yasm-options.c',
'source/patched-yasm/frontends/yasm/yasm.c',
'source/patched-yasm/libyasm/assocdat.c',
'source/patched-yasm/libyasm/bc-align.c',
'source/patched-yasm/libyasm/bc-data.c',
'source/patched-yasm/libyasm/bc-incbin.c',
'source/patched-yasm/libyasm/bc-org.c',
'source/patched-yasm/libyasm/bc-reserve.c',
'source/patched-yasm/libyasm/bitvect.c',
'source/patched-yasm/libyasm/bytecode.c',
'source/patched-yasm/libyasm/errwarn.c',
'source/patched-yasm/libyasm/expr.c',
'source/patched-yasm/libyasm/file.c',
'source/patched-yasm/libyasm/floatnum.c',
'source/patched-yasm/libyasm/hamt.c',
'source/patched-yasm/libyasm/insn.c',
'source/patched-yasm/libyasm/intnum.c',
'source/patched-yasm/libyasm/inttree.c',
'source/patched-yasm/libyasm/linemap.c',
'source/patched-yasm/libyasm/md5.c',
'source/patched-yasm/libyasm/mergesort.c',
'source/patched-yasm/libyasm/section.c',
'source/patched-yasm/libyasm/strcasecmp.c',
'source/patched-yasm/libyasm/strsep.c',
'source/patched-yasm/libyasm/symrec.c',
'source/patched-yasm/libyasm/valparam.c',
'source/patched-yasm/libyasm/value.c',
'source/patched-yasm/modules/arch/lc3b/lc3barch.c',
'source/patched-yasm/modules/arch/lc3b/lc3bbc.c',
'source/patched-yasm/modules/arch/x86/x86arch.c',
'source/patched-yasm/modules/arch/x86/x86bc.c',
'source/patched-yasm/modules/arch/x86/x86expr.c',
'source/patched-yasm/modules/arch/x86/x86id.c',
'source/patched-yasm/modules/dbgfmts/codeview/cv-dbgfmt.c',
'source/patched-yasm/modules/dbgfmts/codeview/cv-symline.c',
'source/patched-yasm/modules/dbgfmts/codeview/cv-type.c',
'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-aranges.c',
'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c',
'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-info.c',
'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-line.c',
'source/patched-yasm/modules/dbgfmts/null/null-dbgfmt.c',
'source/patched-yasm/modules/dbgfmts/stabs/stabs-dbgfmt.c',
'source/patched-yasm/modules/listfmts/nasm/nasm-listfmt.c',
'source/patched-yasm/modules/objfmts/bin/bin-objfmt.c',
'source/patched-yasm/modules/objfmts/coff/coff-objfmt.c',
'source/patched-yasm/modules/objfmts/coff/win64-except.c',
'source/patched-yasm/modules/objfmts/dbg/dbg-objfmt.c',
'source/patched-yasm/modules/objfmts/elf/elf-objfmt.c',
'source/patched-yasm/modules/objfmts/elf/elf-x86-amd64.c',
'source/patched-yasm/modules/objfmts/elf/elf-x86-x86.c',
'source/patched-yasm/modules/objfmts/elf/elf.c',
'source/patched-yasm/modules/objfmts/macho/macho-objfmt.c',
'source/patched-yasm/modules/objfmts/rdf/rdf-objfmt.c',
'source/patched-yasm/modules/objfmts/xdf/xdf-objfmt.c',
'source/patched-yasm/modules/parsers/gas/gas-parse.c',
'source/patched-yasm/modules/parsers/gas/gas-parse-intel.c',
'source/patched-yasm/modules/parsers/gas/gas-parser.c',
'source/patched-yasm/modules/parsers/nasm/nasm-parse.c',
'source/patched-yasm/modules/parsers/nasm/nasm-parser.c',
'source/patched-yasm/modules/preprocs/cpp/cpp-preproc.c',
'source/patched-yasm/modules/preprocs/nasm/nasm-eval.c',
'source/patched-yasm/modules/preprocs/nasm/nasm-pp.c',
'source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c',
'source/patched-yasm/modules/preprocs/nasm/nasmlib.c',
'source/patched-yasm/modules/preprocs/raw/raw-preproc.c',
# Sources needed by re2c.
'source/patched-yasm/modules/parsers/gas/gas-token.re',
'source/patched-yasm/modules/parsers/nasm/nasm-token.re',
# Sources needed by genperf. Make sure the generated gperf files
# (the ones in shared_generated_dir) are synced with the outputs
# for the related generate_*_insn actions in the generate_files
# target below.
'<(shared_generated_dir)/x86insn_nasm.gperf',
'<(shared_generated_dir)/x86insn_gas.gperf',
'<(shared_generated_dir)/x86cpu.c',
'<(shared_generated_dir)/x86regtmod.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
'<(shared_generated_dir)',
'<(generated_dir)',
],
'defines': [ '<@(yasm_defines)' ],
'cflags': [ '<@(yasm_cflags)', ],
'msvs_disabled_warnings': [ 4267 ],
'rules': [
{
'rule_name': 'generate_gperf',
'extension': 'gperf',
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ],
'outputs': [
'<(generated_dir)/<(RULE_INPUT_ROOT).c',
],
'action': ['<(PRODUCT_DIR)/genperf',
'<(RULE_INPUT_PATH)',
'<(generated_dir)/<(RULE_INPUT_ROOT).c',
],
# These files are #included, so do not treat them as sources.
'process_outputs_as_sources': 0,
'message': 'yasm gperf for <(RULE_INPUT_PATH)',
},
{
'rule_name': 'generate_re2c',
'extension': 're',
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)' ],
'outputs': [ '<(generated_dir)/<(RULE_INPUT_ROOT).c', ],
'action': [
'<(PRODUCT_DIR)/re2c',
'-b',
'-o',
'<(generated_dir)/<(RULE_INPUT_ROOT).c',
'<(RULE_INPUT_PATH)',
],
'process_outputs_as_sources': 1,
'message': 'yasm re2c for <(RULE_INPUT_PATH)',
},
],
'actions': [
###
### genmacro calls.
###
{
'action_name': 'generate_nasm_macros',
'variables': {
'infile': 'source/patched-yasm/modules/parsers/nasm/nasm-std.mac',
'varname': 'nasm_standard_mac',
'outfile': '<(generated_dir)/nasm-macros.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': ['<(PRODUCT_DIR)/genmacro',
'<(outfile)', '<(varname)', '<(infile)', ],
# Not a direct source because this is #included by
# source/patched-yasm/modules/parsers/nasm/nasm-parser.c
'process_outputs_as_sources': 1,
'message': 'yasm genmacro for <(infile)',
},
{
'action_name': 'generate_nasm_version',
'variables': {
'infile': '<(shared_generated_dir)/<(version_file)',
'varname': 'nasm_version_mac',
'outfile': '<(generated_dir)/nasm-version.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': ['<(PRODUCT_DIR)/genmacro',
'<(outfile)', '<(varname)', '<(infile)',
],
# Not a direct source because this is #included by
# source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c
'process_outputs_as_sources': 0,
'message': 'yasm genmacro for <(infile)',
},
{
'action_name': 'generate_win64_gas',
'variables': {
'infile': 'source/patched-yasm/modules/objfmts/coff/win64-gas.mac',
'varname': 'win64_gas_stdmac',
'outfile': '<(generated_dir)/win64-gas.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': ['<(PRODUCT_DIR)/genmacro',
'<(outfile)', '<(varname)', '<(infile)',
],
# Not a direct source because this is #included by
# source/patched-yasm/modules/objfmts/coff/coff-objfmt.c
'process_outputs_as_sources': 0,
'message': 'yasm genmacro for <(infile)',
},
{
'action_name': 'generate_win64_nasm',
'variables': {
'infile': 'source/patched-yasm/modules/objfmts/coff/win64-nasm.mac',
'varname': 'win64_nasm_stdmac',
'outfile': '<(generated_dir)/win64-nasm.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': ['<(PRODUCT_DIR)/genmacro',
'<(outfile)',
'<(varname)',
'<(infile)',
],
# Not a direct source because this is #included by
# source/patched-yasm/modules/objfmts/coff/coff-objfmt.c
'process_outputs_as_sources': 0,
'message': 'yasm genmacro for <(infile)',
},
###
### genstring call.
###
{
'action_name': 'generate_license',
'variables': {
'infile': 'source/patched-yasm/COPYING',
'varname': 'license_msg',
'outfile': '<(generated_dir)/license.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genstring<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': ['<(PRODUCT_DIR)/genstring',
'<(varname)',
'<(outfile)',
'<(infile)',
],
# Not a direct source because this is #included by
# source/patched-yasm/frontends/yasm/yasm.c
'process_outputs_as_sources': 0,
'message': 'Generating yasm embeddable license',
},
###
### A re2c call that doesn't fit into the rule below.
###
{
'action_name': 'generate_lc3b_token',
'variables': {
'infile': 'source/patched-yasm/modules/arch/lc3b/lc3bid.re',
# The license file is #included by yasm.c.
'outfile': '<(generated_dir)/lc3bid.c',
},
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)',
'<(infile)', ],
'outputs': [ '<(outfile)', ],
'action': [
'<(PRODUCT_DIR)/re2c',
'-s',
'-o', '<(outfile)',
'<(infile)'
],
'process_outputs_as_sources': 1,
'message': 'Generating yasm tokens for lc3b',
},
###
### genmodule call.
###
{
'action_name': 'generate_module',
'variables': {
'makefile': 'source/config/<(OS)/Makefile',
'module_in': 'source/patched-yasm/libyasm/module.in',
'outfile': '<(generated_dir)/module.c',
},
'inputs': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)genmodule<(EXECUTABLE_SUFFIX)',
'<(module_in)',
'<(makefile)'
],
'outputs': [ '<(generated_dir)/module.c' ],
'action': [
'<(PRODUCT_DIR)/genmodule',
'<(module_in)',
'<(makefile)',
'<(outfile)'
],
'process_outputs_as_sources': 1,
'message': 'Generating yasm module information',
},
],
},
{
'target_name': 'config_sources',
'type': 'none',
'toolsets': ['host'],
'sources': [
'source/config/<(OS)/Makefile',
'source/config/<(OS)/config.h',
'source/config/<(OS)/libyasm-stdint.h',
],
},
{
'target_name': 'generate_files',
'type': 'none',
'toolsets': ['host'],
'dependencies': [
'genperf',
'genversion',
],
'sources': [
'source/patched-yasm/modules/arch/x86/x86cpu.gperf',
'source/patched-yasm/modules/arch/x86/x86regtmod.gperf',
],
'rules': [
{
'rule_name': 'generate_gperf',
'extension': 'gperf',
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ],
'outputs': [ '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', ],
'action': [
'<(PRODUCT_DIR)/genperf',
'<(RULE_INPUT_PATH)',
'<(shared_generated_dir)/<(RULE_INPUT_ROOT).c',
],
'process_outputs_as_sources': 0,
'message': 'yasm genperf for <(RULE_INPUT_PATH)',
},
],
'actions': [
{
'action_name': 'generate_x86_insn',
'variables': {
'gen_insn_path':
'source/patched-yasm/modules/arch/x86/gen_x86_insn.py',
},
'inputs': [ '<(gen_insn_path)', ],
'outputs': [
'<(shared_generated_dir)/x86insns.c',
'<(shared_generated_dir)/x86insn_gas.gperf',
'<(shared_generated_dir)/x86insn_nasm.gperf',
],
'action': [
'python',
'<(gen_insn_path)',
'<(shared_generated_dir)',
],
'message': 'Running <(gen_insn_path)',
'process_outputs_as_sources': 0,
},
{
'action_name': 'generate_version',
'inputs': [ '<(PRODUCT_DIR)/'
'<(EXECUTABLE_PREFIX)genversion<(EXECUTABLE_SUFFIX)' ],
'outputs': [ '<(shared_generated_dir)/<(version_file)', ],
'action': [
'<(PRODUCT_DIR)/genversion',
'<(shared_generated_dir)/<(version_file)'
],
'message': 'Generating yasm version file: '
'<(shared_generated_dir)/<(version_file)',
'process_outputs_as_sources': 0,
},
],
},
{
'target_name': 'genperf_libs',
'type': 'static_library',
'toolsets': ['host'],
'dependencies': [ 'config_sources', ],
'sources': [
'source/patched-yasm/libyasm/phash.c',
'source/patched-yasm/libyasm/xmalloc.c',
'source/patched-yasm/libyasm/xstrdup.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'defines': [ '<@(yasm_defines)' ],
'cflags': [
'<@(yasm_cflags)',
],
},
{
'target_name': 'genstring',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [ 'config_sources', ],
'sources': [
'source/patched-yasm/genstring.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
},
{
'target_name': 'genperf',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [
'genperf_libs',
],
'sources': [
'source/patched-yasm/tools/genperf/genperf.c',
'source/patched-yasm/tools/genperf/perfect.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
},
{
'target_name': 'genmacro',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [ 'config_sources', ],
'sources': [
'source/patched-yasm/tools/genmacro/genmacro.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
},
{
'target_name': 'genversion',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [ 'config_sources', ],
'sources': [
'source/patched-yasm/modules/preprocs/nasm/genversion.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
},
{
'target_name': 're2c',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [ 'config_sources', ],
'sources': [
'source/patched-yasm/tools/re2c/main.c',
'source/patched-yasm/tools/re2c/code.c',
'source/patched-yasm/tools/re2c/dfa.c',
'source/patched-yasm/tools/re2c/parser.c',
'source/patched-yasm/tools/re2c/actions.c',
'source/patched-yasm/tools/re2c/scanner.c',
'source/patched-yasm/tools/re2c/mbo_getopt.c',
'source/patched-yasm/tools/re2c/substr.c',
'source/patched-yasm/tools/re2c/translate.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
'variables': {
'clang_warning_flags': [
# re2c is missing CLOSEVOP from one switch.
'-Wno-switch',
# re2c contains many static functions in headers (because it's
# a C library predating C99.)
'-Wno-unused-function',
],
},
'msvs_disabled_warnings': [ 4267 ],
},
{
'target_name': 'genmodule',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [
'config_sources',
],
'sources': [
'source/patched-yasm/libyasm/genmodule.c',
],
'include_dirs': [
'<@(yasm_include_dirs)',
],
'cflags': [
'-std=gnu99',
],
},
],
}
+119
View File
@@ -0,0 +1,119 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is an gyp include to use YASM for compiling assembly files.
#
# Files to be compiled with YASM should have an extension of .asm.
#
# There are three variables for this include:
# yasm_flags : Pass additional flags into YASM.
# yasm_output_path : Output directory for the compiled object files.
# yasm_includes : Includes used by .asm code. Changes to which should force
# recompilation.
#
# Sample usage:
# 'sources': [
# 'ultra_optimized_awesome.asm',
# ],
# 'variables': {
# 'yasm_flags': [
# '-I', 'assembly_include',
# ],
# 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/project',
# 'yasm_includes': ['ultra_optimized_awesome.inc']
# },
# 'includes': [
# 'third_party/yasm/yasm_compile.gypi'
# ],
{
'variables': {
'yasm_flags': [],
'yasm_includes': [],
'conditions': [
[ 'use_system_yasm==0', {
'yasm_path': '<(PRODUCT_DIR)/yasm<(EXECUTABLE_SUFFIX)',
}, {
'yasm_path': '<!(which yasm)',
}],
# Define yasm_flags that pass into YASM.
[ 'os_posix==1 and OS!="mac" and OS!="ios" and target_arch=="ia32"', {
'yasm_flags': [
'-felf32',
'-m', 'x86',
],
}],
[ 'os_posix==1 and OS!="mac" and OS!="ios" and target_arch=="x64"', {
'yasm_flags': [
'-DPIC',
'-felf64',
'-m', 'amd64',
],
}],
[ '(OS=="mac" or OS=="ios") and target_arch=="ia32"', {
'yasm_flags': [
'-fmacho32',
'-m', 'x86',
],
}],
[ '(OS=="mac" or OS=="ios") and target_arch=="x64"', {
'yasm_flags': [
'-fmacho64',
'-m', 'amd64',
],
}],
[ 'OS=="win" and target_arch=="ia32"', {
'yasm_flags': [
'-DPREFIX',
'-fwin32',
'-m', 'x86',
],
}],
[ 'OS=="win" and target_arch=="x64"', {
'yasm_flags': [
'-fwin64',
'-m', 'amd64',
],
}],
# Define output extension.
['OS=="win"', {
'asm_obj_extension': 'obj',
}, {
'asm_obj_extension': 'o',
}],
],
}, # variables
'conditions': [
# Only depend on YASM on x86 systems, do this so that compiling
# .asm files for ARM will fail.
['use_system_yasm==0 and ( target_arch=="ia32" or target_arch=="x64" )', {
'dependencies': [
'<(DEPTH)/third_party/yasm/yasm.gyp:yasm#host',
],
}],
], # conditions
'rules': [
{
'rule_name': 'assemble',
'extension': 'asm',
'inputs': [ '<(yasm_path)', '<@(yasm_includes)'],
'outputs': [
'<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)',
],
'action': [
'<(yasm_path)',
'<@(yasm_flags)',
'-o', '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)',
'<(RULE_INPUT_PATH)',
],
'process_outputs_as_sources': 1,
'message': 'Compile assembly <(RULE_INPUT_PATH)',
},
], # rules
}
+2 -8
View File
@@ -47,20 +47,14 @@
'src/re2/regexp.cc',
'src/re2/set.cc',
'src/re2/simplify.cc',
'src/re2/stringpiece.cc',
'src/re2/tostring.cc',
'src/re2/unicode_casefold.cc',
'src/re2/unicode_groups.cc',
'src/util/arena.cc',
'src/util/hash.cc',
'src/util/logging.cc',
'src/util/pcre.cc',
'src/util/random.cc',
'src/util/rune.cc',
'src/util/stringpiece.cc',
'src/util/stringprintf.cc',
'src/util/strutil.cc',
'src/util/thread.cc',
'src/util/valgrind.cc',
],
},
{
+13
View File
@@ -0,0 +1,13 @@
#ifndef URL_COMPAT_STRING16_H
#define URL_COMPAT_STRING16_H
// We have both of:
// third_party/chromium/src/base/strings/string16.h
// third_party/chromium/src/googleurl/base/string16.h
// which is troubling wrt to ODR. For now, try to at least get the char type
// from former in place expected by the latter, and have the .gyp #define
// the guard for the later one so it doesn't actually get included.
#include "third_party/chromium/src/base/strings/string16.h"
typedef base::char16 char16;
typedef base::string16 string16;
#endif
+11
View File
@@ -31,8 +31,19 @@
'..',
],
},
'all_dependent_settings': {
'include_dirs': [
'<(DEPTH)/url'
]
},
'include_dirs': [
'<(DEPTH)/url',
],
'defines': [
'URL_IMPLEMENTATION',
# This is a bit of paranoia to make sure this can't load its own copy
# of string16.h rather than chromium one (base/strings/string16).
'BASE_STRING16_H_',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
+2 -2
View File
@@ -12,8 +12,8 @@
#include "third_party/icu/source/common/unicode/ucnv.h"
#include "third_party/icu/source/common/unicode/ucnv_cb.h"
#include "third_party/icu/source/common/unicode/uidna.h"
#include "url/url_canon_icu.h"
#include "url/url_canon_internal.h" // for _itoa_s
#include "third_party/chromium/src/googleurl/src/url_canon_icu.h"
#include "third_party/chromium/src/googleurl/src/url_canon_internal.h" // for _itoa_s
namespace url_canon {
+27 -27
View File
@@ -5,34 +5,34 @@
{
'variables': {
'gurl_sources': [
'<(chromium_root)/url/gurl.cc',
'<(chromium_root)/url/gurl.h',
'<(chromium_root)/url/third_party/mozilla/url_parse.cc',
'<(chromium_root)/url/third_party/mozilla/url_parse.h',
'<(chromium_root)/url/url_canon.h',
'<(chromium_root)/url/url_canon_etc.cc',
'<(chromium_root)/url/url_canon_filesystemurl.cc',
'<(chromium_root)/url/url_canon_fileurl.cc',
'<(chromium_root)/url/url_canon_host.cc',
'<(chromium_root)/googleurl/src/gurl.cc',
'<(chromium_root)/googleurl/src/gurl.h',
'<(chromium_root)/googleurl/src/url_parse.cc',
'<(chromium_root)/googleurl/src/url_parse.h',
'<(chromium_root)/googleurl/src/url_canon.h',
'<(chromium_root)/googleurl/src/url_canon_etc.cc',
'<(chromium_root)/googleurl/src/url_canon_filesystemurl.cc',
'<(chromium_root)/googleurl/src/url_canon_fileurl.cc',
'<(chromium_root)/googleurl/src/url_canon_host.cc',
'./url_canon_icu.cc',
'<(chromium_root)/url/url_canon_icu.h',
'<(chromium_root)/url/url_canon_internal.cc',
'<(chromium_root)/url/url_canon_internal.h',
'<(chromium_root)/url/url_canon_internal_file.h',
'<(chromium_root)/url/url_canon_ip.cc',
'<(chromium_root)/url/url_canon_ip.h',
'<(chromium_root)/url/url_canon_mailtourl.cc',
'<(chromium_root)/url/url_canon_path.cc',
'<(chromium_root)/url/url_canon_pathurl.cc',
'<(chromium_root)/url/url_canon_query.cc',
'<(chromium_root)/url/url_canon_relative.cc',
'<(chromium_root)/url/url_canon_stdstring.cc',
'<(chromium_root)/url/url_canon_stdurl.cc',
'<(chromium_root)/url/url_file.h',
'<(chromium_root)/url/url_parse_file.cc',
'<(chromium_root)/url/url_parse_internal.h',
'<(chromium_root)/url/url_util.cc',
'<(chromium_root)/url/url_util.h',
'<(chromium_root)/googleurl/src/url_canon_icu.h',
'<(chromium_root)/googleurl/src/url_canon_internal.cc',
'<(chromium_root)/googleurl/src/url_canon_internal.h',
'<(chromium_root)/googleurl/src/url_canon_internal_file.h',
'<(chromium_root)/googleurl/src/url_canon_ip.cc',
'<(chromium_root)/googleurl/src/url_canon_ip.h',
'<(chromium_root)/googleurl/src/url_canon_mailtourl.cc',
'<(chromium_root)/googleurl/src/url_canon_path.cc',
'<(chromium_root)/googleurl/src/url_canon_pathurl.cc',
'<(chromium_root)/googleurl/src/url_canon_query.cc',
'<(chromium_root)/googleurl/src/url_canon_relative.cc',
'<(chromium_root)/googleurl/src/url_canon_stdstring.h',
'<(chromium_root)/googleurl/src/url_canon_stdurl.cc',
'<(chromium_root)/googleurl/src/url_file.h',
'<(chromium_root)/googleurl/src/url_parse_file.cc',
'<(chromium_root)/googleurl/src/url_parse_internal.h',
'<(chromium_root)/googleurl/src/url_util.cc',
'<(chromium_root)/googleurl/src/url_util.h',
],
},
}