Skip to content

Commit 0dfe375

Browse files
build: Use LTO for release builds on Linux (#281)
1 parent ca4a462 commit 0dfe375

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ build:release -c opt
8181
build:release --copt="-DFORCE_DEBUG=1"
8282
build:release --copt="-O2"
8383
build:release --config=stacktraces
84+
85+
build:release-linux --config=release --config=linux
86+
build:release-linux --cxxopt="-flto=thin" --linkopt="-flto=thin"

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ jobs:
9090
echo "build --remote_cache=$CI_BAZEL_REMOTE_CACHE --google_default_credentials"
9191
} > ci.bazelrc
9292
# Comment out the 'upload log' bit below for debugging
93-
bazel build //indexer:scip-clang --config="$CONFIG" # --execution_log_binary_file=log
93+
SUFFIX=""
94+
if [ "$CONFIG" == "release" ]; then
95+
if [ "$(uname -s)" == "Linux" ]; then
96+
SUFFIX="-linux"
97+
fi
98+
fi
99+
bazel build //indexer:scip-clang --config="$CONFIG$SUFFIX" # --execution_log_binary_file=log
94100
if [ "$RUNNER_OS" == "Linux" ]; then
95101
echo "--- GLIBC VERSIONS ---"
96102
objdump -T bazel-bin/indexer/scip-clang | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu

0 commit comments

Comments
 (0)