Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,11 @@ check_cxx_source_compiles(
}"
THREAD_LOCAL_SUPPORTED)
if (APPLE)
# libhdfspp's shared library links the static libsasl2 found under the Doris thirdparty
# prefix, whose GSSAPI plugin leaves gss_* undefined. Linux' ld tolerates undefined
# symbols in a .so; macOS' ld does not, so the dylib fails to link and takes the whole
# make down with it - libhdfs.a included. SASL is used by libhdfspp alone, which Doris
# never links (be/CMakeLists.txt sets BUILD_LIBHDFSPP OFF), so turn it off through the
# escape hatch libhdfspp/CMakeLists.txt documents.
# macOS stops after the x-platform object libraries libhdfs needs and never builds
# libhdfspp itself - see main/native/libhdfspp/CMakeLists.txt for why. SASL has no other
# consumer, so skip looking for it through the escape hatch that file documents; the
# static libsasl2 under the Doris thirdparty prefix would not link here anyway, its
# GSSAPI plugin leaves gss_* undefined and macOS' ld, unlike Linux', rejects that.
set(NO_SASL 1)
endif()
if (THREAD_LOCAL_SUPPORTED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ include_directories( SYSTEM
${PROTOBUF_INCLUDE_DIRS}
)

# Doris never links libhdfspp - be/CMakeLists.txt sets BUILD_LIBHDFSPP OFF - and on macOS the
# library cannot be linked at all. It is compiled against Homebrew LLVM's libc++ headers, which
# are configured without Apple's availability annotations, so std::exception_ptr's post-macOS-14
# entry points (__cxa_init_primary_exception, exception_ptr::__from_native_exception_pointer) are
# emitted whatever -mmacosx-version-min says, while -lc++ still resolves against the SDK's system
# libc++. Against a macOS 14 SDK those two symbols are missing, libhdfspp.dylib fails to link,
# and it takes the whole make down with it - libhdfs.a included.
#
# libhdfs does need the x-platform object libraries out of this tree, so build those and stop
# there. Every compile setting they depend on is already in place above this point.
if(APPLE)
add_subdirectory(lib/x-platform)
return()
endif()

add_subdirectory(third_party/uriparser2)
add_subdirectory(lib)
if(NOT HDFSPP_LIBRARY_ONLY)
Expand Down