Commit 75d6a6a7 authored by Uri Baghin's avatar Uri Baghin
Browse files

bazel_5: get libtool from path

We're resolving most cc toolchain tools from the path and environment variables, but we hardcode libtool. This makes it hard to point libtool to the specific one you need, for example to work around issues like
https://github.com/NixOS/nixpkgs/pull/180251#issuecomment-1200096413. Make it consistent by getting libtool from path too, like other cc toolchain tools.
parent 3f507855
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -377,9 +377,10 @@ stdenv.mkDerivation rec {
      # invocations of gcc to clang, but vanilla clang doesn't
      sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl

      sed -i -e 's;/usr/bin/libtool;${cctools}/bin/libtool;g' tools/cpp/unix_cc_configure.bzl
      sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
      wrappers=( tools/cpp/osx_cc_wrapper.sh tools/cpp/osx_cc_wrapper.sh.tpl )
      for wrapper in "''${wrappers[@]}"; do
        sed -i -e "s,/usr/bin/gcc,${stdenv.cc}/bin/clang,g" $wrapper
        sed -i -e "s,/usr/bin/install_name_tool,${cctools}/bin/install_name_tool,g" $wrapper
      done
    '';