ltmain.in: Pass through -fdiagnostics-color, -frecord-gcc-switches

* -fdiagnostics-color: who doesn't like color? No reason to strip it. This
  makes the link phase stick out like a sore thumb if there's warnings emitted.

* -frecord-gcc-switches: we use it in Gentoo to check if a package respects
  *FLAGS. Note that we do not need to include -grecord-gcc-switches explicitly
  here as -g* is already whitelisted.

* build-aux/ltmain.in: Handle -fdiagnostics-color* & -frecord-gcc-switches.
This commit is contained in:
Sam James 2024-01-14 06:27:33 +00:00 committed by Mike Frysinger
parent e01c0bfe5e
commit 533d816dea

View File

@ -5406,6 +5406,8 @@ func_mode_link ()
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang # -stdlib=* select c++ std lib with clang
# -fdiagnostics-color* simply affects output
# -frecord-gcc-switches used to verify flags were respected
# -fsanitize=* Clang/GCC memory and address sanitizer # -fsanitize=* Clang/GCC memory and address sanitizer
# -fno-sanitize* Clang/GCC memory and address sanitizer # -fno-sanitize* Clang/GCC memory and address sanitizer
# -shared-libsan Link with shared sanitizer runtimes (Clang) # -shared-libsan Link with shared sanitizer runtimes (Clang)
@ -5417,6 +5419,7 @@ func_mode_link ()
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
-fdiagnostics-color*|-frecord-gcc-switches| \
-fuse-ld=*|-Wa,*|-Werror|-Werror=*) -fuse-ld=*|-Wa,*|-Werror|-Werror=*)
func_quote_arg pretty "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_arg_result arg=$func_quote_arg_result