From 6479ab2a752ba9ef714199de69d096cee0e6db2d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 5 Jun 2018 17:14:47 +0200 Subject: Makefile, sys/targets: move all native compilation logic to sys/targets We currently have native cross-compilation logic duplicated in Makefile and in sys/targets. Some pieces are missed in one place, some are in another. Only pkg/csource knows how to check for -static support. Move all CC/CFLAGS logic to sys/targets and pull results in Makefile. This should make Makefile work on distros that have broken x86_64-linux-gnu-gcc, now we will use just gcc. And this removes the need to define NOSTATIC, as it's always auto-detected. This also paves the way for making pkg/csource work on OSes other than Linux. --- pkg/csource/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/csource/common.go') diff --git a/pkg/csource/common.go b/pkg/csource/common.go index e8fce42a6..11eff8384 100644 --- a/pkg/csource/common.go +++ b/pkg/csource/common.go @@ -113,7 +113,7 @@ func defineList(p *prog.Prog, opts Options) ([]string, error) { for _, c := range p.Calls { defines = append(defines, "__NR_"+c.Meta.CallName) } - defines = append(defines, targets.List[p.Target.OS][p.Target.Arch].CArch...) + defines = append(defines, targets.Get(p.Target.OS, p.Target.Arch).CArch...) return defines, nil } -- cgit mrf-deployment