diff options
Diffstat (limited to 'pkg/csource')
| -rw-r--r-- | pkg/csource/build.go | 10 | ||||
| -rw-r--r-- | pkg/csource/common.go | 2 | ||||
| -rw-r--r-- | pkg/csource/csource.go | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/pkg/csource/build.go b/pkg/csource/build.go index cd67aa4f3..185256b8d 100644 --- a/pkg/csource/build.go +++ b/pkg/csource/build.go @@ -19,8 +19,8 @@ import ( // Build builds a C/C++ program from source src and returns name of the resulting binary. // lang can be "c" or "c++". func Build(target *prog.Target, lang, src string) (string, error) { - sysTarget := targets.List[target.OS][target.Arch] - compiler := sysTarget.CCompilerPrefix + "gcc" + sysTarget := targets.Get(target.OS, target.Arch) + compiler := sysTarget.CCompiler if _, err := exec.LookPath(compiler); err != nil { return "", ErrNoCompiler } @@ -38,11 +38,7 @@ func Build(target *prog.Target, lang, src string) (string, error) { // We do generate uint64's for syscall arguments that overflow longs on 32-bit archs. flags = append(flags, "-Wno-overflow") } - out, err := osutil.Command(compiler, append(flags, "-static")...).CombinedOutput() - if err != nil { - // Some distributions don't have static libraries. - out, err = osutil.Command(compiler, flags...).CombinedOutput() - } + out, err := osutil.Command(compiler, flags...).CombinedOutput() if err != nil { os.Remove(bin) data, _ := ioutil.ReadFile(src) 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 } diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 6ac68464f..ddb1fbf3f 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -22,7 +22,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { p: p, opts: opts, target: p.Target, - sysTarget: targets.List[p.Target.OS][p.Target.Arch], + sysTarget: targets.Get(p.Target.OS, p.Target.Arch), w: new(bytes.Buffer), calls: make(map[string]uint64), } |
