Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only enable hack buildflag on starboard platforms #4953

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ component("base") {
]
}

if (is_cobalt && enable_cobalt_hacks && is_starboard) {
if (is_cobalt && enable_cobalt_linux_hacks) {
# Find a way to fix the offending customizations instead.
configs -= [ "//build/config/compiler:prevent_unsafe_narrowing" ]
}
Expand Down
6 changes: 3 additions & 3 deletions build/build_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@
#define BUILDFLAG_INTERNAL_COBALT_IS_RELEASE_BUILD() (0)
#endif

#if defined(ENABLE_BUILDFLAG_ENABLE_COBALT_HACKS)
#define BUILDFLAG_INTERNAL_ENABLE_COBALT_HACKS() (1)
#if defined(ENABLE_BUILDFLAG_ENABLE_COBALT_LINUX_HACKS)
#define BUILDFLAG_INTERNAL_ENABLE_COBALT_LINUX_HACKS() (1)
#else
#define BUILDFLAG_INTERNAL_ENABLE_COBALT_HACKS() (0)
#define BUILDFLAG_INTERNAL_ENABLE_COBALT_LINUX_HACKS() (0)
#endif

#if defined(ENABLE_BUILFLAG_IS_ANDROIDTV)
Expand Down
4 changes: 2 additions & 2 deletions cobalt/build/configs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ config("buildflag_defines") {
if (cobalt_is_release_build) {
defines += [ "ENABLE_BUILDFLAG_COBALT_IS_RELEASE_BUILD" ]
}
if (enable_cobalt_hacks) {
defines += [ "ENABLE_BUILDFLAG_ENABLE_COBALT_HACKS" ]
if (enable_cobalt_linux_hacks) {
defines += [ "ENABLE_BUILDFLAG_ENABLE_COBALT_LINUX_HACKS" ]
}
if (is_androidtv) {
defines += [ "ENABLE_BUILFLAG_IS_ANDROIDTV" ]
Expand Down
2 changes: 1 addition & 1 deletion cobalt/build/configs/hacks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
declare_args() {
# Allows for the explicit tracking of changes that should be addressed in a
# timely fashion. Should not be used for most permanent or long-term changes.
enable_cobalt_hacks = is_cobalt
enable_cobalt_linux_hacks = is_cobalt && is_starboard
}
4 changes: 2 additions & 2 deletions starboard/shared/linux/system_network_status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ bool GetOnlineStatus(bool* is_online_ptr, int netlink_fd) {
sa.nl_pid = getpid();
int bind_result = bind(netlink_fd, (struct sockaddr*)&sa, sizeof(sa));
// TODO(cobalt, b/371272304): Re-enable
#if !BUILDFLAG(ENABLE_COBALT_HACKS)
#if !BUILDFLAG(ENABLE_COBALT_LINUX_HACKS)
SB_DCHECK(bind_result == 0);
#endif // !BUILDFLAG(ENABLE_COBALT_HACKS)
#endif // !BUILDFLAG(ENABLE_COBALT_LINUX_HACKS)

char buf[8192];
struct iovec iov;
Expand Down
Loading