0

Reland "Fix build with gcc on linux"

This is a reland of commit 61f82f7335
Made is linux specific to avoid MSVC failures.

Original change's description:
> Fix build with gcc on linux
>
> Currently getting the following error:
> ```
> ld: obj/libv8_libbase.a: error adding symbols: archive has no index;
> run ranlib to add one
> ```
>
> Bug: 375973875
> Change-Id: I88db800cdf44dd47491475f1a2c208907c4dd4c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5992052
> Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
> Reviewed-by: Junji Watanabe <jwata@google.com>
> Commit-Queue: Fumitoshi Ukai <ukai@google.com>
> Cr-Commit-Position: refs/heads/main@{#1378811}

Bug: 375973875

Change-Id: I8a364af5650954f9b1d9d232a07815e61c658ebe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000135
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#1379452}
This commit is contained in:
Milad Fa
2024-11-07 04:03:10 +00:00
committed by Chromium LUCI CQ
parent 26d87c43c6
commit ea049d73e2

@ -2306,9 +2306,9 @@ config("export_dynamic") {
# 2. Remove the thin_archive config, so that the .a file actually contains all
# .o files, instead of just references to .o files in the build directoy
config("thin_archive") {
if (is_apple && use_lld) {
if ((is_apple && use_lld) || (is_linux && !is_clang)) {
# The macOS and iOS linker ld64.ldd doesn't support thin archive without
# symbol table.
# symbol table, gcc on linux also throws the error `archive has no index`.
arflags = [
"-T",
"-s",