Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LLD as a linker / develop #10768

Merged
merged 7 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions buildkite/src/Constants/ContainerImages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
-- NOTE: minaToolchainStretch is also used for building Ubuntu Bionic packages in CI
{
toolchainBase = "codaprotocol/ci-toolchain-base:v3",
minaToolchainBullseye = "gcr.io/o1labs-192920/mina-toolchain@sha256:c8469d75e0b2858b25195c44d91ca6e204bae959936bb7bc11c9fab57dfdde7e",
minaToolchainBuster = "gcr.io/o1labs-192920/mina-toolchain@sha256:d4d9bf49c48913d52c18f8aee30c62e7d54b06885c960e552e3431ffd8cdff4d",
minaToolchainStretch = "gcr.io/o1labs-192920/mina-toolchain@sha256:02ecad3476bbf1e1f3c29aa3f26acfef58035ab7320df8007d5f413c5dcba002",
minaToolchainFocal = "gcr.io/o1labs-192920/mina-toolchain@sha256:6d02eb5f3fb419f55b76fd44dfbde72988fd88fd8946cf4dcaba4f3c12a6f49f",
minaToolchainBullseye = "gcr.io/o1labs-192920/mina-toolchain@sha256:88bc6b7fdae563998c88849f8c5133f3dec51dd800f5ea7c6002bc92f7081510",
minaToolchainBuster = "gcr.io/o1labs-192920/mina-toolchain@sha256:c40016dc90b2293b5ec12e24aeea38e19806844bbf5c25661dcdb4049ccb71f7",
minaToolchainStretch = "gcr.io/o1labs-192920/mina-toolchain@sha256:8ce948d43b35ec5559cd0a389ed7e602b8bfc88c598b97b68fca16d586bc93c2",
minaToolchainFocal = "gcr.io/o1labs-192920/mina-toolchain@sha256:0ab44a74ff4331aeb84a352b5d5f4ab7fcc10ebfeb1eba9259201435b1cc7860",
delegationBackendToolchain = "gcr.io/o1labs-192920/delegation-backend-production@sha256:8ca5880845514ef56a36bf766a0f9de96e6200d61b51f80d9f684a0ec9c031f4",
elixirToolchain = "elixir:1.10-alpine",
rustToolchain = "codaprotocol/coda:toolchain-rust-e855336d087a679f76f2dd2bbdc3fdfea9303be3",
Expand Down
5 changes: 5 additions & 0 deletions dockerfiles/stages/1-build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ RUN apt-get update \
curl \
file \
git \
'(^lld-10$|^lld-11$)' \
m4 \
pkg-config \
rsync \
sudo \
unzip \
zlib1g-dev

# Symlink image-specific lld version to a single lld executable
RUN if command -v ld.lld-10 &> /dev/null; then ln -sf $(which ld.lld-10) /usr/bin/ld.lld; fi
RUN if command -v ld.lld-11 &> /dev/null; then ln -sf $(which ld.lld-11) /usr/bin/ld.lld; fi

# --- Create opam user (for later) and give sudo to make opam happy
RUN adduser --uid 65533 --disabled-password --gecos '' opam \
&& passwd -l opam \
Expand Down
2 changes: 1 addition & 1 deletion src/dune.flags.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(env
(_
(flags (:standard -short-paths -cclib -ljemalloc -w @a-4-29-40-41-42-44-45-48-58-59-60-66))))
(flags (:standard -short-paths -ccopt=-fuse-ld=lld -cclib -ljemalloc -w @a-4-29-40-41-42-44-45-48-58-59-60-66))))
2 changes: 1 addition & 1 deletion src/external/ocaml-rocksdb/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
(libraries ctypes ctypes.foreign)
(modules (:standard \ rocks_linker_flags_gen rocks_test))
(c_library_flags (:standard (:include flags.sexp)))
(self_build_stubs_archive (rocksdb))
)

(executable
Expand All @@ -16,6 +15,7 @@

(rule
(targets flags.sexp)
(deps librocksdb_stubs.a)
(action (run ./rocks_linker_flags_gen.exe)))

(rule
Expand Down
6 changes: 4 additions & 2 deletions src/external/ocaml-rocksdb/rocks_linker_flags_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ let () =
; "-lc++abi"
; "-lc++" ]
| "Linux" ->
[ "-Wl,--push-state,-whole-archive"
[ sprintf "-L%s" cwd
; "-fuse-ld=lld"
; "-Wl,--whole-archive"
; "-lrocksdb_stubs"
; "-Wl,--pop-state"
; "-Wl,--no-whole-archive"
; "-lz"
; "-lbz2"
; "-lstdc++" ]
Expand Down