File: check_glibcxx.sh

package info (click to toggle)
mapnik 4.2.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,656 kB
  • sloc: cpp: 163,870; python: 1,332; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (36 lines) | stat: -rwxr-xr-x 783 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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}