From 32e3bcdea8dacf268418bf3f76da4d0b04b96628 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Tue, 10 Oct 2023 17:28:14 -0400 Subject: [PATCH] Enable function and data sections --- .bazelrc | 3 +++ BUILD | 5 ++++- rbe_platform/BUILD | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index eb7d2db..7485cb9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -34,7 +34,10 @@ build --features=thin_lto # ThinLTO feature doesn't exist in Zig toolchain, so we must set the flags manually. # It also doesn't support LTO on darwin targets, so we can't set this globally. # Instead, we configure copt/linkopt inside the toolchain itself (with a WORKSPACE patch). +#build --copt -flto=thin # Compilation Flags build -c opt build --strip=always +build --copt -ffunction-sections +build --copt -fdata-sections diff --git a/BUILD b/BUILD index f005bef..0bd3d9f 100644 --- a/BUILD +++ b/BUILD @@ -13,6 +13,8 @@ pkg_files( ) # These are no needed for a minimal distribution. +# TODO(zbarsky): We don't really need to build minimal distribution, the compressed size it the same. +# Keeping this support for now since it will be useful when building additional tools outside the core distribution like clang-tidy, etc. TIER2_BINS = [ "llvm-cov", "llvm-dwp", @@ -77,7 +79,8 @@ PLATFORMS = [ name = "for_" + platform.split(":")[1], srcs = [ ":dist", - ":dist_minimal", + # The minimal dist is the same size compressed as the normal one. + # ":dist_minimal", ], target_platform = platform, ) diff --git a/rbe_platform/BUILD b/rbe_platform/BUILD index e83ea5d..d428204 100644 --- a/rbe_platform/BUILD +++ b/rbe_platform/BUILD @@ -9,7 +9,9 @@ platform( "@bazel_tools//tools/cpp:clang", ], exec_properties = { - "container-image": "docker://l.gcr.io/google/rbe-ubuntu16-04@sha256:f6568d8168b14aafd1b707019927a63c2d37113a03bcee188218f99bd0327ea1", + # Buildbuddy guarantees they pre-cache this image. + "container-image": "docker://gcr.io/flame-public/executor-docker-default:latest", + #"container-image": "docker://l.gcr.io/google/rbe-ubuntu16-04@sha256:f6568d8168b14aafd1b707019927a63c2d37113a03bcee188218f99bd0327ea1", "OSFamily": "Linux", }, )