Forward stdenv only if the C++ standard library is not the compiler default value...
commit65c94f1306725c14131cbdb2526c257a31465b69
authorBo Yang <atry@fb.com>
Mon, 26 Sep 2022 21:31:34 +0000 (26 14:31 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 26 Sep 2022 21:31:34 +0000 (26 14:31 -0700)
treecfa0ac43dffb3505d7dd7e41b18fe71387d449d1
parent216f97c3bd0fb1a93122c53d0de0d89e08241bbc
Forward stdenv only if the C++ standard library is not the compiler default value (#9214)

Summary:
Previously, we unconditionally forward `stdenv` to C++ dependencies, in order to avoid ABI incompatibility between HHVM and dependencies. This is not necessary when the C++ standard library is the compiler default value. For example, on Linux, both clang++ and g++ links libraries with libstdc++ by default, and all nix packages are linked with libstdc++ by default, which should be already ABI compatible with HHVM.

This PR forwards `stdenv` to dependencies only if the C++ standard library is not the compiler default value, i.e. when there is a `-stdlib=` linker flag in `nix-support/libcxx-ldflags` file from the compiler wrapper package.

Pull Request resolved: https://github.com/facebook/hhvm/pull/9214

Test Plan: This PR is tested as part of https://github.com/facebook/hhvm/pull/9129

Reviewed By: alexeyt

Differential Revision: D39702919

Pulled By: Atry

fbshipit-source-id: 7164fc7dbccda028e3648848eadc5941fd142b53
hhvm.nix