Skip to content

Commit 1638563

Browse files
committed
all: fix the link error with Go 1.24.3 (#312)
This addresses the issue golang/go#73617. Closes #313
1 parent ef7c59a commit 1638563

File tree

5 files changed

+26
-31
lines changed

5 files changed

+26
-31
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
freebsd:
138138
strategy:
139139
matrix:
140-
go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.6', '1.23.0']
140+
go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.9', '1.24.3']
141141
name: Test with Go ${{ matrix.go }} on FreeBSD
142142
runs-on: ubuntu-22.04
143143
defaults:

dlfcn.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ func loadSymbol(handle uintptr, name string) (uintptr, error) {
8383
// appear to work if you link directly to the C function on darwin arm64.
8484

8585
//go:linkname dlopen dlopen
86-
var dlopen uintptr
86+
var dlopen uint8
8787
var dlopenABI0 = uintptr(unsafe.Pointer(&dlopen))
8888

8989
//go:linkname dlsym dlsym
90-
var dlsym uintptr
90+
var dlsym uint8
9191
var dlsymABI0 = uintptr(unsafe.Pointer(&dlsym))
9292

9393
//go:linkname dlclose dlclose
94-
var dlclose uintptr
94+
var dlclose uint8
9595
var dlcloseABI0 = uintptr(unsafe.Pointer(&dlclose))
9696

9797
//go:linkname dlerror dlerror
98-
var dlerror uintptr
98+
var dlerror uint8
9999
var dlerrorABI0 = uintptr(unsafe.Pointer(&dlerror))

dlfcn_darwin.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ const (
1717
//go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib"
1818
//go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib"
1919
//go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib"
20-
21-
//go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib"
22-
//go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib"
23-
//go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib"
24-
//go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib"

internal/fakecgo/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ call5({{.Name}}ABI0,
7676
{{end}}
7777
{{- range . }}
7878
//go:linkname _{{.Name}} _{{.Name}}
79-
var _{{.Name}} uintptr
79+
var _{{.Name}} uint8
8080
var {{.Name}}ABI0 = uintptr(unsafe.Pointer(&_{{.Name}}))
8181
{{ end }}
8282
`

internal/fakecgo/symbols.go

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)