HYL_OK3568_LINUX/yocto/meta-browser/meta-chromium/recipes-browser/chromium/files/0008-avoid-link-latomic-failure-on-CentOS-8-host.patch
2025-05-10 21:49:39 +08:00

48 lines
1.8 KiB
Diff

From 0dcae7668b878b7db5da83643a8dfd7709865d3b Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 22 Jan 2021 00:02:25 +0800
Subject: [PATCH] avoid link latomic failure on CentOS 8 host
When host (such as CentOS 8) did not install libatomic, there was a
link failure on native. In fact, only target requires to link atomic,
the native does not. So link atomic for target only
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
base/BUILD.gn | 2 ++
build/config/linux/BUILD.gn | 2 ++
2 files changed, 4 insertions(+)
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 1f0e5cc5f0fae..f75c71d26f727 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1544,7 +1544,9 @@ component("base") {
# Needed for <atomic> if using newer C++ library than sysroot, except if
# building inside the cros_sdk environment - use host_toolchain as a
# more robust check for this.
+ # Only target requires <atomic>
if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos)) &&
+ (current_toolchain != host_toolchain) &&
host_toolchain != "//build/toolchain/cros:host") {
libs += [ "atomic" ]
}
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 131bb71d1d3b8..20f918ab82c9b 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -40,7 +40,9 @@ config("runtime_library") {
defines = [ "OS_CHROMEOS" ]
}
+ # Only target requires <atomic>
if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") &&
+ (current_toolchain != host_toolchain) &&
(!use_custom_libcxx || current_cpu == "mipsel")) {
libs = [ "atomic" ]
}