From 04f7cc3880912abb738d3d3bc20e7622a211f25e Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 7 Oct 2021 21:57:09 +0200 Subject: fix(3p): resolve linker issues with clang-compiled C++ packages The point where this broke is likely when llvmPackages_11.stdenv started respecting stdenv.hostPlatform.linker and thus using GNU binutils' ld.bfd for linking. That linker can't deal with clang's C++ ABI. To fix this we introduce a modified version of llvmPackages_11.stdenv which uses llvmPackages_11.bintools for linking purposes (I also aim to upstream this in some form, but am not sure about the details atm, so we'll just do this in the tvl overlay for now). This is the precondition for getting our C++ packages in //third_party to work again. Additionally the following fixes were necessary: * abseil-cpp needed to be updated (by overriding the version from nixpkgs for now, since I can't update the subtree on my own) to fulfill grpc's requirements (grpc 1.41.0 needs abseil-cpp LTS 20210324). * gtest needs a patch from nixpkgs which fixes the path to its include directory for CMake. * We need to build re2 with clang as well, otherwise linking will fail. Fixes b/132. Change-Id: I7b64579fe96451547babe070fd35db398581e49d Reviewed-on: https://cl.tvl.fyi/c/depot/+/3701 Tested-by: BuildkiteCI Reviewed-by: lukegb Reviewed-by: tazjin --- third_party/grpc/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'third_party/grpc') diff --git a/third_party/grpc/default.nix b/third_party/grpc/default.nix index 2914d8d8e7f4..c41e66e58381 100644 --- a/third_party/grpc/default.nix +++ b/third_party/grpc/default.nix @@ -2,14 +2,11 @@ (pkgs.grpc.override { protobuf = depot.third_party.protobuf; - stdenv = pkgs.llvmPackages_11.libcxxStdenv; + stdenv = pkgs.fullLlvm11Stdenv; abseil-cpp = depot.third_party.abseil_cpp; + re2 = depot.third_party.re2; }).overrideAttrs(orig: rec { cmakeFlags = orig.cmakeFlags ++ [ - "-DCMAKE_CXX_STANDARD=17" "-DCMAKE_CXX_STANDARD_REQUIRED=ON" ]; -}) // { - # TODO(b/132): Reenable when linker errors are fixed. - meta.ci = false; -} +}) -- cgit 1.4.1