Guest User

Untitled

a guest
Jan 25th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. [sobe@xy go-43886-repro]$ cat zcc
  2. #!/bin/sh
  3. zig cc -target x86_64-windows-gnu $@
  4. [sobe@xy go-43886-repro]$ cat zc++
  5. #!/bin/sh
  6. zig c++ -target x86_64-windows-gnu $@
  7. [sobe@xy go-43886-repro]$ cat main.go
  8. package main
  9.  
  10. //int Add(int a, int b){
  11. // return a+b;
  12. //}
  13. import "C"
  14. import "fmt"
  15.  
  16. func main() {
  17. a := C.int(10)
  18. b := C.int(20)
  19. c := C.Add(a, b)
  20. fmt.Println(c) // 30
  21. }
  22. [sobe@xy go-43886-repro]$ export PATH="$PATH:/home/sobe/zig/go-43886-repro"
  23. [sobe@xy go-43886-repro]$ zig version
  24. 0.8.0-dev.1048+0cfa39304
  25. [sobe@xy go-43886-repro]$ go version
  26. go version go1.15.6 linux/amd64
  27. [sobe@xy go-43886-repro]$ zcc
  28. zig: error: no input files
  29. [sobe@xy go-43886-repro]$ zc++
  30. zig: error: no input files
  31. [sobe@xy go-43886-repro]$ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="zcc" CXX="zc++" go build main.go
  32. # command-line-arguments
  33. warning: unsupported linker arg: --compress-debug-sections=zlib-gnu
  34. [sobe@xy go-43886-repro]$ wine main.exe
  35. wine: Unhandled page fault on write access to 0000000140106488 at address 0000000140139551 (thread 00f4), starting debugger...
  36. Unhandled exception: page fault on write access to 0x140106488 in 64-bit code (0x0000000140139551).
  37. Register dump:
  38. rip:0000000140139551 rsp:000000000111fd20 rbp:0000000000000000 eflags:00010297 ( R- -- I S -A-P-C)
  39. rax:0000000000800f11 rbx:0000000002100800 rcx:000000007ed8320b rdx:00000000178bfbff
  40. rsi:000000000000000d rdi:00000001400d5240 r8:00000000000150a0 r9:00000000014b1490 r10:00000000014b1390
  41. r11:00000000014b0138 r12:0000000000000000 r13:0000000000000000 r14:00000000014b1320 r15:0000000000000001
  42. Stack dump:
  43. 0x000000000111fd20: 0000000000000000 0000000000000000
  44. 0x000000000111fd30: 0000000000000029 0000000000013e40
  45. 0x000000000111fd40: 0000000000013e40 000000014000192a
  46. 0x000000000111fd50: 0000000000000000 0000000000000000
  47. 0x000000000111fd60: 0000000000000000 0000000000000000
  48. 0x000000000111fd70: 0000000000000000 0000000000000000
  49. 0x000000000111fd80: 0000000000000000 0000000000000000
  50. 0x000000000111fd90: 0000000000000000 0000000000000000
  51. 0x000000000111fda0: 0000000000000000 0000000000000000
  52. 0x000000000111fdb0: 0000000000000000 0000000000000000
  53. 0x000000000111fdc0: 0000000000000000 0000000000000000
  54. 0x000000000111fdd0: 0000000000000000 0000000000000000
  55. Backtrace:
  56. =>0 0x0000000140139551 runtime.rt0_go+0x71() in main (0x0000000000000000)
  57. 0x0000000140139551 runtime.rt0_go+0x71 in main: movl %eax,0xfffffffffffccf31(%rip)
  58. Modules:
  59. Module Address Debug info Name (5 modules)
  60. PE 6a080000- 6a10d000 Deferred msvcrt
  61. PE 7b000000- 7b0d4000 Deferred kernelbase
  62. PE 7b600000- 7b811000 Deferred kernel32
  63. PE 7bc00000- 7bc96000 Deferred ntdll
  64. PE 140000000- 140333000 PDB main
  65. Threads:
  66. process tid prio (all id:s are in hex)
  67. 00000038 services.exe
  68. 0000003c 0
  69. 00000040 0
  70. 0000004c 0
  71. 00000070 0
  72. 00000088 0
  73. 000000b0 0
  74. 000000d0 0
  75. 00000044 winedevice.exe
  76. 00000048 0
  77. 00000054 0
  78. 00000058 0
  79. 0000005c 0
  80. 00000060 plugplay.exe
  81. 00000064 0
  82. 00000074 0
  83. 00000078 0
  84. 0000007c 0
  85. 00000098 0
  86. 00000068 explorer.exe
  87. 0000006c 0
  88. 000000bc 0
  89. 000000c0 0
  90. 00000080 winedevice.exe
  91. 00000084 0
  92. 0000008c 0
  93. 00000090 0
  94. 00000094 0
  95. 000000a0 0
  96. 000000a4 0
  97. 000000a8 svchost.exe
  98. 000000ac 0
  99. 000000b4 0
  100. 000000b8 0
  101. 000000c8 rpcss.exe
  102. 000000cc 0
  103. 000000d8 0
  104. 000000dc 0
  105. 000000e0 0
  106. 000000e4 0
  107. 000000e8 0
  108. 000000f0 (D) Z:\home\sobe\zig\go-43886-repro\main.exe
  109. 000000f4 0 <==
  110. 000000f8 conhost.exe
  111. 000000fc 0
  112. System information:
  113. Wine build: wine-6.0
  114. Platform: x86_64
  115. Version: Windows 7
  116. Host system: Linux
  117. Host version: 5.10.8-arch1-1
  118. [sobe@xy go-43886-repro]$
Advertisement
Add Comment
Please, Sign In to add comment