mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-28 00:06:09 +03:00
Fix broken overloading of libc close in static OpenWrt build
This commit is contained in:
parent
c4f9888c35
commit
f4faf2d572
@ -81,6 +81,8 @@ bool IsFDOwned(int fd) {
|
|||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
#ifndef OPENWRT_BUILD_STATIC
|
||||||
|
|
||||||
using LibcCloseFuncPtr = int (*)(int);
|
using LibcCloseFuncPtr = int (*)(int);
|
||||||
|
|
||||||
// Load the libc close symbol to forward to from the close wrapper.
|
// Load the libc close symbol to forward to from the close wrapper.
|
||||||
@ -110,3 +112,5 @@ __attribute__((visibility("default"), noinline)) int close(int fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
|
#endif // OPENWRT_BUILD_STATIC
|
||||||
|
@ -32,6 +32,7 @@ config("compiler") {
|
|||||||
if (build_static) {
|
if (build_static) {
|
||||||
# Musl static objects are not built with -fPIC, cannot use -static-pie.
|
# Musl static objects are not built with -fPIC, cannot use -static-pie.
|
||||||
ldflags += [ "-static" ]
|
ldflags += [ "-static" ]
|
||||||
|
defines += [ "OPENWRT_BUILD_STATIC" ]
|
||||||
} else if (current_cpu == "x86") {
|
} else if (current_cpu == "x86") {
|
||||||
ldflags += [ "-Wl,--dynamic-linker=/lib/ld-musl-i386.so.1" ]
|
ldflags += [ "-Wl,--dynamic-linker=/lib/ld-musl-i386.so.1" ]
|
||||||
} else if (current_cpu == "mipsel") {
|
} else if (current_cpu == "mipsel") {
|
||||||
|
Loading…
Reference in New Issue
Block a user