build: pass CFLAGS and LDFLAGS to clang

This commit is contained in:
Li Jie
2025-03-20 11:17:27 +08:00
parent 71b34003ca
commit 0e71576265
2 changed files with 29 additions and 2 deletions

View File

@@ -488,7 +488,7 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, linkArgs
if verbose {
fmt.Fprintln(os.Stderr, "clang", args)
}
err = ctx.env.Clang().Exec(args...)
err = ctx.env.Clang().Link(args...)
check(err)
if IsRpathChangeEnabled() && runtime.GOOS == "darwin" {
@@ -870,7 +870,7 @@ func clFile(ctx *context, args []string, cFile, expFile string, procFile func(li
if verbose {
fmt.Fprintln(os.Stderr, "clang", args)
}
err := ctx.env.Clang().Exec(args...)
err := ctx.env.Clang().Compile(args...)
check(err)
procFile(llFile)
}