cc-wrapper: remove trailing and leading spaces from flags
This commit is contained in:
@@ -786,29 +786,31 @@ stdenvNoCC.mkDerivation {
|
||||
# This confuses libtool. So add it to the compiler tool search
|
||||
# path explicitly.
|
||||
+ optionalString (!nativeTools && !isArocc) ''
|
||||
ccLDFlags=()
|
||||
ccCFlags=()
|
||||
if [ -e "${cc_solib}/lib64" -a ! -L "${cc_solib}/lib64" ]; then
|
||||
ccLDFlags+=" -L${cc_solib}/lib64"
|
||||
ccCFlags+=" -B${cc_solib}/lib64"
|
||||
ccLDFlags+=("-L${cc_solib}/lib64")
|
||||
ccCFlags+=("-B${cc_solib}/lib64")
|
||||
fi
|
||||
ccLDFlags+=" -L${cc_solib}/lib"
|
||||
ccCFlags+=" -B${cc_solib}/lib"
|
||||
ccLDFlags+=("-L${cc_solib}/lib")
|
||||
ccCFlags+=("-B${cc_solib}/lib")
|
||||
|
||||
''
|
||||
+ optionalString (cc.langAda or false && !isArocc) ''
|
||||
touch "$out/nix-support/gnat-cflags"
|
||||
touch "$out/nix-support/gnat-ldflags"
|
||||
basePath=$(echo $cc/lib/*/*/*)
|
||||
ccCFlags+=" -B$basePath -I$basePath/adainclude"
|
||||
ccCFlags+=("-B$basePath" "-I$basePath/adainclude")
|
||||
gnatCFlags="-I$basePath/adainclude -I$basePath/adalib"
|
||||
|
||||
echo "$gnatCFlags" >> $out/nix-support/gnat-cflags
|
||||
''
|
||||
+ ''
|
||||
echo "$ccLDFlags" >> $out/nix-support/cc-ldflags
|
||||
echo "$ccCFlags" >> $out/nix-support/cc-cflags
|
||||
echo "''${ccLDFlags[*]}" >> $out/nix-support/cc-ldflags
|
||||
echo "''${ccCFlags[*]}" >> $out/nix-support/cc-cflags
|
||||
''
|
||||
+ optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) ''
|
||||
echo " -L${libcxx_solib}" >> $out/nix-support/cc-ldflags
|
||||
echo "-L${libcxx_solib}" >> $out/nix-support/cc-ldflags
|
||||
''
|
||||
|
||||
## Prevent clang from seeing /usr/include. There is a desire to achieve this
|
||||
@@ -830,7 +832,7 @@ stdenvNoCC.mkDerivation {
|
||||
&& !targetPlatform.isAndroid
|
||||
)
|
||||
''
|
||||
echo " -nostdlibinc" >> $out/nix-support/cc-cflags
|
||||
echo "-nostdlibinc" >> $out/nix-support/cc-cflags
|
||||
''
|
||||
|
||||
##
|
||||
@@ -867,7 +869,7 @@ stdenvNoCC.mkDerivation {
|
||||
);
|
||||
in
|
||||
optionalString enable_fp ''
|
||||
echo " -fno-omit-frame-pointer ${optionalString enable_leaf_fp "-mno-omit-leaf-frame-pointer "}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-fno-omit-frame-pointer${optionalString enable_leaf_fp " -mno-omit-leaf-frame-pointer"}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user