提交 784fe3dd 编写于 作者: J Jason Simmons

Revert to libjpeg_turbo

We had switched to libjpeg, but libjpeg was failing to decode images when
built with the defines in our .gn files
上级 5a32fb63
......@@ -72,6 +72,9 @@ deps = {
'src/third_party/skia':
Var('chromium_git') + '/skia.git' + '@' + Var('skia_revision'),
'src/third_party/libjpeg_turbo':
Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + 'f4631b6ee8b1dbb05e51ae335a7886f9ac598ab6',
'src/third_party/mesa/src':
Var('chromium_git') + '/chromium/deps/mesa.git' + '@' + '071d25db04c23821a12a8b260ab9d96a097402f0',
}
......
......@@ -516,12 +516,12 @@ source_set("platform") {
"//third_party/icu",
"//third_party/libpng",
"//third_party/qcms",
"//third_party/libjpeg",
"//third_party:jpeg",
]
forward_dependent_configs_from = [
"//skia",
"//third_party/libjpeg",
"//third_party:jpeg",
"//third_party/iccjpeg",
"//third_party/libpng",
"//third_party/qcms",
......
......@@ -53,7 +53,9 @@ def to_gn_args(args):
gn_args['target_os'] = 'ios'
gn_args['ios_deployment_target'] = '7.0'
gn_args['use_ios_simulator'] = args.simulator
if not args.simulator:
if args.simulator:
gn_args['use_libjpeg_turbo'] = False
else:
# The iOS simulator snapshot is host targetted
gn_args['dart_target_arch'] = ios_target_cpu
elif args.target_os == 'fnl':
......
# 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.
if (is_android) {
import("//build/config/android/config.gni")
}
declare_args() {
# Uses system libjpeg. If true, overrides use_libjpeg_turbo.
use_system_libjpeg = false
# Uses libjpeg_turbo as the jpeg implementation. Has no effect if
# use_system_libjpeg is set.
use_libjpeg_turbo = true
}
config("system_libjpeg_config") {
defines = [ "USE_SYSTEM_LIBJPEG" ]
}
config("libjpeg_turbo_config") {
defines = [ "USE_LIBJPEG_TURBO" ]
}
# This is a meta target that forwards to the system's libjpeg,
# third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
# declared in this file.
group("jpeg") {
if (use_system_libjpeg) {
libs = [ "jpeg" ]
public_configs = [ ":system_libjpeg_config" ]
} else if (use_libjpeg_turbo) {
deps = [
"//third_party/libjpeg_turbo:libjpeg",
]
public_configs = [ ":libjpeg_turbo_config" ]
} else {
deps = [
"//third_party/libjpeg:libjpeg",
]
}
}
......@@ -14,6 +14,6 @@ source_set("iccjpeg") {
public_configs = [ ":iccjpeg_config" ]
deps = [
"//third_party/libjpeg",
"//third_party:jpeg",
]
}
......@@ -2,6 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Do not use the targets in this file unless you need a certain libjpeg
# implementation. Use the meta target //third_party:jpeg instead.
config("libjpeg_config") {
include_dirs = [ "." ]
}
......
# 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.
# 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) yasm_config -- General build configuration including setting a
# inputs listing the checked in version of files
# generated by manually running configure. These manually
# generated files are used by all binaries.
# 3) yasm_utils -- Object files with memory management and hashing utilities
# shared between yasm and the genperf subprogram.
# 4) genmacro, genmodule, etc. -- One executable target for each subprogram.
# 5) generate_license, generate_module, etc. -- Actions that invoke programs
# built in #4 to generate .c files.
# 6) compile_gperf, compile_re2c, etc. -- Actions that invoke programs that
# turn intermediate files into .c files.
if (current_toolchain == host_toolchain) {
# Various files referenced by multiple targets.
yasm_gen_include_dir = "$target_gen_dir/include"
config_makefile = "source/config/$host_os/Makefile"
version_file = "version.mac"
import("//build/compiled_action.gni")
config("yasm_config") {
include_dirs = [
"source/config/$host_os",
"source/patched-yasm",
]
defines = [ "HAVE_CONFIG_H" ]
if (is_posix) {
cflags = [ "-std=gnu99" ]
}
}
executable("genmacro") {
sources = [
"source/patched-yasm/tools/genmacro/genmacro.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
deps = [
"//build/config/sanitizers:deps",
]
}
executable("genmodule") {
sources = [
"source/patched-yasm/libyasm/genmodule.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
deps = [
"//build/config/sanitizers:deps",
]
}
executable("genperf") {
sources = [
"source/patched-yasm/tools/genperf/genperf.c",
"source/patched-yasm/tools/genperf/perfect.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
deps = [
":yasm_utils",
"//build/config/sanitizers:deps",
]
}
# Used by both yasm and genperf binaries.
source_set("yasm_utils") {
sources = [
"source/patched-yasm/libyasm/phash.c",
"source/patched-yasm/libyasm/xmalloc.c",
"source/patched-yasm/libyasm/xstrdup.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
}
executable("genstring") {
sources = [
"source/patched-yasm/genstring.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
deps = [
"//build/config/sanitizers:deps",
]
}
executable("genversion") {
sources = [
"source/patched-yasm/modules/preprocs/nasm/genversion.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
deps = [
"//build/config/sanitizers:deps",
]
}
executable("re2c") {
sources = [
"source/patched-yasm/tools/re2c/actions.c",
"source/patched-yasm/tools/re2c/code.c",
"source/patched-yasm/tools/re2c/dfa.c",
"source/patched-yasm/tools/re2c/main.c",
"source/patched-yasm/tools/re2c/mbo_getopt.c",
"source/patched-yasm/tools/re2c/parser.c",
"source/patched-yasm/tools/re2c/scanner.c",
"source/patched-yasm/tools/re2c/substr.c",
"source/patched-yasm/tools/re2c/translate.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
# re2c is missing CLOSEVOP from one switch.
if (is_posix) {
cflags = [ "-Wno-switch" ]
}
deps = [
"//build/config/sanitizers:deps",
]
}
executable("yasm") {
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-intel.c",
"source/patched-yasm/modules/parsers/gas/gas-parse.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",
# Files generated by compile_gperf
"$target_gen_dir/x86cpu.c",
"$target_gen_dir/x86regtmod.c",
# Files generated by compile_re2c
"$target_gen_dir/gas-token.c",
"$target_gen_dir/nasm-token.c",
# File generated by compile_re2c_lc3b
"$target_gen_dir/lc3bid.c",
# File generated by generate_module
"$target_gen_dir/module.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
# Yasm generates a bunch of .c files which its source file #include.
# Add the |target_gen_dir| into the include path so it can find them.
# Ideally, these generated .c files would be placed into a separate
# directory, but the gen_x86_insn.py script does not make this easy.
include_dirs = [ yasm_gen_include_dir ]
if (!is_win) {
cflags = [
"-ansi",
"-pedantic",
]
if (is_clang) {
cflags += [ "-Wno-incompatible-pointer-types" ]
}
}
# TODO(ajwong): This should take most of the generated output as
# inputs.
deps = [
":compile_gperf",
":compile_gperf_for_include",
":compile_nasm_macros",
":compile_nasm_version",
":compile_re2c_lc3b",
":compile_win64_gas",
":compile_win64_nasm",
":compile_re2c",
":generate_license",
":generate_module",
":generate_version",
":yasm_utils",
"//build/config/sanitizers:deps",
]
}
compiled_action_foreach("compile_gperf") {
tool = ":genperf"
sources = [
"source/patched-yasm/modules/arch/x86/x86cpu.gperf",
"source/patched-yasm/modules/arch/x86/x86regtmod.gperf",
]
outputs = [
"$target_gen_dir/{{source_name_part}}.c",
]
args = [
"{{source}}",
rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c",
]
deps = [
":generate_x86_insn",
]
}
# This differs from |compile_gperf| in where it places it output files.
compiled_action_foreach("compile_gperf_for_include") {
tool = ":genperf"
sources = [
# Make sure the generated gperf files in $target_gen_dir are synced with
# the outputs for the related generate_*_insn actions in the
# generate_files target below.
#
# The output for these two are #included by
# source/patched-yasm/modules/arch/x86/x86id.c
"$yasm_gen_include_dir/x86insn_gas.gperf",
"$yasm_gen_include_dir/x86insn_nasm.gperf",
]
outputs = [
"$yasm_gen_include_dir/{{source_name_part}}.c",
]
args = [
"{{source}}",
rebase_path(yasm_gen_include_dir, root_build_dir) +
"/{{source_name_part}}.c",
]
deps = [
":generate_x86_insn",
]
}
template("compile_macro") {
compiled_action(target_name) {
tool = ":genmacro"
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
inputs = invoker.sources
outputs = invoker.outputs
args = [
rebase_path(outputs[0], root_build_dir),
invoker.macro_varname,
rebase_path(inputs[0], root_build_dir),
]
if (defined(invoker.deps)) {
deps = invoker.deps
}
}
}
compile_macro("compile_nasm_macros") {
# Output #included by
# source/patched-yasm/modules/preprocs/nasm/nasm-parser.c
sources = [
"source/patched-yasm/modules/parsers/nasm/nasm-std.mac",
]
outputs = [
"$yasm_gen_include_dir/nasm-macros.c",
]
macro_varname = "nasm_standard_mac"
}
compile_macro("compile_nasm_version") {
# Output #included by
# source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c
sources = [
"$target_gen_dir/$version_file",
]
outputs = [
"$yasm_gen_include_dir/nasm-version.c",
]
macro_varname = "nasm_version_mac"
deps = [
":generate_version",
]
}
compile_macro("compile_win64_gas") {
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
sources = [
"source/patched-yasm/modules/objfmts/coff/win64-gas.mac",
]
outputs = [
"$yasm_gen_include_dir/win64-gas.c",
]
macro_varname = "win64_gas_stdmac"
}
compile_macro("compile_win64_nasm") {
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
sources = [
"source/patched-yasm/modules/objfmts/coff/win64-nasm.mac",
]
outputs = [
"$yasm_gen_include_dir/win64-nasm.c",
]
macro_varname = "win64_nasm_stdmac"
}
compiled_action_foreach("compile_re2c") {
tool = ":re2c"
sources = [
"source/patched-yasm/modules/parsers/gas/gas-token.re",
"source/patched-yasm/modules/parsers/nasm/nasm-token.re",
]
outputs = [
"$target_gen_dir/{{source_name_part}}.c",
]
args = [
"-b",
"-o",
rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c",
"{{source}}",
]
}
# This call doesn't fit into the re2c template above.
compiled_action("compile_re2c_lc3b") {
tool = ":re2c"
inputs = [
"source/patched-yasm/modules/arch/lc3b/lc3bid.re",
]
outputs = [
"$target_gen_dir/lc3bid.c",
]
args = [
"-s",
"-o",
rebase_path(outputs[0], root_build_dir),
rebase_path(inputs[0], root_build_dir),
]
}
compiled_action("generate_license") {
tool = ":genstring"
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
inputs = [
"source/patched-yasm/COPYING",
]
outputs = [
"$yasm_gen_include_dir/license.c",
]
args = [
"license_msg",
rebase_path(outputs[0], root_build_dir),
rebase_path(inputs[0], root_build_dir),
]
}
compiled_action("generate_module") {
tool = ":genmodule"
inputs = [
"source/patched-yasm/libyasm/module.in",
config_makefile,
]
outputs = [
"$target_gen_dir/module.c",
]
args = [
rebase_path(inputs[0], root_build_dir),
rebase_path(config_makefile, root_build_dir),
rebase_path(outputs[0], root_build_dir),
]
}
compiled_action("generate_version") {
tool = ":genversion"
outputs = [
"$target_gen_dir/$version_file",
]
args = [ rebase_path(outputs[0], root_build_dir) ]
}
action("generate_x86_insn") {
script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py"
# Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c
outputs = [
"$yasm_gen_include_dir/x86insns.c",
"$yasm_gen_include_dir/x86insn_gas.gperf",
"$yasm_gen_include_dir/x86insn_nasm.gperf",
]
args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ]
}
}
--- frontends/tasm/tasm.c
+++ frontends/tasm/tasm.c
@@ -224,7 +224,9 @@
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
+#if !defined(DONT_EMBED_BUILD_METADATA) || defined(OFFICIAL_BUILD)
"Compiled on " __DATE__ ".",
+#endif
"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,
+#if !defined(DONT_EMBED_BUILD_METADATA) || defined(OFFICIAL_BUILD)
"Compiled on " __DATE__ ".",
+#endif
"Copyright (c) 2001-2011 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};
dalecurtis@chromium.org
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
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.
# 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.
"""A wrapper to run yasm.
Its main job is to provide a Python wrapper for GN integration, and to write
the makefile-style output yasm generates in stdout to a .d file for dependency
management of .inc files.
Run with:
python run_yasm.py <yasm_binary_path> <all other yasm args>
Note that <all other yasm args> must include an explicit output file (-o). This
script will append a ".d" to this and write the dependencies there. This script
will add "-M" to cause yasm to write the deps to stdout, so you don't need to
specify that.
"""
import argparse
import sys
import subprocess
# Extract the output file name from the yasm command line so we can generate a
# .d file with the same base name.
parser = argparse.ArgumentParser()
parser.add_argument("-o", dest="objfile")
options, _ = parser.parse_known_args()
objfile = options.objfile
depfile = objfile + '.d'
# Assemble.
result_code = subprocess.call(sys.argv[1:])
if result_code != 0:
sys.exit(result_code)
# Now generate the .d file listing the dependencies. The -M option makes yasm
# write the Makefile-style dependencies to stdout, but it seems that inhibits
# generating any compiled output so we need to do this in a separate pass.
# However, outputting deps seems faster than actually assembling, and yasm is
# so fast anyway this is not a big deal.
#
# This guarantees proper dependency management for assembly files. Otherwise,
# we would have to require people to manually specify the .inc files they
# depend on in the build file, which will surely be wrong or out-of-date in
# some cases.
deps = subprocess.check_output(sys.argv[1:] + ['-M'])
with open(depfile, "wb") as f:
f.write(deps)
因为 它太大了无法显示 source diff 。你可以改为 查看blob
/* 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"
/* */
/* #undef ENABLE_NLS */
/* 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 */
#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
因为 它太大了无法显示 source diff 。你可以改为 查看blob
/* 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"
/* */
/* #undef ENABLE_NLS */
/* 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. */
#define HAVE_CFLOCALECOPYCURRENT 1
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* 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
/* */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the GNU C Library */
/* #undef HAVE_GNU_C_LIBRARY */
/* Define if you have the iconv() function and it works. */
#define HAVE_ICONV 1
/* 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. */
#define HAVE_MERGESORT 1
/* 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 */
#ifndef _YASM_LIBYASM_STDINT_H
#define _YASM_LIBYASM_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "yasm 0.8.0"
/* generated using gcc -std=gnu99 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
因为 它太大了无法显示 source diff 。你可以改为 查看blob
/* 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 */
#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
此差异已折叠。
/* 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"
/* */
/* #undef ENABLE_NLS */
/* 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. */
#define HAVE_CFLOCALECOPYCURRENT 1
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* 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
/* */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the GNU C Library */
/* #undef HAVE_GNU_C_LIBRARY */
/* Define if you have the iconv() function and it works. */
#define HAVE_ICONV 1
/* 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. */
#define HAVE_MERGESORT 1
/* 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 */
#ifndef _YASM_LIBYASM_STDINT_H
#define _YASM_LIBYASM_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "yasm 0.8.0"
/* generated using gcc -std=gnu99 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
此差异已折叠。
/* 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 "cc -E"
/* */
/* #undef ENABLE_NLS */
/* Define to 1 if you have the `abort' function. */
#define HAVE_ABORT 1
/* */
/* #undef HAVE_CATGETS */
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* 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
/* */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the GNU C Library */
/* #undef HAVE_GNU_C_LIBRARY */
/* 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. */
#define HAVE_MERGESORT 1
/* 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 */
#ifndef _YASM_LIBYASM_STDINT_H
#define _YASM_LIBYASM_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "yasm 1.1.0"
/* generated using gcc -std=gnu99 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
此差异已折叠。
/* 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"
/* */
/* #undef ENABLE_NLS */
/* 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. */
#define HAVE_DIRECT_H 1
/* Define to 1 if you have the `ftruncate' function. */
/* #undef HAVE_FTRUNCATE */
/* 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 0
/* 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. */
/* #undef HAVE_LIBGEN_H */
/* 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. */
/* #undef HAVE_POPEN */
/* 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. */
/* #undef HAVE_STRCASECMP */
/* 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. */
/* #undef HAVE_STRINGS_H */
/* 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. */
/* #undef HAVE_STRSEP */
/* 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. */
/* #undef HAVE_UNISTD_H */
/* 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 */
#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
// Copyright (c) 2011 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.
// YASM is written in C99 and requires <stdint.h> and <inttypes.h>.
#ifndef THIRD_PARTY_YASM_SOURCE_CONFIG_WIN_STDINT_H_
#define THIRD_PARTY_YASM_SOURCE_CONFIG_WIN_STDINT_H_
#if !defined(_MSC_VER)
#error This file should only be included when compiling with MSVC.
#endif
// Define C99 equivalent types.
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
// Define the C99 INT64_C macro that is used for declaring 64-bit literals.
// Technically, these should only be definied when __STDC_CONSTANT_MACROS
// is defined.
#define INT64_C(value) value##LL
#define UINT64_C(value) value##ULL
#endif // THIRD_PARTY_YASM_SOURCE_CONFIG_WIN_STDINT_H_
此差异已折叠。
# 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.
# This provides the yasm_assemble() template which uses YASM to assemble
# assembly files.
#
# Files to be assembled with YASM should have an extension of .asm.
#
# Parameters
#
# yasm_flags (optional)
# [list of strings] Pass additional flags into YASM. These are appended
# to the command line. Note that the target machine type and system is
# already set up based on the current toolchain so you don't need to
# specify these things (see below).
#
# Example: yasm_flags = [ "--force-strict" ]
#
# include_dirs (optional)
# [list of dir names] List of additional include dirs. Note that the
# source root and the root generated file dir is always added, just like
# our C++ build sets up.
#
# Example: include_dirs = [ "//some/other/path", target_gen_dir ]
#
# defines (optional)
# [list of strings] List of defines, as with the native code defines.
#
# Example: defines = [ "FOO", "BAR=1" ]
#
# inputs, deps, visibility (optional)
# These have the same meaning as in an action.
#
# Example
#
# yasm_assemble("my_yasm_target") {
# sources = [
# "ultra_optimized_awesome.asm",
# ]
# include_dirs = [ "assembly_include" ]
# }
if (is_mac || is_ios) {
if (current_cpu == "x86") {
_yasm_flags = [
"-fmacho32",
"-m",
"x86",
]
} else if (current_cpu == "x64") {
_yasm_flags = [
"-fmacho64",
"-m",
"amd64",
]
}
} else if (is_posix) {
if (current_cpu == "x86") {
_yasm_flags = [
"-felf32",
"-m",
"x86",
]
} else if (current_cpu == "x64") {
_yasm_flags = [
"-DPIC",
"-felf64",
"-m",
"amd64",
]
}
} else if (is_win) {
if (current_cpu == "x86") {
_yasm_flags = [
"-DPREFIX",
"-fwin32",
"-m",
"x86",
]
} else if (current_cpu == "x64") {
_yasm_flags = [
"-fwin64",
"-m",
"amd64",
]
}
}
if (is_win) {
asm_obj_extension = "obj"
} else {
asm_obj_extension = "o"
}
template("yasm_assemble") {
# TODO(ajwong): Support use_system_yasm.
assert(defined(invoker.sources), "Need sources defined for $target_name")
# Only depend on YASM on x86 systems. Force compilation of .asm files for
# ARM to fail.
assert(current_cpu == "x86" || current_cpu == "x64")
action_name = "${target_name}_action"
source_set_name = target_name
action_foreach(action_name) {
# Only the source set can depend on this.
visibility = [ ":$source_set_name" ]
script = "//third_party/yasm/run_yasm.py"
sources = invoker.sources
if (defined(invoker.inputs)) {
inputs = invoker.inputs
}
# Executable (first in the args). The binary might be in the root build dir
# (no cross-compiling) or in a toolchain-specific subdirectory of that
# (when cross-compiling).
yasm_label = "//third_party/yasm($host_toolchain)"
args = [ "./" + # Force current dir.
rebase_path(get_label_info(yasm_label, "root_out_dir") + "/yasm",
root_build_dir) ]
# Deps.
deps = [
yasm_label,
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
# Flags.
args += _yasm_flags
if (defined(invoker.yasm_flags)) {
args += invoker.yasm_flags
}
# User defined include dirs go first.
if (defined(invoker.include_dirs)) {
foreach(include, invoker.include_dirs) {
args += [ "-I" + rebase_path(include, root_build_dir) ]
}
}
# Default yasm include dirs. Make it match the native build (source root and
# root generated code directory).
# This goes to the end of include list.
args += [
"-I.",
# Using "//." will produce a relative path "../.." which looks better than
# "../../" which will result from using "//" as the base (although both
# work). This is because rebase_path will terminate the result in a
# slash if the input ends in a slash.
"-I" + rebase_path("//.", root_build_dir),
"-I" + rebase_path(root_gen_dir, root_build_dir),
]
# Extra defines.
if (defined(invoker.defines)) {
foreach(def, invoker.defines) {
args += [ "-D$def" ]
}
}
# Output file.
#
# TODO(brettw) it might be nice if there was a source expansion for the
# path of the source file relative to the source root. Then we could
# exactly duplicate the naming and location of object files from the
# native build, which would be:
# "$root_out_dir/${target_name}.{{source_dir_part}}.$asm_obj_extension"
outputs = [
"$target_out_dir/{{source_name_part}}.o",
]
args += [
"-o",
rebase_path(outputs[0], root_build_dir),
"{{source}}",
]
# The wrapper script run_yasm will write the depfile to the same name as
# the output but with .d appended (like gcc will).
depfile = outputs[0] + ".d"
}
# Gather the .o files into a linkable thing. This doesn't actually link
# anything (a source set just compiles files to link later), but will pass
# the object files generated by the action up the dependency chain.
source_set(source_set_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
sources = get_target_outputs(":$action_name")
deps = [
":$action_name",
]
}
}
# 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
}
......@@ -95,9 +95,9 @@ component("gfx") {
"//base:i18n",
"//skia",
"//third_party/harfbuzz-ng",
"//third_party/libjpeg",
"//third_party/libpng",
"//third_party/zlib",
"//third_party:jpeg",
"//ui/gfx/geometry",
]
public_deps = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册