xhd2015/xgo

Bug: function declared in asm not handled correctly

xhd2015 opened this issue · 0 comments

When a function is declared in .s file, xgo fails to handle them correctly with link message:

Nodef·f: relocation target  ...Nodef not defined

debug.go:

package debug

func Nodef()

debug_amd64.s:

// +build !noasm,amd64 !appengine,amd64

#include "go_asm.h"
#include "funcdata.h"
#include "textflag.h"

TEXT Nodef(SB), NOSPLIT, $0-0
    RET

go succeeds:

$ cd runtime/test/debug
$ go test -c -v ./
(exit code 0)

xgo fails:

$ xgo test -c -v --project-dir runtime/test/debug ./
# github.com/xhd2015/xgo/runtime/test/debug.test
github.com/xhd2015/xgo/runtime/test/debug.Nodef·f: relocation target github.com/xhd2015/xgo/runtime/test/debug.Nodef not defined

Originally posted by @xhd2015 in #194 (comment)