From a3c22e7ee2dbbe789206b76f9431b56790e5b8ca Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Thu, 9 Apr 2020 00:11:53 +0800 Subject: [PATCH] Pass -Brepro ldflag to Windows builds The default build-id is generated using timestamp. Pass -Brepro to avoid using timestamp for deterministic build. Bug: 153462962 Test: build fastboot.exe twice, got same shasum Change-Id: I38fe993eec23c60bfcf1b76188774bfe06839fa4 --- cc/config/x86_windows_host.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go index 43e8c85e8..cd0a50837 100644 --- a/cc/config/x86_windows_host.go +++ b/cc/config/x86_windows_host.go @@ -58,8 +58,11 @@ var ( "-Wl,--dynamicbase", "-Wl,--nxcompat", } + windowsLldflags = []string{ + "-Wl,--Xlink=-Brepro", // Enable deterministic build + } windowsClangLdflags = append(ClangFilterUnknownCflags(windowsLdflags), []string{}...) - windowsClangLldflags = ClangFilterUnknownLldflags(windowsClangLdflags) + windowsClangLldflags = append(ClangFilterUnknownLldflags(windowsClangLdflags), windowsLldflags...) windowsX86Cflags = []string{ "-m32",