at workaround for throw_out_of_range_fmt
remove inadvertent change also dump glibcxx symbols on circle add glibc_workaround.cpp if option is chosen This reverts commit 751d9bff1672f6b8cbd2b5ebe2eb460223746806. add script that asserts on expected symbols check symbols for all modes, only error if symbols exist + ENABLE_GLIBC_WORKAROUND
This commit is contained in:
parent
51b177802f
commit
f5ea42b11f
7 changed files with 104 additions and 3 deletions
10
.travis.yml
10
.travis.yml
|
@ -33,7 +33,7 @@ matrix:
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
sudo: false
|
||||||
compiler: ": clang"
|
compiler: ": clang"
|
||||||
env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" TRIGGER=true
|
env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" ENABLE_GLIBC_WORKAROUND=True TRIGGER=true
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: [ 'ubuntu-toolchain-r-test']
|
sources: [ 'ubuntu-toolchain-r-test']
|
||||||
|
@ -95,7 +95,7 @@ before_script:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- export SCONSFLAGS='--debug=time'
|
- export SCONSFLAGS='--debug=time'
|
||||||
- configure BENCHMARK=${BENCH}
|
- configure BENCHMARK=${BENCH} ENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-False}
|
||||||
- cat config.log
|
- cat config.log
|
||||||
# we limit the `make` to 40 min
|
# we limit the `make` to 40 min
|
||||||
# to ensure that slow builds still upload their
|
# to ensure that slow builds still upload their
|
||||||
|
@ -108,4 +108,8 @@ script:
|
||||||
# we allow visual failures with g++ for now: https://github.com/mapnik/mapnik/issues/3567
|
# we allow visual failures with g++ for now: https://github.com/mapnik/mapnik/issues/3567
|
||||||
- if [[ ${RESULT} != 0 ]] && [[ ${CXX} =~ 'clang++' ]]; then false; fi;
|
- if [[ ${RESULT} != 0 ]] && [[ ${CXX} =~ 'clang++' ]]; then false; fi;
|
||||||
- enabled ${COVERAGE} coverage
|
- enabled ${COVERAGE} coverage
|
||||||
- enabled ${BENCH} make bench
|
- enabled ${BENCH} make bench
|
||||||
|
- ./scripts/check_glibcxx.sh
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- enabled ${TRIGGER} trigger_downstream
|
||||||
|
|
|
@ -308,6 +308,7 @@ opts.AddVariables(
|
||||||
BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
|
BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
|
||||||
BoolVariable('NO_ATEXIT', 'Will prevent Singletons from being deleted atexit of main thread', 'False'),
|
BoolVariable('NO_ATEXIT', 'Will prevent Singletons from being deleted atexit of main thread', 'False'),
|
||||||
BoolVariable('NO_DLCLOSE', 'Will prevent plugins from being unloaded', 'False'),
|
BoolVariable('NO_DLCLOSE', 'Will prevent plugins from being unloaded', 'False'),
|
||||||
|
BoolVariable('ENABLE_GLIBC_WORKAROUND', "Workaround known GLIBC symbol exports to allow building against libstdc++-4.8 without binaries needing throw_out_of_range_fmt", 'False'),
|
||||||
# http://www.scons.org/wiki/GoFastButton
|
# http://www.scons.org/wiki/GoFastButton
|
||||||
# http://stackoverflow.com/questions/1318863/how-to-optimize-an-scons-script
|
# http://stackoverflow.com/questions/1318863/how-to-optimize-an-scons-script
|
||||||
BoolVariable('FAST', "Make SCons faster at the cost of less precise dependency tracking", 'False'),
|
BoolVariable('FAST', "Make SCons faster at the cost of less precise dependency tracking", 'False'),
|
||||||
|
@ -1872,6 +1873,9 @@ if not preconfigured:
|
||||||
if env['NO_DLCLOSE'] or env['COVERAGE']:
|
if env['NO_DLCLOSE'] or env['COVERAGE']:
|
||||||
env.Append(CPPDEFINES = '-DMAPNIK_NO_DLCLOSE')
|
env.Append(CPPDEFINES = '-DMAPNIK_NO_DLCLOSE')
|
||||||
|
|
||||||
|
if env['ENABLE_GLIBC_WORKAROUND']:
|
||||||
|
env.Append(CPPDEFINES = '-DMAPNIK_ENABLE_GLIBC_WORKAROUND')
|
||||||
|
|
||||||
# Mac OSX (Darwin) special settings
|
# Mac OSX (Darwin) special settings
|
||||||
if env['PLATFORM'] == 'Darwin':
|
if env['PLATFORM'] == 'Darwin':
|
||||||
pthread = ''
|
pthread = ''
|
||||||
|
|
|
@ -32,6 +32,7 @@ database:
|
||||||
- ./.mason/mason link clang++ ${LLVM_VERSION}
|
- ./.mason/mason link clang++ ${LLVM_VERSION}
|
||||||
- ./configure CC="$(pwd)/mason_packages/.link/bin/clang" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++ -Qunused-arguments"
|
- ./configure CC="$(pwd)/mason_packages/.link/bin/clang" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++ -Qunused-arguments"
|
||||||
- make
|
- make
|
||||||
|
- nm src/libmapnik* | grep "GLIBCXX_3.4.2[0-9]" || true
|
||||||
override:
|
override:
|
||||||
- psql -c 'create database template_postgis;'
|
- psql -c 'create database template_postgis;'
|
||||||
- psql -c 'create extension postgis;' -d template_postgis
|
- psql -c 'create extension postgis;' -d template_postgis
|
||||||
|
|
36
scripts/check_glibcxx.sh
Executable file
36
scripts/check_glibcxx.sh
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s nullglob
|
||||||
|
|
||||||
|
: '
|
||||||
|
|
||||||
|
Ensure no GLIBCXX_3.4.2x symbols are present in the binary
|
||||||
|
if ENABLE_GLIBC_WORKAROUND is set.
|
||||||
|
|
||||||
|
If symbols >= 3.4.20 then it means the binaries would not run on ubuntu trusty without upgrading libstdc++
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
FINAL_RETURN_CODE=0
|
||||||
|
|
||||||
|
function check() {
|
||||||
|
local RESULT=0
|
||||||
|
nm ${1} | grep "GLIBCXX_3.4.2[0-9]" > /tmp/out.txt || RESULT=$?
|
||||||
|
if [[ ${RESULT} != 0 ]]; then
|
||||||
|
echo "Success: GLIBCXX_3.4.2[0-9] symbols not present in binary (as expected)"
|
||||||
|
else
|
||||||
|
echo "$(cat /tmp/out.txt | c++filt)"
|
||||||
|
if [[ ${ENABLE_GLIBC_WORKAROUND:-false} == true ]]; then
|
||||||
|
FINAL_RETURN_CODE=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in src/libmapnik*; do
|
||||||
|
echo "checking $i"
|
||||||
|
check $i
|
||||||
|
done
|
||||||
|
|
||||||
|
exit ${FINAL_RETURN_CODE}
|
|
@ -307,6 +307,13 @@ cairo/process_markers_symbolizer.cpp
|
||||||
cairo/process_group_symbolizer.cpp
|
cairo/process_group_symbolizer.cpp
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
if env['ENABLE_GLIBC_WORKAROUND']:
|
||||||
|
source += Split(
|
||||||
|
"""
|
||||||
|
glibc_workaround.cpp
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
if env['HAS_CAIRO']:
|
if env['HAS_CAIRO']:
|
||||||
lib_env.AppendUnique(LIBPATH=env['CAIRO_LIBPATHS'])
|
lib_env.AppendUnique(LIBPATH=env['CAIRO_LIBPATHS'])
|
||||||
lib_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
lib_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace mapnik
|
||||||
{
|
{
|
||||||
template class MAPNIK_DECL singleton<freetype_engine, CreateUsingNew>;
|
template class MAPNIK_DECL singleton<freetype_engine, CreateUsingNew>;
|
||||||
|
|
||||||
|
|
||||||
bool freetype_engine::is_font_file(std::string const& file_name)
|
bool freetype_engine::is_font_file(std::string const& file_name)
|
||||||
{
|
{
|
||||||
// only accept files that will be matched by freetype2's `figurefiletype()`
|
// only accept files that will be matched by freetype2's `figurefiletype()`
|
||||||
|
|
48
src/glibc_workaround.cpp
Normal file
48
src/glibc_workaround.cpp
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*****************************************************************************
|
||||||
|
*
|
||||||
|
* This file is part of Mapnik (c++ mapping toolkit)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Artem Pavlenko
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
|
||||||
|
#ifdef MAPNIK_ENABLE_GLIBC_WORKAROUND
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
// https://github.com/bitcoin/bitcoin/pull/4042
|
||||||
|
// allows building against libstdc++-dev-4.9 while avoiding
|
||||||
|
// GLIBCXX_3.4.20 dep
|
||||||
|
// This is needed because libstdc++ itself uses this API - its not
|
||||||
|
// just an issue of your code using it, ughhh
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
|
||||||
|
void __throw_out_of_range_fmt(const char *, ...) __attribute__((__noreturn__));
|
||||||
|
void __throw_out_of_range_fmt(const char *err, ...)
|
||||||
|
{
|
||||||
|
// Safe and over-simplified version. Ignore the format and print it as-is.
|
||||||
|
__throw_out_of_range(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MAPNIK_ENABLE_GLIBC_WORKAROUND
|
||||||
|
|
||||||
|
#endif // __linux__
|
Loading…
Add table
Reference in a new issue