Workaround GLIBC 4.9 importing one useless (to us) symbol that causes a version update.
This commit is contained in:
parent
eff1d4e622
commit
ff7f8557e3
@ -187,7 +187,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 CXXFLAGS='-include util/glibc_workaround.hpp'
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@ -210,7 +210,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 CXXFLAGS='-include util/glibc_workaround.hpp'
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@ -233,7 +233,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" CXXFLAGS='-include util/glibc_workaround.hpp'
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
@ -256,7 +256,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-4.9-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6"
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" CXXFLAGS='-include util/glibc_workaround.hpp'
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
|
31
include/util/glibc_workaround.hpp
Normal file
31
include/util/glibc_workaround.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef GLIBC_WORKAROUND_H
|
||||
#define GLIBC_WORKAROUND_H
|
||||
|
||||
// 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
|
||||
|
||||
// Note: only necessary on Linux
|
||||
#ifdef __linux__
|
||||
#define WORKAROUND
|
||||
#warning building with workaround
|
||||
#else
|
||||
#warning not building with workaround
|
||||
#endif
|
||||
|
||||
#ifdef WORKAROUND
|
||||
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 // WORKAROUND
|
||||
|
||||
#endif // GLIBC_WORKAROUND_H
|
Loading…
Reference in New Issue
Block a user