Looks some GO compiler bug. Please see below for more details to validate and confirm about bug.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

21 lines
565B

  1. #!/bin/bash
  2. unset GOPATH
  3. #run plugin directly to see correct result
  4. go run plugin/plugin.go
  5. #compile as plugin
  6. go build -buildmode=plugin -o /tmp/plugin.so ../compiler_bug/plugin/
  7. #running plugin will trigger error
  8. go run runplugin/main.go
  9. #However, if the plugin is compiled with generic tag (To disable asm code, the bug doesn't occur), Some register corruption occurs due to wrong code being generated.
  10. #go build -buildmode=plugin -tags generic -o /tmp/plugin.so ../compiler_bug/plugin/
  11. #running plugin will not cause an error
  12. #go run runplugin/main.go