File: bsymbolic_functions.test

package info (click to toggle)
qtbase-opensource-src 5.7.1%2Bdfsg-3%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 283,652 kB
  • sloc: cpp: 1,754,662; ansic: 433,142; xml: 100,291; python: 9,650; sh: 7,671; java: 6,543; asm: 4,283; perl: 2,217; yacc: 1,733; lex: 1,194; makefile: 333; objc: 70
file content (31 lines) | stat: -rwxr-xr-x 1,067 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

BSYMBOLIC_FUNCTIONS_SUPPORT=no
COMPILER=$1
VERBOSE=$2


cat >>bsymbolic_functions.c << EOF
#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))
#error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
#endif

int main() { return 0; }
EOF

if [ "$VERBOSE" = "yes" ] ; then
    echo $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
else
    $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
fi
rm -f bsymbolic_functions.c libtest.so

# done
if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then
    [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled."
    exit 0
else
    [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled."
    exit 1
fi