From c31c677f0b7ce8cba0df4942ddc8ca1321cf5166 Mon Sep 17 00:00:00 2001 From: Clarence Date: Sun, 17 Apr 2022 09:20:32 +0800 Subject: [PATCH] fix flang .mode file conflict issue --- shared/compiler.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/shared/compiler.go b/shared/compiler.go index 8192583..bf83ba7 100644 --- a/shared/compiler.go +++ b/shared/compiler.go @@ -81,10 +81,19 @@ func Compile(args []string, compiler string) (exitCode int) { var bcObjLinks []bitcodeToObjectLink var newObjectFiles []string - wg.Add(2) - go execCompile(compilerExecName, pr, &wg, &ok) - go buildAndAttachBitcode(compilerExecName, pr, &bcObjLinks, &newObjectFiles, &wg) - wg.Wait() + if compiler == "flang" { + wg.Add(1) + go execCompile(compilerExecName, pr, &wg, &ok) + wg.Wait(); + wg.Add(1); + go buildAndAttachBitcode(compilerExecName, pr, &bcObjLinks, &newObjectFiles, &wg) + wg.Wait() + } else { + wg.Add(2) + go execCompile(compilerExecName, pr, &wg, &ok) + go buildAndAttachBitcode(compilerExecName, pr, &bcObjLinks, &newObjectFiles, &wg) + wg.Wait() + } //grok the exit code if !ok {