Exported things should always be visible
This changes our COMPONENT_EXPORT macros to make the things they export visible all the time on non-windows, rather than making them visible in the named component only. This avoids subtle bugs where things defined in multiple components end up with one copy per component, only one of which is visible, and so the linker doesn't know it's supposed to dedup them. Some, but not all, of these issues are detected by the new clang warning -Wunique-object-duplication. This change addresses some instances of that warning firing on chromium code, but not all. Conversely, there are likely instances which the warning does not catch, which are fixed by this CL. Bug: 368047728 Change-Id: I829a9bd84e57e3c7d80ec33aea0408951019bde7 AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6264795 Owners-Override: Avi Drissman <avi@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Devon Loehr <dloehr@google.com> Cr-Commit-Position: refs/heads/main@{#1456614}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
f0fd8115bc
commit
edf5748269
ash
base
allocator
partition_allocator
src
partition_alloc
partition_alloc_base
i18n
test
build/rust/tests
cc
chrome/browser
chromeos
components
captive_portal
capture_mode
cast
cbor
crash
core
common
device_event_log
discardable_memory
domain_reliability
download
public
common
drive
gcm_driver
common
gwp_asan
client
keyed_service
login
metal_util
ownership
policy
prefs
proxy_config
quirks
remote_cocoa
session_manager
sessions
tracing
ui_devtools
url_matcher
user_manager
user_prefs
viz
client
common
host
service
web_modal
webdata
common
wifi
content/common
crypto
dbus
device
base
bluetooth
gamepad
vr
extensions/common
fuchsia_web/webengine
gin
google_apis/gcm/base
gpu
headless/public
ios/web_view/public
ipc
media
mojo
core
public
net/base
ppapi
host
proxy
shared_impl
thunk
remoting/host
sandbox
services
device
public
metrics
public
service_manager
public
cpp
skia/ext
ui
accelerated_widget_mac
accessibility
android
aura
aura_extra
chromeos
compositor
display
events
file_manager
gfx
animation
codec
color_space_export.hgfx_skia_export.hipc
range
switches_export.hgl
message_center
platform_window
shell_dialogs
snapshot
surface
touch_selection
views
views_content_client
web_dialogs
wm
public
url/ipc
@ -15,11 +15,7 @@
|
||||
#endif // defined(COMPONENTS_PREFS_IMPLEMENTATION)
|
||||
|
||||
#else // defined(WIN32)
|
||||
#if defined(COMPONENTS_PREFS_IMPLEMENTATION)
|
||||
#define COMPONENTS_PREFS_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define COMPONENTS_PREFS_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else // defined(COMPONENT_BUILD)
|
||||
|
Reference in New Issue
Block a user