1

res_search: fix for aarch64

On linux_aarch64 `res_search` is `__res_search@GLIBC_2.17`, which is
different from the x86_64 counterpart `__res_search@GLIBC_2.2.5`.

Also fix tests.
This commit is contained in:
Motiejus Jakštys
2023-01-18 22:39:35 +02:00
parent a47c7abc96
commit 8d1e1c9fa6
6 changed files with 44 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ go_library(
name = "cgo_lib",
srcs = ["cgo.go"],
cgo = True,
clinkopts = ["-lresolv"],
importpath = "git.sr.ht/~motiejus/bazel-zig-cc/test/cgo",
visibility = ["//visibility:private"],
)

View File

@@ -1,13 +1,8 @@
package main
// #define _FILE_OFFSET_BITS 64
// #include <unistd.h>
// #include <fcntl.h>
// #include <stdio.h>
// #include <resolv.h>
// char* hello() { return "hello, world"; }
// void phello() { printf("%s, your lucky numbers are %p and %p\n", hello(), fcntl, res_search); }
// #cgo LDFLAGS: -lresolv
// void phello() { printf("%s\n", hello()); }
import "C"
func main() {