Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 942f36be6b50523b0497d9f09dbcf35b > files > 36

valgrind-3.8.1-6.mga3.src.rpm

%define _requires_exceptions GLIBC_PRIVATE

#one of valgrind internal library is not linked to libc. Not sure if it should be fixed or not (since all test don't pass anyway), so disable check for now
%define _disable_ld_no_undefined 1

# disable debug package, it can prevent valgrind for working properly
%define debug_package   %{nil}

# (blino) FIXME: reenable qt4 as soon as availble in cauldron
%bcond_without	qt4

Name: 		valgrind
Version:	3.8.1
Release:	%mkrel 6
Summary: 	Memory debugger
License: 	GPLv2+
Group: 		Development/Tools
Source0:	http://www.valgrind.org/downloads/%{name}-%{version}.tar.bz2
# From Fedora:
Patch1: valgrind-3.8.1-cachegrind-improvements.patch
# KDE#307103 - sys_openat If pathname is absolute, then dirfd is ignored.
Patch2: valgrind-3.8.1-openat.patch
# KDE#211352 - helgrind races in helgrind's own mythread_wrapper
Patch3: valgrind-3.8.1-helgrind-race-supp.patch
Patch4: valgrind-3.8.1-stat_h.patch
# Support really ancient gcc. Check __GNUC__ >= 3 for __builtin_expect.
Patch5: valgrind-3.8.1-config_h.patch
# KDE#307101 - sys_capget second argument can be NULL 
Patch6: valgrind-3.8.1-capget.patch
# KDE#263034 - Crash when loading some PPC64 binaries 
Patch7: valgrind-3.8.1-pie.patch
# configure detection change from armv7* to armv[57]*.
Patch8: valgrind-3.8.1-enable-armv5.patch
Patch9: valgrind-3.8.1-ldso-supp.patch
# On x86 GCC 4.6 and later now defaults to -fomit-frame-pointer
# together with emitting unwind info (-fasynchronous-unwind-tables).
# So, try CF info first.
Patch10: valgrind-3.8.1-x86-backtrace.patch
# KDE#305431 - Use find_buildid shdr fallback for separate .debug files
Patch11: valgrind-3.8.1-find-buildid.patch
# KDE#305513 - Robustify abbrev reading (part already upstream).
Patch12: valgrind-3.8.1-abbrev-parsing.patch
# KDE#307038 - DWARF2 CFI reader: unhandled DW_OP_ opcode 0x8 (DW_OP_const1u) 
Patch13: valgrind-3.8.1-cfi_dw_ops.patch
# On some ppc64 installs these test just hangs
Patch14: valgrind-3.8.1-gdbserver_tests-mcinvoke-ppc64.patch
# KDE#307285 - x86_amd64 feature test for avx in test suite is wrong
# Should test OSXSAVE first before executing XGETBV.
Patch15: valgrind-3.8.1-x86_amd64_features-avx.patch
# KDE#307155 - gdbserver_tests/filter_gdb should filter out syscall-template.S
# This is only a real issue when glibc-debuginfo is installed.
Patch16: valgrind-3.8.1-gdbserver_tests-syscall-template-source.patch
# KDE#307290 - memcheck overlap testcase needs memcpy version filter
Patch17: valgrind-3.8.1-overlap_memcpy_filter.patch
# Note: Need to make memcheck/tests/filter_memcpy executable

# KDE#307729 - pkgconfig support broken valgrind.pc
# valt_load_address=@VALT_LOAD_ADDRESS@
Patch18: valgrind-3.8.1-pkg-config.patch

# KDE#253519 - Memcheck reports auxv pointer accesses as invalid reads.
Patch19: valgrind-3.8.1-proc-auxv.patch

# KDE#307828 - SSE optimized wcscpy, wcscmp, wcsrchr and wcschr trigger
# uninitialised value and/or invalid read warnings
Patch20: valgrind-3.8.1-wcs.patch

# KDE#305728 - Add support for AVX2, BMI1, BMI2 and FMA instructions 
# Combined patch for:
# - valgrind-avx2-1.patch
# - valgrind-avx2-2.patch
# - valgrind-avx2-3.patch
# - valgrind-avx2-4.patch
# - valgrind-bmi-1.patch
# - valgrind-bmi-2.patch
# - valgrind-bmi-3.patch
# - valgrind-fma-1.patch
# - valgrind-memcheck-avx2-bmi-fma.patch
# - valgrind-vmaskmov-load.patch
# - valgrind-avx2-5.patch
# - valgrind-bmi-4.patch
# - valgrind-avx2-bmi-fma-tests.tar.bz2
#
# NOTE: Need to touch empty files from tar file:
# ./none/tests/amd64/avx2-1.stderr.exp
# ./none/tests/amd64/fma.stderr.exp
# ./none/tests/amd64/bmi.stderr.exp
Patch21: valgrind-3.8.1-avx2-bmi-fma.patch
# Small fixup for above patch, just a configure check.
# This is equivalent to valgrind-bmi-5.patch from KDE#305728
Patch22: valgrind-3.8.1-bmi-conf-check.patch
# Partial backport of upstream revision 12884 without it AVX2 VPBROADCASTB
# insn is broken under memcheck.
Patch23: valgrind-3.8.1-memcheck-mc_translate-Iop_8HLto16.patch
# vgtest files should prereq that the binary is there (for old binutils).
Patch24: valgrind-3.8.1-avx2-prereq.patch
# KDE#308321 - testsuite memcheck filter interferes with gdb_filter
Patch25: valgrind-3.8.1-filter_gdb.patch
# KDE#308341 - vgdb should report process exit (or fatal signal) 
Patch26: valgrind-3.8.1-gdbserver_exit.patch
# KDE#164485 - VG_N_SEGNAMES and VG_N_SEGMENTS are (still) too small
Patch27: valgrind-3.8.1-aspacemgr_VG_N_SEGs.patch
# KDE#308427 - s390 memcheck reports tsearch conditional jump or move
#              depends on uninitialized value [workaround, suppression]
Patch28: valgrind-3.8.1-s390_tsearch_supp.patch
# KDE#307106 - unhandled instruction bytes: f0 0f c0 02 (lock xadd)
Patch29: valgrind-3.8.1-xaddb.patch
# KDE#309427 - SSE optimized stpncpy trigger uninitialised value
Patch30: valgrind-3.8.1-stpncpy.patch
# KDE#308573 - Internal Valgrind error on 64-bit instruction executed
#              in 32-bit mode
Patch31: valgrind-3.8.1-ppc-32-mode-64-bit-instr.patch
# KDE#309425 - Provide a --sigill-diagnostics flag to suppress
#              illegal instruction reporting
Patch32: valgrind-3.8.1-sigill_diag.patch

# https://bugs.kde.org/show_bug.cgi?id=305513
# fixes segfault on running "valgrind urpmi null":
Patch102:	valgrind-fix-segv.diff
# allow build with glibc 2.17
Patch103:	valgrind-3.8.1-glibc-2.17.patch

URL: 		http://valgrind.org/
ExclusiveArch:	%{ix86} x86_64 ppc
BuildRequires:	glibc-static-devel
BuildRequires:	gdb
# (proyvind): build with support for OpenMP, boost & qt4 threads
BuildRequires:	libgomp-devel boost-devel
%if %{with qt4}
BuildRequires:	qt4-devel
%endif
Suggests:	gdb
Obsoletes:	valgrind-plugins

%description
When a program is run under Valgrind's supervision, all reads and
writes of memory are checked, and calls to malloc/new/free/delete are
intercepted. As a result, Valgrind can detect problems such as:

    * Use of uninitialised memory
    * Reading/writing memory after it has been free'd
    * Reading/writing off the end of malloc'd blocks
    * Reading/writing inappropriate areas on the stack
    * Memory leaks -- where pointers to malloc'd blocks are lost forever
    * Passing of uninitialised and/or unaddressible memory to system calls
    * Mismatched use of malloc/new/new [] vs free/delete/delete []

%files
%doc README* AUTHORS FAQ.txt
%{_bindir}/*
%{_libdir}/%{name}
%{_mandir}/man1/*.1*
%{_datadir}/valgrind/*.xml
%{_datadir}/valgrind/default.supp

#--------------------------------------------------------------------

%package	devel
Summary:	%{summary}
Group:		%{group}
Conflicts:	%{name} < 3.6.1-3

%description	devel
Development files required to develop software using valgrind.

%files devel
%dir %{_includedir}/valgrind
%{_includedir}/valgrind/*
%{_libdir}/pkgconfig/%{name}.pc

#--------------------------------------------------------------------

%prep
%setup -q
%apply_patches

%build

# Convert the library paths with /lib or /lib64 in the suppressions to those
# with /usr/lib or /usr/lib64 due to the /usrmove .
perl -pi -e 's!obj:/lib!obj:/usr/lib!g' *.supp *.supp.in

# (From Fedora):
# Filter out some flags that cause lots of valgrind test failures.
# Also filter away -O2, valgrind adds it wherever suitable, but
# not for tests which should be -O0, as they aren't meant to be
# compiled with -O2 unless explicitely requested.
export CFLAGS="`echo " %{optflags} " | sed 's/ -m\(64\|3[21]\) / /g;s/ -fexceptions / /g;s/ -fstack-protector / / g;s/ -Wp,-D_FORTIFY_SOURCE=2 / /g;s/-O2 / /g;s/^ //;s/ $//'`"

# filter out one more flag (unused in FC but causes faillure in mga3:
export CFLAGS="`echo " ${CFLAGS} " | sed -e 's/ -fPIC//'`"
# fix flags in other cases (CXXFLAGS, FFLAGS):
%define optflags $CFLAGS

# rebuild unconditionally because we patch configure.in
autoreconf -fi
%configure2_5x

%make

%install
# Don't strip (prevent valgrind from working properly, as explained in README_PACKAGERS)
export DONT_STRIP=1

# FIXME exporting DONT_STRIP=1 is causing some weird behavior with debug_package
# and causing it to not set DISABLE_DEBUG=1
export DISABLE_DEBUG=1

%makeinstall

mkdir %buildroot/%_datadir/valgrind
mv  %buildroot/%_libdir/valgrind/*.{supp,xml} %buildroot/%_datadir/valgrind

# It's a kludge, but appears to get valgrind to work, because it looks for
# default.supp under %%{_libdir} instead of under %%{_datadir}, where it is
# now installed.
ln -sf %{_datadir}/valgrind/default.supp "$RPM_BUILD_ROOT"/%{_libdir}/valgrind/default.supp

#don't package generated files
rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in

%check
# Ensure there are no unexpected file descriptors open,
# the testsuite otherwise fails.
cat > close_fds.c <<EOF
#include <stdlib.h>
#include <unistd.h>
int main (int argc, char *const argv[])
{
  int i, j = sysconf (_SC_OPEN_MAX);
  if (j < 0)
    exit (1);
  for (i = 3; i < j; ++i)
    close (i);
  execvp (argv[1], argv + 1);
  exit (1);
}
EOF
gcc $RPM_OPT_FLAGS -o close_fds close_fds.c

for i in `find . -type f \( -name *-amd64-linux -o -name *-x86-linux -o -name *-ppc*-linux \)`; do
  case "`file $i`" in
    *ELF*executable*statically\ linked*)
      objcopy -R .debug_loc -R .debug_frame -R .debug_ranges $i
  esac
done

make check || :
# some tests are known to fail,
# just check no more tests are failing than Fedora ;)
echo ===============TESTING===================
# Cancel this temporarily because the tests hang on x86-64:
# http://thread.gmane.org/gmane.comp.debugging.valgrind/11792
# ./close_fds make regtest || :
echo ===============END TESTING===============



%changelog

* Mon Jan 14 2013 umeabot <umeabot> 3.8.1-6.mga3
+ Revision: 385224
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sun Jan 06 2013 cjw <cjw> 3.8.1-5.mga3
+ Revision: 339934
- patch103: allow to build with glibc 2.17

* Fri Dec 14 2012 tv <tv> 3.8.1-4.mga3
+ Revision: 330586
- rebuild for new gdb

* Sun Nov 18 2012 tv <tv> 3.8.1-3.mga3
+ Revision: 319493
- sync patches with FC (after fixing them trying to patch .orig files...)

  + malo <malo>
    - update RPM group

* Thu Oct 11 2012 tv <tv> 3.8.1-2.mga3
+ Revision: 304680
- sync patches with FC

* Wed Sep 26 2012 tv <tv> 3.8.1-1.mga3
+ Revision: 297921
- new release
- sync with FC patches

* Mon Aug 27 2012 tv <tv> 3.8.0-4.mga3
+ Revision: 284624
- new release

* Tue Aug 21 2012 tv <tv> 3.8.0-3.mga3
+ Revision: 282942
- patch 100: fix a crash with mini debug info

* Mon Aug 20 2012 blino <blino> 3.8.0-2.mga3
+ Revision: 282510
- add valgrind-3.8.0-find-buildid.patch workaround from Fedora (RH#849435 KDE#305431)

* Mon Aug 13 2012 tv <tv> 3.8.0-1.mga3
+ Revision: 281166
- drop patch  (what comment said was merged)
- drop merged glibc-2.16 patch
- drop now useless automake patch
- drop merged FC patches
- add new patches from FC
- add one patch from FC (on i?86 prefer to use CFI over %%ebp unwinding, as GCC
  4.6+ defaults to -fomit-frame-pointer)
- like FC, filter out some compilation flags (getting rid of new cloberring
  issues due to -fPIC on x86_64)
- fix install

* Sat Aug 11 2012 blino <blino> 3.7.0-5.mga3
+ Revision: 280480
- add patches from Fedora (and upstream valgrind) to handle dwz DWARF compressor output

* Wed Jul 25 2012 shlomif <shlomif> 3.7.0-4.mga3
+ Revision: 274227
- Convert paths to /usr/lib* instead of /lib* in the suppressions.
  This is another fallout of the /usr-move.

* Sat Jul 21 2012 shlomif <shlomif> 3.7.0-3.mga3
+ Revision: 273153
- Add a blurb to the patch
- New release for glibc-2.16.x.
  1. Fix build with new automake.
  2. Update the valgrind package to accept building against 2.16 (with a patch
  derived from the svn).
  3. Fix problems with unpacked files.
  4. Put a symlink to a place that valgrind is looking for.

* Wed Dec 21 2011 shlomif <shlomif> 3.7.0-1.mga2
+ Revision: 185524
- Cancel make regtest because it hangs.

  + fwang <fwang>
    - sync with mandriva package

* Thu Oct 27 2011 shlomif <shlomif> 3.6.1-5.mga2
+ Revision: 158760
- Applied patches to build against kernel-3.x and glibc-2.14.x

* Wed Jun 22 2011 ahmad <ahmad> 3.6.1-4.mga2
+ Revision: 111971
- Add conflicts to ease updates after the -devel split (from tv)
- Re-enable building with qt4
- Only run autoreconf when building with qt4
- Drop unapplied patch3

* Tue Jun 07 2011 dmorgan <dmorgan> 3.6.1-3.mga2
+ Revision: 101519
- Provide devel subpackage  ( partial merge of mdv commit 659516)

* Sun May 15 2011 pterjan <pterjan> 3.6.1-2.mga1
+ Revision: 99037
- Rebuild for fixed find-requires

* Sat Apr 16 2011 pterjan <pterjan> 3.6.1-1.mga1
+ Revision: 86603
- Update to 3.6.1

* Tue Jan 11 2011 blino <blino> 3.6.0-2.mga1
+ Revision: 6503
- do not build with qt4 support for now
- remove versions in comments
- imported package valgrind