Index: cmd/gllgo/gllgo.go =================================================================== --- cmd/gllgo/gllgo.go +++ cmd/gllgo/gllgo.go @@ -118,7 +118,7 @@ case san.thread: mpm.AddThreadSanitizerPass() case san.memory: - mpm.AddMemorySanitizerPass() + mpm.AddMemorySanitizerLegacyPassPass() case san.dataflow: blacklist := san.blacklist if blacklist == "" { @@ -198,6 +198,7 @@ staticLibgo bool staticLink bool triple string + splitStack bool } func getInstPrefix() (string, error) { @@ -344,6 +345,12 @@ opts.plugins = append(opts.plugins, args[1]) consumedArgs = 2 + case args[0] == "-fno-split-stack": + opts.splitStack = false + + case args[0] == "-fsplit-stack": + opts.splitStack = true + case args[0] == "-fno-toplevel-reorder": // This is a GCC-specific code generation option. Ignore. Index: irgen/runtime.go =================================================================== --- irgen/runtime.go +++ irgen/runtime.go @@ -518,7 +518,6 @@ llvm.PointerType(llvm.Int8Type(), 0), llvm.Int8Type(), tm.target.IntPtrType(), - llvm.Int32Type(), llvm.Int1Type(), }, false, @@ -531,8 +530,7 @@ []llvm.Type{ llvm.PointerType(llvm.Int8Type(), 0), llvm.PointerType(llvm.Int8Type(), 0), - tm.target.IntPtrType(), - llvm.Int32Type(), + llvm.Int64Type(), llvm.Int1Type(), }, false, @@ -590,9 +588,8 @@ ptr = fr.builder.CreateBitCast(ptr, llvm.PointerType(llvm.Int8Type(), 0), "") fill := llvm.ConstNull(llvm.Int8Type()) size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "") - align := llvm.ConstInt(llvm.Int32Type(), 1, false) isvolatile := llvm.ConstNull(llvm.Int1Type()) - fr.builder.CreateCall(memset, []llvm.Value{ptr, fill, size, align, isvolatile}, "") + fr.builder.CreateCall(memset, []llvm.Value{ptr, fill, size, isvolatile}, "") } func (fr *frame) memcpy(dest llvm.Value, src llvm.Value, size llvm.Value) { @@ -600,9 +597,8 @@ dest = fr.builder.CreateBitCast(dest, llvm.PointerType(llvm.Int8Type(), 0), "") src = fr.builder.CreateBitCast(src, llvm.PointerType(llvm.Int8Type(), 0), "") size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "") - align := llvm.ConstInt(llvm.Int32Type(), 1, false) isvolatile := llvm.ConstNull(llvm.Int1Type()) - fr.builder.CreateCall(memcpy, []llvm.Value{dest, src, size, align, isvolatile}, "") + fr.builder.CreateCall(memcpy, []llvm.Value{dest, src, size, isvolatile}, "") } func (fr *frame) returnAddress(level uint64) llvm.Value {