Use asan-force-options package from gcc 59/140959/2 accepted/tizen/4.0/unified/20170816.014806 accepted/tizen/unified/20170728.195738 submit/tizen/20170727.132855 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorMaria Guseva <m.guseva@samsung.com>
Thu, 27 Jul 2017 08:21:23 +0000 (11:21 +0300)
committerMaria Guseva <m.guseva@samsung.com>
Thu, 27 Jul 2017 11:24:50 +0000 (14:24 +0300)
Avoid gcc-force/unforce-options scripts duplications in linaro-gcc and
libFuzzer projects.

Change-Id: I983d1375669bff772f294c27b5c3f281a264a0bc

packaging/gcc-force-options [deleted file]
packaging/gcc-unforce-options [deleted file]
packaging/libFuzzer.spec

diff --git a/packaging/gcc-force-options b/packaging/gcc-force-options
deleted file mode 100755 (executable)
index 34f4945..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ $# -eq 0 ]; then
-       cat << EOF
-Syntax:
-  $(basename $0) OPT1 [OPT2...]"
-
-Example:
-  $(basename $0) [prepend|append] -fsanitize=address -fno-common -U_FORTIFY_SOURCE
-  By default flags are appending.
-EOF
-       exit 1
-fi
-
-FLAGS="$@"
-
-if [ $(find $(dirname $0) -name \*-real | wc -l) -gt 0 ]; then
-       echo >&2 "$(basename $0): directory was already processed, aborting"
-       exit 1
-fi
-
-case "$1" in
-prepend)
-       shift
-       PREFLAGS="$@"
-       POSTFLAGS=
-       ;;
-append)
-       shift
-       PREFLAGS=
-       POSTFLAGS="$@"
-       ;;
-*)
-       PREFLAGS=
-       POSTFLAGS="$@"
-       ;;
-esac
-
-TMP=$(pwd)/tmp.$$
-cat > $TMP << EOF
-#!/bin/sh
-if echo "$PREFLAGS "\$@" $POSTFLAGS" | grep -q -- "-fsanitize=undefined" && echo "\$@" | grep -q "\.gch\>"; then
-       # UBSan doesn't support precompiled headers. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66343
-       echo "Precompiled headers currently not supported by UBSan" >&2
-       # Don't instrument kernel modules
-       # Don't instrument with "-nostdlib" linking
-elif ! echo "\$@" | grep -q -e __KERNEL__ -e \-nostdlib; then
-       # Use readlink in order to follow symlinks if any
-       \$(readlink -f \$0)-real $PREFLAGS "\$@" $POSTFLAGS
-else
-       \$(readlink -f \$0)-real "\$@"
-fi
-EOF
-chmod +x $TMP
-
-find -L $(dirname $0) -type f -a -perm -a=x | grep -E '(gcc|g\+\+|c\+\+)$' | while read tool; do
-       mv $tool $tool-real
-       cp $TMP $tool
-done
-
-if [ -d /emul ]; then
-       find -L /emul -type f -a -perm -a=x | grep -E '(gcc|g\+\+|c\+\+)$' | while read tool; do
-               ln -sf $(basename $tool) $tool-real
-       done
-fi
-
-rm $TMP
-
diff --git a/packaging/gcc-unforce-options b/packaging/gcc-unforce-options
deleted file mode 100755 (executable)
index cf36d04..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ $# -gt 0 ]; then
-       echo >&2 "$(basename $0): unexpected arguments"
-       exit 1
-fi
-
-find $(dirname $0) -name \*-real | while read tool_real; do
-       tool=$(echo "$tool_real" | sed -e 's/-real$//')
-       mv $tool_real $tool
-done
-if [ -d /emul ]; then
-       find /emul -name \*-real | while read tool_real; do
-               rm $tool_real
-       done
-fi
-
index 476834d..909fc08 100644 (file)
@@ -6,8 +6,6 @@ Summary:        libFuzzer
 Url:            http://llvm.org/docs/LibFuzzer.html
 Group:          Development/Testing
 Source0:        %{name}-%{version}.tar.xz
-Source1:        gcc-force-options
-Source2:        gcc-unforce-options
 
 # disable debuginfo stripping
 %define __strip /bin/true
@@ -29,7 +27,6 @@ mkdir -p %{buildroot}%{_prefix}/bin
 cp scripts/sancov.py %{buildroot}%{_prefix}/bin
 cp scripts/sancov_symbolize.py %{buildroot}%{_prefix}/bin
 cp scripts/coverage-report-dump.py %{buildroot}%{_prefix}/bin
-cp %{SOURCE1} %{SOURCE2} %{buildroot}%{_prefix}/bin
 
 %files
 %manifest %{name}.manifest
@@ -41,25 +38,21 @@ cp %{SOURCE1} %{SOURCE2} %{buildroot}%{_prefix}/bin
 Summary:    Scripts to enable automatic package sanitization for fuzzing
 Group:      System Environment
 # Need to have gcc installed before running the force-options script
-Requires:   gcc libasan
+Requires:   asan-force-options
 
 %description -n fuzz-force-options
-Scripts for ASan and SanCov instrumentation needed for fuzzing.
+Compiler wrappers for ASan and SanCov instrumentation needed for fuzzing.
 
 %post -n fuzz-force-options
-# Change mode to allow all users to run gcc-force/unforce-options
-chmod a+w /usr/bin
+/usr/bin/gcc-unforce-options
 /usr/bin/gcc-force-options -fsanitize-coverage=trace-pc -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
-chmod a-w /usr/bin
 
 %preun -n fuzz-force-options
-chmod a+w /usr/bin
 /usr/bin/gcc-unforce-options
 chmod a-w /usr/bin
 
 %files -n fuzz-force-options
-%{_prefix}/bin/gcc-force-options
-%{_prefix}/bin/gcc-unforce-options
+# no files
 
 %package -n sancov
 Summary:    Scripts to process coverage information