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:
22
test/glibc_hacks/BUILD
Normal file
22
test/glibc_hacks/BUILD
Normal file
@@ -0,0 +1,22 @@
|
||||
load("@bazel-zig-cc//rules:platform.bzl", "platform_binary")
|
||||
|
||||
cc_binary(
|
||||
name = "main",
|
||||
srcs = ["main.c"],
|
||||
)
|
||||
|
||||
[
|
||||
(
|
||||
platform_binary(
|
||||
name = "main_{}".format(name),
|
||||
src = "main",
|
||||
platform = platform,
|
||||
),
|
||||
)
|
||||
for name, platform in [
|
||||
("linux_amd64_musl", "//libc_aware/platform:linux_amd64_musl"),
|
||||
("linux_amd64_gnu.2.19", "//libc_aware/platform:linux_amd64_gnu.2.19"),
|
||||
("linux_amd64_gnu.2.28", "//libc_aware/platform:linux_amd64_gnu.2.28"),
|
||||
("linux_arm64_musl", "//libc_aware/platform:linux_arm64_musl"),
|
||||
]
|
||||
]
|
||||
13
test/glibc_hacks/main.c
Normal file
13
test/glibc_hacks/main.c
Normal file
@@ -0,0 +1,13 @@
|
||||
// This file tests that problematic functions (glibc-hacks) work.
|
||||
// Also see https://github.com/ziglang/zig/issues/9485
|
||||
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <resolv.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Your lucky numbers are %p and %p\n", fcntl, res_search);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user