--- /dev/null
+#!/bin/bash
+#echo "test 0" > /tmp/0000.log
+# Test 1:
+#exec $0.orig $@
+# Test 2:
+#$0.orig $@
+#RET=$?
+#exit $RET
+
+BASENAME_WRAPPER=/tmp/`basename $0`.$$.log
+# Note 1: Below does not works in the build root
+#BASENAME_WRAPPER=/tmp/`basename $0`.$BASHPID.log
+
+# Warning: only for debug, else it's linkage error for compile option '-o -' output to stdout
+#echo "$0 $@" >> $BASENAME_WRAPPER
+
+# Note 2: Inject additional params is incorrect - it's does not works with autotool tests
+#DUMPBASE_PARAM=`echo "$@"|sed -rn "s|\-dumpbase ([^ ]*) |\-dumpbase \1 -Wall -Wprint-abs-path |p"`
+
+DUMPBASE_OUT=`echo "$@" | grep -e "\-dumpbase \+\-" -e "\-dumpbase \+null" -e "\-o \+/dev/null"`
+#echo "DUMPBASE_OUT=$DUMPBASE_OUT" >> $BASENAME_WRAPPER
+[ "x$DUMPBASE_OUT" != "x" ] && BASENAME_WRAPPER=/dev/null
+
+# Note 3: Below does not works, stdout may be redefined
+#$0.orig $@ |& tee -a $BASENAME_WRAPPER
+#$0.orig $@ | tee -a $BASENAME_WRAPPER 1>&2
+
+# See note 2
+# $0.orig $DUMPBASE_PARAM 2>> $BASENAME_WRAPPER
+
+# Note 3: Below does not works in the SVACE environment
+# The SVACE tool can't capture the data if a wrapper is symlink
+#exec $0.orig $@ 2>> $BASENAME_WRAPPER
+
+$0.orig $@ 2>> $BASENAME_WRAPPER
+RET=$?
+cat $BASENAME_WRAPPER >&2
+exit $RET
Source25: TSAN_OPTIONS
Source26: macros.asan
Source27: ESAN_OPTIONS
+Source28: cc1
Group: Development/Building
Summary: GCC related scripts
License: MIT
%description -n sanitizer-sources
Sanitizer family tools sources for external tools.
+%package -n gcc-log-wrapper
+Summary: GCC wrapper for logs saving
+Group: Development/Tools
+BuildArch: noarch
+Requires: gcc
+
+%description -n gcc-log-wrapper
+GCC wrapper for logs saving
+
+%post -n gcc-log-wrapper
+# Warning: below for SVACE tool - it can't capture the data if a wrapper is symlink
+PATHCC1=$(gcc -v 2>&1|grep COLLECT_LTO_WRAPPER|sed 's/COLLECT_LTO_WRAPPER=//') ; \
+PATHCC1=$(dirname $PATHCC1) ; \
+if [ ! -f $PATHCC1/cc1.orig ] ; then \
+ mv $PATHCC1/cc1{,.orig} ; \
+else \
+ rm $PATHCC1/cc1 ; \
+fi ; \
+if [ ! -f $PATHCC1/cc1plus.orig ] ; then \
+ mv $PATHCC1/cc1plus{,.orig} ; \
+else \
+ rm $PATHCC1/cc1plus ; \
+fi ; \
+ln /usr/lib/gcc-log-wrapper/cc1 $PATHCC1/cc1 ; \
+ln /usr/lib/gcc-log-wrapper/cc1 $PATHCC1/cc1plus
+
+%preun -n gcc-log-wrapper
+PATHCC1=$(gcc -v 2>&1|grep COLLECT_LTO_WRAPPER|sed 's/COLLECT_LTO_WRAPPER=//') ; \
+PATHCC1=$(dirname $PATHCC1) ; \
+if [ -f $PATHCC1/cc1.orig ] ; then \
+ rm -f $PATHCC1/cc1 ; \
+ mv $PATHCC1/cc1{.orig,} ; \
+fi ; \
+if [ -f $PATHCC1/cc1plus.orig ] ; then \
+ rm -f $PATHCC1/cc1plus ; \
+ mv $PATHCC1/cc1plus{.orig,} ; \
+fi
+
+
%prep
%build
install -m 0644 %{SOURCE26} %{buildroot}/%{_rpmconfigdir}/
install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
+mkdir -p %{buildroot}/usr/lib/gcc-log-wrapper
+install -m 0755 %{SOURCE28} %{buildroot}/usr/lib/gcc-log-wrapper/
+
%files
#%manifest gcc-contrib.manifest
%defattr(-,root,root,-)
%{_prefix}/bin/asan_symbolize.py
+%files -n gcc-log-wrapper
+%defattr(-,root,root,-)
+/usr/lib/gcc-log-wrapper/cc1
+
%changelog