Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Motivation: Loading of the native epoll transport might segfault the JVM if musl is used and no glibc-compat is installed: Modifications: - Move libraries to LIBS where they should be, avoiding need for -Wl,--no-as-needed. - Use -O2 instead of -O3; there are no tight loops so -O3 just increases code size for no benefit. - Add -pipe for faster compilation. - Add -D_FORTIFY_SOURCE=2 and -Wl,-z,relro for security. - Add -Wl,-z,now for security and to improve musl compatibility. musl does not implement __strdup and __strndup which old glibc aliases strdup and strndup to, but OpenJDK loads libraries with RTLD_LAZY, so this is not discovered until too late. See grpc/grpc-java#8751 (comment) for more information. - Add -ffunction-sections -fdata-sections -Wl,--gc-sections to reduce output size and avoid linking librt when not really needed (only used for kqueue) Result: "Fixes" #11701 by making the native library load fail. Co-authored-by: Alex Xu <351006+Hello71@users.noreply.github.com>
- Loading branch information