From 5c6d164f1fe951c81b49839b5092fb6703b9c63a Mon Sep 17 00:00:00 2001 From: Niranjan Yardi Date: Mon, 25 Nov 2024 14:29:49 -0800 Subject: [PATCH] WIP changes --- build/config/BUILD.gn | 2 +- build/config/c++/BUILD.gn | 1 + buildtools/third_party/libc++/BUILD.gn | 2 +- buildtools/third_party/libc++abi/BUILD.gn | 2 +- cobalt/build/configs/BUILD.gn | 3 +++ starboard/BUILD.gn | 12 +++++------- starboard/build/config/modular/BUILD.gn | 12 +++++++----- starboard/build/config/modular/x64/BUILD.gn | 2 ++ third_party/llvm-project/compiler-rt/BUILD.gn | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 749b0855ff2a..c6676d58f27d 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -246,7 +246,7 @@ group("common_deps") { } if (use_custom_libcxx) { - public_deps += [ "//buildtools/third_party/libc++" ] + public_deps += [ "//buildtools/third_party/libc++:cxx" ] } if (use_afl) { diff --git a/build/config/c++/BUILD.gn b/build/config/c++/BUILD.gn index c00dcef4cd1e..9c8132349c37 100644 --- a/build/config/c++/BUILD.gn +++ b/build/config/c++/BUILD.gn @@ -68,6 +68,7 @@ config("runtime_library") { "-isystem" + rebase_path("$libcxx_prefix/include", root_build_dir), "-isystem" + rebase_path("$libcxxabi_prefix/include", root_build_dir), ] + # print(cflags_cc, "cfalg_cc") cflags_objcc = cflags_cc diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn index 3a1f91c02f77..5ab744f71265 100644 --- a/buildtools/third_party/libc++/BUILD.gn +++ b/buildtools/third_party/libc++/BUILD.gn @@ -52,7 +52,7 @@ config("cxx_config") { include_dirs = [ "trunk/include", "trunk/src", - "//buildtools/third_party/libc++abi/trunk/include", + "//buildtools/third_party/libc++abi/trunk/include/include", ] } diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn index 471f7643e587..4fd065bce30b 100644 --- a/buildtools/third_party/libc++abi/BUILD.gn +++ b/buildtools/third_party/libc++abi/BUILD.gn @@ -53,7 +53,7 @@ config("cxxabi_config") { ] include_dirs = [ - "trunk/include", + "trunk/include/include", "//buildtools/third_party/libc++/trunk/src", ] } diff --git a/cobalt/build/configs/BUILD.gn b/cobalt/build/configs/BUILD.gn index 8fecc74e25f9..da5382f94f0c 100644 --- a/cobalt/build/configs/BUILD.gn +++ b/cobalt/build/configs/BUILD.gn @@ -22,6 +22,9 @@ config("cobalt_config") { if (current_toolchain == starboard_toolchain) { configs += [ "//${starboard_path}/platform_configuration" ] } + if (current_toolchain == cobalt_toolchain && sb_is_modular) { + configs += [ "//starboard/build/config/modular/x64" ] + } defines = [ "ENABLE_BUILDFLAG_IS_COBALT", diff --git a/starboard/BUILD.gn b/starboard/BUILD.gn index 397aa9a92b37..d7659f7a2584 100644 --- a/starboard/BUILD.gn +++ b/starboard/BUILD.gn @@ -102,7 +102,7 @@ if (!is_cobalt) { "//starboard/tools:build_app_launcher_zip", ] } - +} else { group("starboard_group") { deps = [] public_deps = [ @@ -113,8 +113,10 @@ if (!is_cobalt) { if (sb_is_modular && current_toolchain == cobalt_toolchain) { public_deps += [ "//third_party/llvm-project/compiler-rt:compiler_rt", - "//third_party/llvm-project/libcxx:cxx", - "//third_party/llvm-project/libcxxabi:cxxabi", + + # TODO: Talk about this with yavor/andrew + # "//third_party/llvm-project/libcxx:cxx", + # "//third_party/llvm-project/libcxxabi:cxxabi", "//third_party/musl:c", ] @@ -167,10 +169,6 @@ if (!is_cobalt) { } } } -} else { - group("starboard_group") { - deps = [ "//starboard($starboard_toolchain)" ] - } } source_set("starboard_headers_only") { diff --git a/starboard/build/config/modular/BUILD.gn b/starboard/build/config/modular/BUILD.gn index aa288c5478dc..ef012cef437f 100644 --- a/starboard/build/config/modular/BUILD.gn +++ b/starboard/build/config/modular/BUILD.gn @@ -18,19 +18,21 @@ config("modular") { "-ffunction-sections", "-fdata-sections", "-nostdlibinc", - "-isystem" + rebase_path("//third_party/llvm-project/libcxxabi/include", - root_build_dir), + + # "-isystem" + rebase_path("//third_party/llvm-project/libcxxabi/include", + # root_build_dir), "-isystem" + rebase_path("//third_party/llvm-project/libunwind/include", root_build_dir), - "-isystem" + rebase_path("//third_party/llvm-project/libcxx/include", - root_build_dir), + + # "-isystem" + rebase_path("//third_party/llvm-project/libcxx/include", + # root_build_dir), "-isystem" + rebase_path("//third_party/musl/include", root_build_dir), "-isystem" + rebase_path("//third_party/musl/arch/generic", root_build_dir), ] cflags += [ "-fPIC" ] - cflags_cc = [ "-nostdinc++" ] + # cflags_cc = [ "-nostdinc++" ] defines = [ # Ensure that the Starboardized __external_threading file is included. diff --git a/starboard/build/config/modular/x64/BUILD.gn b/starboard/build/config/modular/x64/BUILD.gn index 78b0d7481c2c..e680bd8b4e67 100644 --- a/starboard/build/config/modular/x64/BUILD.gn +++ b/starboard/build/config/modular/x64/BUILD.gn @@ -29,4 +29,6 @@ config("x64") { cflags = [ "-isystem" + rebase_path("//third_party/musl/arch/x86_64", root_build_dir) ] + + ldflags = [ "-Wl,--gc-sections" ] } diff --git a/third_party/llvm-project/compiler-rt/BUILD.gn b/third_party/llvm-project/compiler-rt/BUILD.gn index 2887ebfd7373..852860e3bfc6 100644 --- a/third_party/llvm-project/compiler-rt/BUILD.gn +++ b/third_party/llvm-project/compiler-rt/BUILD.gn @@ -92,5 +92,5 @@ static_library("compiler_rt") { } configs += [ ":compiler_rt_config" ] - configs -= [ "//starboard/build/config:default_cpp_standard" ] + # configs -= [ "//starboard/build/config:default_cpp_standard" ] }