From: Maria Guseva Date: Fri, 5 May 2017 15:14:58 +0000 (+0300) Subject: Add removing of the -Wl,-Bsymbolic options in gcc-force-options script X-Git-Tag: submit/tizen/20170714.013956~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99c6dabf690901849849801168d427bb2dfe0eae;p=tools%2FlibFuzzer.git Add removing of the -Wl,-Bsymbolic options in gcc-force-options script --- diff --git a/packaging/gcc-force-options b/packaging/gcc-force-options index 34f4945..b68c3d2 100755 --- a/packaging/gcc-force-options +++ b/packaging/gcc-force-options @@ -47,10 +47,16 @@ if echo "$PREFLAGS "\$@" $POSTFLAGS" | grep -q -- "-fsanitize=undefined" && echo # Don't instrument kernel modules # Don't instrument with "-nostdlib" linking elif ! echo "\$@" | grep -q -e __KERNEL__ -e \-nostdlib; then + ARGS="\$@" + if echo "$PREFLAGS \$ARGS $POSTFLAGS" | grep -q -- 'libsancov_cb.a\\|-lsancov_cb'; then + # Remove -Bsymbolic flags to use weak symbols in libsancov_cb.a + echo "Warning: -Bsymbolic linkage flags will be removed, see gcc-force-options for details" >&2 + ARGS=\$(echo "\$@" | sed 's/-Wl,-Bsymbolic\\(-functions\\)\\?\\b//g') + fi # Use readlink in order to follow symlinks if any - \$(readlink -f \$0)-real $PREFLAGS "\$@" $POSTFLAGS + \$(readlink -f \$0)-real $PREFLAGS \$ARGS $POSTFLAGS else - \$(readlink -f \$0)-real "\$@" + \$(readlink -f \$0)-real \$ARGS fi EOF chmod +x $TMP