Skip to content

Commit

Permalink
cc-wrapper: Enter C++ mode when -lc++ is passed
Browse files Browse the repository at this point in the history
When linking C++ programs in LLVM we're currently explicitly passing
in -lc++abi as this appears to be required by recent versions of
Clang. However, it also appears to b common for packages to use
the C compiler to link binaries which uses C++, in which case they
do pass in -lc++. This changes the wrapper to also take this into
consideration and enter "C++ mode" whenever -lc++ is passed as an
argument.

Fixes #166205
  • Loading branch information
judofyr committed Nov 24, 2023
1 parent 9c362ea commit 86e6142
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/build-support/cc-wrapper/cc-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ while (( "$n" < "$nParams" )); do
-nostdlib) cxxLibrary=0 ;;
-x*-header) dontLink=1 ;; # both `-x c-header` and `-xc-header` are accepted by clang
-xc++*) isCxx=1 ;; # both `-xc++` and `-x c++` are accepted by clang
-lc++*) isCxx=1 ;;
-x)
case "$p2" in
*-header) dontLink=1 ;;
Expand Down

0 comments on commit 86e6142

Please sign in to comment.