In article <85853ac7-a205-b412-2f5b-39101dc51...@gmx.com>, Kamil Rytarowski <n...@gmx.com> wrote: > >Fixed in HEAD. printf(9) change has been reverted.
It is simple enough to fix in syscaller: Anyway, this needs a lot more work but commenting out the os.Remove() calls (so that you can see what it produces) and fixing the printf prototype gets you further. You'll need to add the right symlinks to make it go even more as you discover :-) christos diff --git a/Makefile b/Makefile index 5a3250b..8f50303 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,8 @@ GO := go EXE := ifeq ("$(TARGETARCH)", "amd64") - CC = "x86_64-linux-gnu-gcc" +# CC = "x86_64-linux-gnu-gcc" + CC = "gcc" else ifeq ("$(TARGETARCH)", "386") CC = "x86_64-linux-gnu-gcc" ADDCFLAGS = "-m32" diff --git a/sys/syz-extract/fetch.go b/sys/syz-extract/fetch.go index b1ed2ce..fcf49ef 100644 --- a/sys/syz-extract/fetch.go +++ b/sys/syz-extract/fetch.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" "io/ioutil" - "os" +// "os" "os/exec" "regexp" "strconv" @@ -61,7 +61,7 @@ func extract(info *compiler.ConstInfo, cc string, args []string, addSource strin return nil, nil, fmt.Errorf("failed to run compiler: %v\n%v", err, string(out)) } } - defer os.Remove(bin) +// defer os.Remove(bin) out, err = exec.Command(bin).CombinedOutput() if err != nil { @@ -100,9 +100,9 @@ func compile(cc string, args []string, data *CompileData) (bin string, out []byt return "", nil, fmt.Errorf("failed to create temp file: %v", err) } srcFile.Close() - os.Remove(srcFile.Name()) +// os.Remove(srcFile.Name()) srcName := srcFile.Name() + ".c" - defer os.Remove(srcName) +// defer os.Remove(srcName) src := new(bytes.Buffer) if err := srcTemplate.Execute(src, data); err != nil { return "", nil, fmt.Errorf("failed to generate source: %v", err) @@ -125,7 +125,7 @@ func compile(cc string, args []string, data *CompileData) (bin string, out []byt cmd := exec.Command(cc, args...) out, err = cmd.CombinedOutput() if err != nil { - os.Remove(binFile.Name()) +// os.Remove(binFile.Name()) return "", out, err } return binFile.Name(), nil, nil @@ -144,7 +144,7 @@ var srcTemplate = template.Must(template.New("").Parse(` {{.AddSource}} -int printf(const char *format, ...); +void printf(const char *format, ...); int main() { int i;