Commit 64397686 authored by John Budorick's avatar John Budorick Committed by Commit Bot

Revert "build: Pass -fcomplete-member-pointers when building with clang."

This reverts commit 4a2a5c4a.

Reason for revert: seems to be a bit too new of a flag for the xcode version of clang: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/ios-simulator-xcode-clang/51865

Original change's description:
> build: Pass -fcomplete-member-pointers when building with clang.
> 
> This prevents member pointers of incomplete base type from being used in
> cases where they might cause problems under the Microsoft ABI.
> 
> Specifically, the Microsoft ABI has different kinds of member pointers with
> different sizes, and the choice of member pointer representation depends on
> the inheritance hierarchy of the member pointer's base type. C++ allows a
> member pointer's base type to be incomplete, so if it is incomplete at the
> point where a variable of that member pointer type is declared, that forces
> the compiler to pick the most general (i.e. largest) one. That can lead to
> ODR violations since the most general representation wouldn't necessarily
> be the one that would be chosen if the base type happened to be complete at
> the point where the variable was declared. It can also be less size efficient
> because the compiler will generally be able to choose a smaller representation
> than the most general one if it were complete at the point where it is needed.
> 
> This flag also enables additional semantic analysis that we'll need in order
> to correctly implement -fsanitize=cfi for member function pointer calls. This
> is because the inheritance hierarchy of the base type must be available in
> order to make the CFI checks as precise as possible.
> 
> Note that the flag is a -f flag rather than a -W flag. This is because
> requiring member pointer base types to be complete is technically a
> non-conforming language extension, as it may, for example, cause templates
> to be instantiated which would otherwise not be, which may be observable
> after code generation in conforming programs that were crafted to observe
> it. However, the effects of this language extension should not be observable
> in most ordinary programs.
> 
> Bug: 847724
> Change-Id: I8d823fd4a6f21dfcadba55eefc0a69ef2e0c3479
> Reviewed-on: https://chromium-review.googlesource.com/1098217
> Commit-Queue: Peter Collingbourne <pcc@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#567086}

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

Change-Id: Ieb56b1bb4236a874ecc4846eb3ad73a87d9bdf82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 847724
Reviewed-on: https://chromium-review.googlesource.com/1100516Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567094}
parent 7f7dd90b
......@@ -672,13 +672,6 @@ config("compiler") {
ldflags += [ "-Wl,--no-rosegment" ]
}
# This flag enforces that member pointer base types are complete. It helps
# prevent us from running into problems in the Microsoft C++ ABI (see
# https://crbug.com/847724).
if (is_clang && !is_nacl && target_os != "chromeos") {
cflags += [ "-fcomplete-member-pointers" ]
}
# Pass the same C/C++ flags to the objective C/C++ compiler.
cflags_objc += cflags_c
cflags_objcc += cflags_cc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment