-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-subtree-dir: third_party/libxml git-subtree-split: abb3b00ed5496bfe4d0183dcd5cc6313f608416a
- Loading branch information
0 parents
commit cd2fb8f
Showing
1,319 changed files
with
312,728 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,325 @@ | ||
# Copyright (c) 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. | ||
|
||
# Define an "os_include" variable that points at the OS-specific generated | ||
# headers. These were generated by running the configure script offline. | ||
if (is_linux || is_chromeos || is_android || is_nacl || is_fuchsia) { | ||
os_include = "linux" | ||
} else if (is_apple) { | ||
os_include = "mac" | ||
} else if (is_win) { | ||
os_include = "win32" | ||
} | ||
|
||
import("//third_party/libxml/libxml_visibility.gni") | ||
|
||
config("libxml_config") { | ||
# Define LIBXML_STATIC as nothing to match how libxml.h (an internal header) | ||
# defines LIBXML_STATIC, otherwise we get the macro redefined warning from | ||
# GCC. ("defines" does "-DFOO" which defines the macro FOO as 1.) | ||
cflags = [ "-DLIBXML_STATIC=" ] | ||
|
||
include_dirs = [ | ||
"src/include", | ||
"$os_include/include", | ||
] | ||
} | ||
|
||
config("libxml_warnings") { | ||
if (is_win) { | ||
cflags_c = [ | ||
"/wd4018", # Signed/unsigned mismatch in comparison. | ||
"/wd4267", # TODO(brucedawson): http://crbug.com/554200 fix C4267 | ||
"/wd4311", # and C4311 warnings. | ||
] | ||
} | ||
if (is_clang) { | ||
cflags = [ | ||
# libxml passes `const unsigned char*` through `const char*`. | ||
"-Wno-pointer-sign", | ||
|
||
# pattern.c and uri.c both have an intentional `for (...);` / | ||
# `while(...);` loop. I submitted a patch to move the `'` to its own | ||
# line, but until that's landed suppress the warning: | ||
"-Wno-empty-body", | ||
|
||
# debugXML.c compares array 'arg' to NULL. | ||
"-Wno-tautological-pointer-compare", | ||
|
||
# threads.c attempts to forward declare a pthread_equal which doesn't | ||
# match the prototype in pthreads.h | ||
"-Wno-ignored-attributes", | ||
|
||
# libxml casts from int to long to void*. | ||
"-Wno-int-to-void-pointer-cast", | ||
|
||
# libxml passes a volatile LPCRITICAL_SECTION* to a function expecting | ||
# a void* volatile*. | ||
"-Wno-incompatible-pointer-types", | ||
|
||
# trio_is_special_quantity and trio_is_negative are only | ||
# used with certain preprocessor defines set. | ||
"-Wno-unused-function", | ||
|
||
# Comparison between xmlElementType and xmlXPathTypeVal. | ||
# TODO(hans): See if we can fix upstream (http://crbug.com/763944). | ||
"-Wno-enum-compare", | ||
] | ||
} else if (is_linux || is_chromeos) { | ||
cflags = [ | ||
# gcc spits out a bunch of warnings about passing too many arguments to | ||
# __xmlSimpleError. | ||
"-Wno-format-extra-args", | ||
] | ||
} | ||
} | ||
|
||
static_library("xml_reader") { | ||
# Do not expand this visibility list without first consulting with the | ||
# Security Team. | ||
visibility = [ | ||
"//base/test:test_support", | ||
"//components/policy/core/common:unit_tests", | ||
"//services/data_decoder:*", | ||
"//tools/traffic_annotation/auditor:auditor_sources", | ||
] | ||
if (is_win) { | ||
visibility += [ "//components/wifi" ] | ||
} | ||
sources = [ | ||
"chromium/xml_reader.cc", | ||
"chromium/xml_reader.h", | ||
] | ||
deps = [ | ||
":libxml", | ||
":libxml_utils", | ||
] | ||
configs += [ ":libxml_config" ] | ||
} | ||
|
||
static_library("xml_writer") { | ||
# The XmlWriter is considered safe to use from any target. | ||
visibility = [ "*" ] | ||
sources = [ | ||
"chromium/xml_writer.cc", | ||
"chromium/xml_writer.h", | ||
] | ||
deps = [ | ||
":libxml", | ||
":libxml_utils", | ||
] | ||
configs += [ ":libxml_config" ] | ||
} | ||
|
||
static_library("libxml_utils") { | ||
# Do not expand this visibility list without first consulting with the | ||
# Security Team. | ||
visibility = [ | ||
":xml_reader", | ||
":xml_writer", | ||
"//base/test:test_support", | ||
"//services/data_decoder:xml_parser_fuzzer", | ||
] | ||
sources = [ | ||
"chromium/libxml_utils.cc", | ||
"chromium/libxml_utils.h", | ||
] | ||
deps = [ ":libxml" ] | ||
public_deps = [ "//third_party/icu:icuuc" ] | ||
public_configs = [ ":libxml_config" ] | ||
} | ||
|
||
static_library("libxml") { | ||
# Do not expand this visibility list without first consulting with the | ||
# Security Team. | ||
visibility = [ | ||
":libxml_utils", | ||
":xml_reader", | ||
":xml_writer", | ||
"//chromecast/internal", | ||
"//testing/libfuzzer/*", | ||
"//third_party/blink/renderer/*", | ||
"//third_party/fontconfig", | ||
"//third_party/libxslt", | ||
"//third_party/maldoca/*", | ||
] | ||
if (is_ios) { | ||
foreach(tgt, ios_libxml_visibility_additions) { | ||
visibility += [ "//ios_internal/$tgt" ] | ||
} | ||
} | ||
|
||
output_name = "libxml2" | ||
|
||
# Commented out sources are libxml2 files we do not want to include. They are | ||
# here to make it easy to identify files which are new. | ||
sources = [ | ||
#"src/DOCBparser.c", | ||
"src/HTMLparser.c", | ||
"src/HTMLtree.c", | ||
|
||
#"src/SAX.c", | ||
"src/SAX2.c", | ||
"src/buf.c", | ||
"src/buf.h", | ||
|
||
#"src/c14n.c", | ||
#"src/catalog.c", | ||
"src/chvalid.c", | ||
|
||
#"src/debugXML.c", | ||
"src/dict.c", | ||
"src/elfgcchack.h", | ||
"src/enc.h", | ||
"src/encoding.c", | ||
"src/entities.c", | ||
"src/error.c", | ||
"src/globals.c", | ||
"src/hash.c", | ||
"src/include/libxml/DOCBparser.h", | ||
"src/include/libxml/HTMLparser.h", | ||
"src/include/libxml/HTMLtree.h", | ||
"src/include/libxml/SAX.h", | ||
"src/include/libxml/SAX2.h", | ||
"src/include/libxml/c14n.h", | ||
"src/include/libxml/catalog.h", | ||
"src/include/libxml/chvalid.h", | ||
"src/include/libxml/debugXML.h", | ||
"src/include/libxml/dict.h", | ||
"src/include/libxml/encoding.h", | ||
"src/include/libxml/entities.h", | ||
"src/include/libxml/globals.h", | ||
"src/include/libxml/hash.h", | ||
"src/include/libxml/list.h", | ||
"src/include/libxml/nanoftp.h", | ||
"src/include/libxml/nanohttp.h", | ||
"src/include/libxml/parser.h", | ||
"src/include/libxml/parserInternals.h", | ||
"src/include/libxml/pattern.h", | ||
"src/include/libxml/relaxng.h", | ||
"src/include/libxml/schemasInternals.h", | ||
"src/include/libxml/schematron.h", | ||
"src/include/libxml/threads.h", | ||
"src/include/libxml/tree.h", | ||
"src/include/libxml/uri.h", | ||
"src/include/libxml/valid.h", | ||
"src/include/libxml/xinclude.h", | ||
"src/include/libxml/xlink.h", | ||
"src/include/libxml/xmlIO.h", | ||
"src/include/libxml/xmlautomata.h", | ||
"src/include/libxml/xmlerror.h", | ||
"src/include/libxml/xmlexports.h", | ||
"src/include/libxml/xmlmemory.h", | ||
"src/include/libxml/xmlmodule.h", | ||
"src/include/libxml/xmlreader.h", | ||
"src/include/libxml/xmlregexp.h", | ||
"src/include/libxml/xmlsave.h", | ||
"src/include/libxml/xmlschemas.h", | ||
"src/include/libxml/xmlschemastypes.h", | ||
"src/include/libxml/xmlstring.h", | ||
"src/include/libxml/xmlunicode.h", | ||
"src/include/libxml/xmlwriter.h", | ||
"src/include/libxml/xpath.h", | ||
"src/include/libxml/xpathInternals.h", | ||
"src/include/libxml/xpointer.h", | ||
|
||
#"src/legacy.c", | ||
"src/libxml.h", | ||
"src/list.c", | ||
"src/parser.c", | ||
"src/parserInternals.c", | ||
"src/pattern.c", | ||
|
||
#"src/relaxng.c", | ||
"src/save.h", | ||
|
||
#"src/schematron.c", | ||
"src/threads.c", | ||
"src/timsort.h", | ||
"src/tree.c", | ||
"src/triodef.h", | ||
"src/trionan.h", | ||
|
||
#"src/trio.c", | ||
#"src/trio.h", | ||
#"src/triodef.h", | ||
# Note: xpath.c #includes trionan.c | ||
#"src/trionan.c", | ||
#"src/triop.h", | ||
#"src/triostr.c", | ||
#"src/triostr.h", | ||
"src/uri.c", | ||
"src/valid.c", | ||
|
||
#"src/xinclude.c", | ||
#"src/xlink.c", | ||
"src/xmlIO.c", | ||
"src/xmlmemory.c", | ||
|
||
#"src/xmlmodule.c", | ||
"src/xmlreader.c", | ||
|
||
#"src/xmlregexp.c", | ||
"src/xmlsave.c", | ||
|
||
#"src/xmlschemas.c", | ||
#"src/xmlschemastypes.c", | ||
"src/xmlstring.c", | ||
"src/xmlunicode.c", | ||
"src/xmlwriter.c", | ||
"src/xpath.c", | ||
|
||
#"src/xpointer.c", | ||
#"src/xzlib.c", | ||
"src/xzlib.h", | ||
] | ||
|
||
configs -= [ "//build/config/compiler:chromium_code" ] | ||
configs += [ | ||
"//build/config/compiler:no_chromium_code", | ||
|
||
# Must be after no_chromium_code for warning flags to be ordered correctly. | ||
":libxml_warnings", | ||
] | ||
|
||
if (is_linux || is_chromeos) { | ||
sources += [ | ||
"linux/config.h", | ||
"linux/include/libxml/xmlversion.h", | ||
] | ||
} | ||
|
||
if (is_mac) { | ||
sources += [ | ||
"mac/config.h", | ||
"mac/include/libxml/xmlversion.h", | ||
] | ||
} | ||
|
||
if (is_win) { | ||
sources += [ | ||
"src/include/win32config.h", | ||
"src/include/wsockcompat.h", | ||
"win32/config.h", | ||
"win32/include/libxml/xmlversion.h", | ||
] | ||
|
||
# libxml2 already defines WIN32_LEAN_AND_MEAN. | ||
configs -= [ "//build/config/win:lean_and_mean" ] | ||
} | ||
|
||
public_configs = [ ":libxml_config" ] | ||
public_deps = [ "//third_party/icu:icuuc" ] | ||
deps = [ "//third_party/zlib" ] | ||
|
||
if (is_apple || is_android || is_fuchsia) { | ||
# http://www.xmlsoft.org/threads.html says that this is required when using | ||
# libxml from several threads, which can possibly happen in chrome. On | ||
# linux, this is picked up by transitivity from pkg-config output from | ||
# build/linux/system.gyp. | ||
defines = [ "_REENTRANT" ] | ||
} | ||
|
||
include_dirs = [ "$os_include" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
'+libxml', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
monorail: { | ||
component: "Blink>XML" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# There's no real owners here. If you're familiar with the code please send | ||
# a CL to add yourself here. | ||
[email protected] | ||
[email protected] | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Name: libxml | ||
URL: http://xmlsoft.org | ||
Version: dea91c97debeac7c1aaf9c19f79029809e23a353 | ||
CPEPrefix: cpe:/a:xmlsoft:libxml2:2.9.12 | ||
License: MIT | ||
License File: src/Copyright | ||
Security Critical: yes | ||
|
||
Description: | ||
|
||
libxml2 from libxml.org. | ||
|
||
Modifications: | ||
|
||
- chromium-issue-599427.patch: workaround for VS 2015 Update 2 code-gen bug | ||
- chromium-issue-628581.patch: See https://crbug.com/628581#c18 | ||
- chromium-issue-894933.patch: Use ptrdiff_t instead of unsigned long for | ||
pointer differences in parser.c | ||
- libxml2-2.9.4-security-CVE-2017-7376-nanohttp-out-of-bounds-write.patch: | ||
See https://crbug.com/708433 | ||
- libxml2-2.9.4-security-xpath-nodetab-uaf.patch: See https://crbug.com/705445 | ||
- chromium-issue-708434.patch: Guard against input counter overflow. | ||
- chromium-issue-1138555.patch: Change TRUE to 1 for ICU68 which remove the | ||
#define of TRUE. | ||
- Add helper classes in the chromium/ subdirectory. | ||
- Delete various unused files, see chromium/roll.py | ||
|
||
This import was generated by the chromium/roll.py script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- a/xmlstring.c 2016-05-13 17:24:58.870079372 +0900 | ||
+++ b/xmlstring.c 2016-04-25 13:58:09.879238595 +0900 | ||
@@ -835,16 +835,20 @@ | ||
while ( len-- > 0) { | ||
if ( !*ptr ) | ||
break; | ||
- if ( (ch = *ptr++) & 0x80) | ||
- while ((ch<<=1) & 0x80 ) { | ||
- if (*ptr == 0) break; | ||
+ if ( (ch = *ptr++) & 0x80) { | ||
+ // Workaround for an optimization bug in VS 2015 Update 2, remove | ||
+ // once the fix is released. crbug.com/599427 | ||
+ // https://connect.microsoft.com/VisualStudio/feedback/details/2582138 | ||
+ xmlChar ch2 = ch; | ||
+ while ((ch2<<=1) & 0x80 ) { | ||
ptr++; | ||
- } | ||
+ if (*ptr == 0) break; | ||
+ } | ||
+ } | ||
} | ||
return (ptr - utf); | ||
} | ||
|
||
- | ||
/** | ||
* xmlUTF8Strndup: | ||
* @utf: the input UTF8 * |
Oops, something went wrong.