Skip to content

Commit

Permalink
ARROW-1747: [C++] Don't export symbols of statically linked libraries
Browse files Browse the repository at this point in the history
Author: Korn, Uwe <[email protected]>

Closes #1264 from xhochy/ARROW-1747 and squashes the following commits:

85d1725 [Korn, Uwe] ARROW-1747: [C++] Don't export symbols of statically linked libraries
  • Loading branch information
xhochy authored and wesm committed Oct 30, 2017
1 parent f257b00 commit ec22228
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
38 changes: 38 additions & 0 deletions cpp/src/arrow/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,49 @@
# devtoolset / static-libstdc++ symbols
__cxa_*;


# Static libraries that are linked in e.g. the manylinux1 build
# Brotli compression library
Brotli*;
# zlib
adler32;
adler32_combine;
adler32_combine64;
crc32;
crc32_combine;
crc32_combine64;
deflate*;
inflate*;
get_crc_table;
zcalloc;
zcfree;
zError;
zlibCompileFlags;
zlibVersion;
_tr_*;
# lz4
LZ4_*;
# zstandard
ZSTD_*;
ZSTDv*;
HUF_*;
HUFv*;
FSE_*;
FSEv*;
ZBUFFv*;
ERR_getErrorString;
# jemalloc
je_arrow_*;

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::*;

# Statically linked C++ dependencies
boost::*;
snappy::*;
};
};
3 changes: 3 additions & 0 deletions python/manylinux1/Dockerfile-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ WORKDIR /arrow/cpp/build-plain
RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/arrow-dist -DARROW_BUILD_TESTS=OFF -DARROW_BUILD_SHARED=ON -DARROW_BOOST_USE_SHARED=OFF -DARROW_JEMALLOC=ON -DARROW_RPATH_ORIGIN=ON -DARROW_JEMALLOC_USE_SHARED=OFF ..
RUN ninja install

ADD scripts/check_arrow_visibility.sh /
RUN /check_arrow_visibility.sh

WORKDIR /
RUN git clone https://github.com/apache/parquet-cpp.git
WORKDIR /parquet-cpp
Expand Down
26 changes: 26 additions & 0 deletions python/manylinux1/scripts/check_arrow_visibility.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash -ex
# 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.

nm -D -C /arrow-dist/lib64/libarrow.so > nm_arrow.log

if [[ `grep ' T ' nm_arrow.log | grep -v arrow | wc -l` -eq 2 ]]
then
exit 0
fi

exit 1

0 comments on commit ec22228

Please sign in to comment.