Skip to content

Commit

Permalink
Revert "Roll clang 365097:368742."
Browse files Browse the repository at this point in the history
This reverts commit 8b43f27.

Reason for revert: Causing crashes in ANGLE's dEQP tests. Likely
related to exception handling on Windows.

See issue for more details.

Bug: 994333

Original change's description:
> Roll clang 365097:368742.
> 
> Extra changes in this update:
> - Update the released clang version to 10.0.0.
> 
> - Move -momit-leaf-frame-pointer next to -fno-omit-frame-pointer
>   since that's where it logically belongs. clang started warning
>   on momit without fno-omit after r365860, but it stopped doing this
>   again in r368728 so this change is no longer needed for the roll.
>   But it's still a nice cleanup.
> 
> - A file in the profile runtime with static init was renamed, do that in the
>   check
> 
> - Disable new -Wno-implicit-float-conversion warning
> 
> - Remove ifdefs for plugins using new ErrorOr API in clang
> 
> - Remove -Wno-error=return-stack-address flag for ToT builds.
> 
> TBR=dpranke
> 
> Binary-Size: crbug.com/992372, compiler update adds 32KB, seems reasonable
> Bug: 983371
> Change-Id: Id6e64948fe4966b486aa77615e19f4f7566f13ed
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751203
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#686837}

TBR=thakis@chromium.org,hans@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 983371
Change-Id: I3e577f9bb0e8c42e29b06b7580fadc80a0529f2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756767
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687472}
  • Loading branch information
null77 authored and Commit Bot committed Aug 15, 2019
1 parent fc758fe commit 90cdc25
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 19 deletions.
34 changes: 24 additions & 10 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,16 @@ config("compiler_codegen") {

if (is_nacl) {
configs += [ "//build/config/nacl:compiler_codegen" ]
} else if (is_posix && !is_mac && !is_ios) {
if (current_cpu == "x86") {
if (is_clang) {
cflags += [
# Else building libyuv gives clang's register allocator issues,
# see llvm.org/PR15798 / crbug.com/233709
"-momit-leaf-frame-pointer",
]
}
}
}

if (current_cpu == "arm64" && is_android) {
Expand Down Expand Up @@ -1508,10 +1518,21 @@ config("default_warnings") {
# Ignore warnings about MSVC optimization pragmas.
# TODO(thakis): Only for no_chromium_code? http://crbug.com/912662
"-Wno-ignored-pragma-optimize",

# TODO(https://crbug.com/989932): Evaluate and possibly enable.
"-Wno-implicit-int-float-conversion",
]
if (llvm_force_head_revision) {
cflags += [
# TODO(https://crbug.com/989932): Evaluate and possibly enable.
"-Wno-implicit-int-float-conversion",

# TODO(https://crbug.com/992458): Fix and re-enable. When rolling
# past clang r368446, do *not* move this out of
# llvm_force_head_revision -- we need to fix all instances before
# rolling, else we lose a valuable pre-existing warning that got
# smarter on clang trunk. (And having a -Wno-error flag instead of
# -Wno-return-stack-address on pinned clang won't fly either.)
"-Wno-error=return-stack-address",
]
}
}
}
}
Expand Down Expand Up @@ -1938,13 +1959,6 @@ config("default_stack_frames") {
if (is_posix || is_fuchsia) {
if (enable_frame_pointers) {
cflags = [ "-fno-omit-frame-pointer" ]

# Omit frame pointers for leaf functions on x86, otherwise building libyuv
# gives clang's register allocator issues, see llvm.org/PR15798 /
# crbug.com/233709
if (is_clang && current_cpu == "x86" && !is_mac && !is_ios) {
cflags += [ "-momit-leaf-frame-pointer" ]
}
} else {
cflags = [ "-fomit-frame-pointer" ]
}
Expand Down
7 changes: 4 additions & 3 deletions build/nocompile.gni
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ if (enable_nocompile_tests) {
"-Wthread-safety",
"-I" + rebase_path("//", root_build_dir),
"-I" + rebase_path(root_gen_dir, root_build_dir),

# TODO(https://crbug.com/989932): Track build/config/compiler/BUILD.gn
"-Wno-implicit-int-float-conversion",
]
if (llvm_force_head_revision) {
# TODO(https://crbug.com/989932): Track build/config/compiler/BUILD.gn
args += [ "-Wno-implicit-int-float-conversion" ]
}
if (sysroot != "") {
args += [
"--sysroot",
Expand Down
7 changes: 6 additions & 1 deletion build/toolchain/toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ if (generate_linker_map) {
declare_args() {
if (is_clang) {
# Clang compiler version. Clang files are placed at version-dependent paths.
clang_version = "10.0.0"
if (llvm_force_head_revision) {
clang_version = "10.0.0"
} else {
# TODO(crbug.com/985289): Remove after rolling past r366427.
clang_version = "9.0.0"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion testing/scripts/check_static_initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# in static initializers.
_LINUX_SI_FILE_WHITELIST = {
'chrome': [
'InstrProfilingRuntime.cpp', # Only in coverage builds, not production.
'InstrProfilingRuntime.cc', # Only in coverage builds, not production.
'atomicops_internals_x86.cc', # TODO(crbug.com/973551): Remove.
'debugallocation_shim.cc', # TODO(crbug.com/973552): Remove.
'iostream.cpp', # TODO(crbug.com/973554): Remove.
Expand Down
9 changes: 9 additions & 0 deletions tools/clang/scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@ def main():
default=sys.platform in ('linux2', 'darwin'))
args = parser.parse_args()

# TODO(crbug.com/985289): Remove when rolling past r366427.
if args.llvm_force_head_revision:
global RELEASE_VERSION
RELEASE_VERSION = '10.0.0'
old_lib_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '9.0.0')
if (os.path.isdir(old_lib_dir)):
print('Removing old lib dir: ' + old_lib_dir)
RmTree(old_lib_dir)

if args.lto_lld and not args.bootstrap:
print('--lto-lld requires --bootstrap')
return 1
Expand Down
14 changes: 10 additions & 4 deletions tools/clang/scripts/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@
# Do NOT CHANGE this if you don't know what you're doing -- see
# https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md
# Reverting problematic clang rolls is safe, though.
CLANG_REVISION = '235339357d3c2cf454e59a994686b45f8190671f'
CLANG_SVN_REVISION = '368742'
CLANG_SUB_REVISION = 1
CLANG_REVISION = 'f7e52fbdb5a7af8ea0808e98458b497125a5eca1'
CLANG_SVN_REVISION = '365097'
CLANG_SUB_REVISION = 8

PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8],
CLANG_SUB_REVISION)
RELEASE_VERSION = '10.0.0'
# TODO(crbug.com/985289): Bump when rolling past r366427.
RELEASE_VERSION = '9.0.0'


CDS_URL = os.environ.get('CDS_CLANG_BUCKET_OVERRIDE',
Expand Down Expand Up @@ -293,6 +294,11 @@ def main():
help='Verify that clang has the passed-in version.')
args = parser.parse_args()

# TODO(crbug.com/985289): Remove when rolling past r366427.
if args.llvm_force_head_revision:
global RELEASE_VERSION
RELEASE_VERSION = '10.0.0'

if args.force_local_build:
print(('update.py --force-local-build is no longer used to build clang; '
'use build.py instead.'))
Expand Down
9 changes: 9 additions & 0 deletions tools/clang/translation_unit/TranslationUnitGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,20 @@ void IncludeFinderPPCallbacks::InclusionDirective(
return;

assert(!current_files_.top().empty());
#ifdef LLVM_FORCE_HEAD_REVISION
const clang::DirectoryEntry* const search_path_entry = getValueOrNull(
source_manager_->getFileManager().getDirectory(search_path));
const clang::DirectoryEntry* const current_file_parent_entry =
(*source_manager_->getFileManager().getFile(current_files_.top().c_str()))
->getDir();
#else
const clang::DirectoryEntry* const search_path_entry =
source_manager_->getFileManager().getDirectory(search_path);
const clang::DirectoryEntry* const current_file_parent_entry =
source_manager_->getFileManager()
.getFile(current_files_.top().c_str())
->getDir();
#endif

// If the include file was found relatively to the current file's parent
// directory or a search path, we need to normalize it. This is necessary
Expand Down

0 comments on commit 90cdc25

Please sign in to comment.