Skip to content

Commit 49eb4ef

Browse files
committed
Set visibility always and add debug
1 parent 18130db commit 49eb4ef

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

ci/scripts/python_build_emscripten.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ cp -aL "${source_dir}" "${python_build_dir}"
3838
# emcmake so we unset them
3939
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS
4040

41+
# Keep WebAssembly function names only in CI to limit wheel size
42+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
43+
export PYARROW_CXXFLAGS="${PYARROW_CXXFLAGS:+${PYARROW_CXXFLAGS} }--profiling-funcs"
44+
fi
45+
4146
pushd "${python_build_dir}"
4247
pyodide build
4348
popd

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,13 +2447,10 @@ macro(build_substrait)
24472447
set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR})
24482448

24492449
add_library(substrait STATIC ${SUBSTRAIT_SOURCES})
2450-
set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON)
2451-
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
2452-
# Match Protobuf's visibility so duplicate inline definitions can't be
2453-
# selected with different visibility when linking a side module (GH-50774)
2454-
set_target_properties(substrait PROPERTIES CXX_VISIBILITY_PRESET hidden
2455-
VISIBILITY_INLINES_HIDDEN ON)
2456-
endif()
2450+
# Match Protobuf's visibility because target contains generated Protobuf code
2451+
set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON
2452+
CXX_VISIBILITY_PRESET hidden
2453+
VISIBILITY_INLINES_HIDDEN ON)
24572454
target_compile_options(substrait PRIVATE "${SUBSTRAIT_SUPPRESSED_FLAGS}")
24582455
target_include_directories(substrait PUBLIC ${SUBSTRAIT_INCLUDES})
24592456
target_link_libraries(substrait PUBLIC ${ARROW_PROTOBUF_LIBPROTOBUF})
@@ -3894,11 +3891,9 @@ function(build_orc)
38943891

38953892
fetchcontent_makeavailable(orc)
38963893

3897-
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
3898-
# ORC compiles generated Protobuf code into its static library
3899-
set_target_properties(orc PROPERTIES CXX_VISIBILITY_PRESET hidden
3900-
VISIBILITY_INLINES_HIDDEN ON)
3901-
endif()
3894+
# ORC compiles generated Protobuf code into its static library
3895+
set_target_properties(orc PROPERTIES CXX_VISIBILITY_PRESET hidden
3896+
VISIBILITY_INLINES_HIDDEN ON)
39023897

39033898
# ORC 2.2.1 unconditionally adds /std:c++17 on MSVC via
39043899
# add_compile_options, which overrides CMAKE_CXX_STANDARD and causes
@@ -3991,11 +3986,9 @@ function(build_orc)
39913986
"-DZSTD_LIBRARY=$<TARGET_FILE:${ARROW_ZSTD_LIBZSTD}>"
39923987
"-DZLIB_HOME=${ORC_ZLIB_ROOT}"
39933988
"-DZLIB_INCLUDE_DIR=$<TARGET_PROPERTY:ZLIB::ZLIB,INTERFACE_INCLUDE_DIRECTORIES>"
3994-
"-DZLIB_LIBRARY=$<TARGET_FILE:ZLIB::ZLIB>")
3995-
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
3996-
list(APPEND ORC_CMAKE_ARGS -DCMAKE_CXX_VISIBILITY_PRESET=hidden
3997-
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON)
3998-
endif()
3989+
"-DZLIB_LIBRARY=$<TARGET_FILE:ZLIB::ZLIB>"
3990+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden
3991+
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON)
39993992

40003993
# Work around CMake bug
40013994
file(MAKE_DIRECTORY ${ORC_INCLUDE_DIR})

0 commit comments

Comments
 (0)