summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nick Desaulniers <ndesaulniers@google.com> 2020-01-29 16:20:11 -0800
committer Nick Desaulniers <ndesaulniers@google.com> 2020-01-29 16:28:06 -0800
commit18eeffa4ce2bc9f492b7b74942aef2bb418b578c (patch)
tree1757447f1f344101f5164e63ad6eab4558bc1e9d
parent7b2970536ee3d9a6db06ff550344ccf077287558 (diff)
build: soong: windres: use clang to preprocess
Otherwise binaries under: prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/ are being invoked. https://sourceware.org/binutils/docs-2.33.1/binutils/windres.html states: When windres reads an rc file, it runs it through the C preprocessor first. Use the `--preprocessor` flag to specify the exact command to run. The args to the preprocessor get wiped out when setting that flag, so `-E -xc-header -DRC_INVOKED` must be re-passed, else clang will error as it tries to invoke ld. Once AOSP packages llvm-rc, aosp/1206346 can be rebased on top, so this patch should be a short lived change. Bug: 147295872 Test: <remove mingw gcc> && lunch aosp_x86-eng && \ cd external/mdnsresponder && mm Change-Id: Ic0e6b75e7e964ee9f9757e534cddd16438604c34 Suggested-by: Pirama Arumuga Nainar <pirama@google.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
-rw-r--r--cc/builder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cc/builder.go b/cc/builder.go
index 5f0da5ff7..0f57a48cb 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -178,7 +178,7 @@ var (
windres = pctx.AndroidStaticRule("windres",
blueprint.RuleParams{
- Command: "$windresCmd $flags -I$$(dirname $in) -i $in -o $out",
+ Command: "$windresCmd $flags -I$$(dirname $in) -i $in -o $out --preprocessor \"${config.ClangBin}/clang -E -xc-header -DRC_INVOKED\"",
CommandDeps: []string{"$windresCmd"},
},
"windresCmd", "flags")