Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: relocation target github.com/bytedance/sonic/internal/rt.StartProf not defined #648

Closed
xhd2015 opened this issue Jun 5, 2024 · 4 comments

Comments

@xhd2015
Copy link

xhd2015 commented Jun 5, 2024

Is amd64 the only supported arch?

This issue is raised when trying xgo with sonic, see xhd2015/xgo#194.

Reprodue:

git clone --depth=1 https://github.com/bytedance/sonic
cd sonic
mkdir -p ./internal/rt_main
cat > ./internal/rt_main/main.go <<'EOF'
package main

import "github.com/bytedance/sonic/internal/rt"

func main() {
	rt.StartProf()
}
EOF

GOARCH=arm64 go build -o /dev/null ./internal/rt_main

Error:

# github.com/bytedance/sonic/internal/ir_main
main.main: relocation target github.com/bytedance/sonic/internal/rt.StartProf not defined

Originally posted by @xhd2015 in xhd2015/xgo#194 (comment)

@AsterDY
Copy link
Collaborator

AsterDY commented Jun 5, 2024

This is a internal function, why you use it ?!

@xhd2015
Copy link
Author

xhd2015 commented Jun 5, 2024

I'm curious also, what's this function for?

@liuq19
Copy link
Collaborator

liuq19 commented Jun 6, 2024

If as build tag, the Unmarshal/Decode/... caller should not touch this function rt.StartProf() in arm64. It will call encoding/json now.

https://github.com/bytedance/sonic/blob/main/decoder/decoder_compat.go#L1

@xhd2015
Copy link
Author

xhd2015 commented Jun 6, 2024

If as build tag, the Unmarshal/Decode/... caller should not touch this function rt.StartProf() in arm64. It will call encoding/json now.

https://github.com/bytedance/sonic/blob/main/decoder/decoder_compat.go#L1

Thanks, will let the user provide more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants