Skip to content
Closed
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
5 changes: 0 additions & 5 deletions cpp/src/arrow/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
{
global:
extern "C++" {
# Export pthread_once-related symbols so that two SO files
# (e.g. libarrow.so and libplasma.so) don't use separate copies of
# those symbols.
# See https://github.com/apache/arrow/pull/1953#issuecomment-386057063
std::__once*;
# The leading asterisk is required for symbols such as
# "typeinfo for arrow::SomeClass".
# Unfortunately this will also catch template specializations
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ if(NOT APPLE AND NOT MSVC)
# Localize thirdparty symbols using a linker version script. This hides them
# from the client application. The OS X linker does not support the
# version-script option.
set(SHARED_LINK_FLAGS
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/parquet/symbols.map")
set(PARQUET_SHARED_LINK_FLAGS
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/symbols.map")
endif()

# Because of PARQUET-1420 (Thrift-generated symbols not exported in DLL),
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/parquet/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
local:
# devtoolset / static-libstdc++ symbols
__cxa_*;
__once_proxy;

extern "C++" {
# boost
Expand All @@ -34,5 +35,6 @@
# a system with an older libstdc++ which doesn't include the necessary
# c++11 symbols.
std::*;
*std::__once_call*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why the leading asterisk?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's this symbol that was causing issues, and it starts with void std::...:

void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)> (std::__future_base::_State_base*, std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper<bool>)> >()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

};
};
10 changes: 10 additions & 0 deletions cpp/src/plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,23 @@ if(ARROW_CUDA)
add_definitions(-DPLASMA_CUDA)
endif()

if(NOT APPLE AND NOT MSVC)
# Localize thirdparty symbols using a linker version script. This hides them
# from the client application. The OS X linker does not support the
# version-script option.
set(PLASMA_SHARED_LINK_FLAGS
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/symbols.map")
endif()

add_arrow_lib(plasma
SOURCES
${PLASMA_SRCS}
OUTPUTS
PLASMA_LIBRARIES
DEPENDENCIES
gen_plasma_fbs
SHARED_LINK_FLAGS
${PLASMA_SHARED_LINK_FLAGS}
SHARED_LINK_LIBS
${PLASMA_LINK_LIBS}
STATIC_LINK_LIBS
Expand Down
34 changes: 34 additions & 0 deletions cpp/src/plasma/symbols.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

{
# Symbols marked as 'local' are not exported by the DSO and thus may not
# be used by client applications.
local:
# devtoolset / static-libstdc++ symbols
__cxa_*;
__once_proxy;

extern "C++" {
# devtoolset or -static-libstdc++ - the Red Hat devtoolset statically
# links c++11 symbols into binaries so that the result may be executed on
# a system with an older libstdc++ which doesn't include the necessary
# c++11 symbols.
std::*;
*std::__once_call*;
};
};