From b59d61aa489b3ae6a08cfe5b7684068b644d26f1 Mon Sep 17 00:00:00 2001 From: wrvsrx Date: Tue, 31 Jan 2023 11:40:23 +0800 Subject: [PATCH] cc-wrapper: revert change to `-isystem` --- pkgs/build-support/cc-wrapper/default.nix | 6 +++--- pkgs/development/tools/clang-tools/wrapper | 24 +--------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index cbf199117d30..55be5f3a9d0a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -366,14 +366,14 @@ stdenv.mkDerivation { '' + optionalString (libcxx == null && (useGccForLibs && gccForLibs.langCC or false)) '' for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*; do - echo "-cxx-isystem $dir" >> $out/nix-support/libcxx-cxxflags + echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags done for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*/${targetPlatform.config}; do - echo "-cxx-isystem $dir" >> $out/nix-support/libcxx-cxxflags + echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags done '' + optionalString (libcxx.isLLVM or false) '' - echo "-cxx-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags + echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags echo "-l${libcxx.cxxabi.libName}" >> $out/nix-support/libcxx-ldflags '' diff --git a/pkgs/development/tools/clang-tools/wrapper b/pkgs/development/tools/clang-tools/wrapper index 682cd67a58fa..1008023fdc0d 100755 --- a/pkgs/development/tools/clang-tools/wrapper +++ b/pkgs/development/tools/clang-tools/wrapper @@ -18,31 +18,9 @@ buildcpath() { echo $path${after:+':'}$after } -buildcxxpath() { - local path after - while (( $# )); do - case $1 in - -isystem) - shift - path=$path${path:+':'}$1 - ;; - -cxx-isystem) - shift - path=$path${path:+':'}$1 - ;; - -idirafter) - shift - after=$after${after:+':'}$1 - ;; - esac - shift - done - echo $path${after:+':'}$after -} - export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \ $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include -export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcxxpath ${NIX_CFLAGS_COMPILE} \ +export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \ $(<@clang@/nix-support/libcxx-cxxflags) \ $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include