Open
Conversation
Port MTProxy to FreeBSD by addressing Linux-specific dependencies: Build system (Makefile): - Add FreeBSD detection and platform-specific CFLAGS/LDFLAGS - Link against libepoll-shim for epoll compatibility layer - Link against libexecinfo for backtrace support - Remove -lrt and -rdynamic (not needed on FreeBSD) Signal handling: - Add missing signal.h include in mtproto-proxy.c - Adapt SIGRTMAX handling for FreeBSD (uses different signal range) - Wrap SIGPOLL usage (not available on FreeBSD) Threading and synchronization: - Replace Linux futex syscalls with FreeBSD _umtx_op() - Replace SYS_gettid with thr_self() for thread identification - Replace glibc-specific drand48_r/srand48_r with mutex-protected standard drand48/srand48 functions - Wrap struct drand48_data with #ifdef __linux__ Socket options: - Wrap TCP_WINDOW_CLAMP (Linux-specific) - Wrap TCP_QUICKACK (Linux-specific) - Wrap IP_RECVERR/SOL_IP (Linux-specific) Header compatibility: - Disable _XOPEN_SOURCE on FreeBSD (conflicts with IPv6 definitions) - Add sys/socket.h before netinet/in.h for struct sockaddr_in6 - Add socket headers to resolver.c - Wrap sys/io.h include (Linux-specific) - Undef close macro from libepoll-shim to avoid struct member conflict Compiler compatibility: - Add clang-compatible intrinsic macros for SIMD operations in crc32.c (maps GCC __builtin_ia32_* to standard Intel intrinsics) Requires: libepoll-shim package (pkg install libepoll-shim) Use 'gmake' (pkg install gmake) to stay compatible with GNU-style Makefile. Signed-off-by: Vladimir Krivopalov <vladimir.krivopalov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port MTProxy to FreeBSD by addressing Linux-specific dependencies:
Build system (Makefile):
Signal handling:
Threading and synchronization:
Socket options:
Header compatibility:
Compiler compatibility:
Requires: libepoll-shim package (pkg install libepoll-shim)
Use 'gmake' (pkg install gmake) to stay compatible with GNU-style Makefile.
Closes: #16 #331