31 Commits

Author SHA1 Message Date
Philippe Waroquiers
ab773096df Fix 338252 - building valgrind with -flto (link time optimisation) fails
* Addition of a new configure option --enable-lto=yes or --enable-lto=no
  Default value is --enable-lto=no, as the build is significantly slower,
  so is not appropriate for valgrind development : this should be used
  only on buildbots and/or by packagers.

* Some files containins asm functions have to be compiled without lto:
    coregrind/m_libcsetjmp.c
    coregrind/m_main.c
  If these are compiled with lto, that gives undefined symbols at link time.
  The files to compile without lto are
    coregrind/m_libcsetjmp.c
    coregrind/m_main.c

  To compile these files with other options, a noinst target lib is defined.
  The objects of this library are then added to the libcoregrind.

* memcheck/mc_main.c : move the handwritten asm helpers to mc_main_asm.c.
  This avoids undefined symbols on some toolchains. Due to this,
  the preprocessor symbols that activate the fast or asm memcheck helpers
  are moved to mc_include.h
  Platforms with handwritten helpers will also have the memcheck primary
  map defined non static.

* In VEX, auxprogs/genoffsets.c also has to be compiled without lto,
  as the asm produced by the compiler is post-processed to produce
  pub/libvex_guest_offsets.h. lto not producing asm means the generation
  fails if we used -flto to compile this file.

* all the various Makefile*am are modified to use LTO_CFLAGS for
  (most) targets. LTO_CFLAGS is empty when --enable-lto=no,
  otherwise is set to the flags needed for gcc.
  If --enable-lto=no, LTO_AR and LTO_RANLIB are the standard AR and RANLIB,
  otherwise they are the lto capable versions (gcc-ar and gcc-ranlib).

* This has been tested on:
    debian 9.4/gcc 6.3.0/amd64+x86
    rhel 7.4/gcc 6.4.0/amd64
    ubuntu 17.10/gcc 7.2.0/amd64+x86
    fedora26/gcc 7.3.1/s390x

  No regressions on the above.
2018-03-18 13:53:38 +01:00
Bart Van Assche
4187fcf384 drd/Makefile.am: Add -Wswitch-enum
Hopefully one day this compiler flag can be enabled for the entire Valgrind
code base.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14548
2014-09-18 06:54:52 +00:00
Julian Seward
26f0bb05e7 Be more careful to separate build flags for the preload shared objects
as opposed to the valgrind code proper.  In particular, make sure that
-mpreferred-stack-boundary=2 does not get used for the preload shared
objects, since that can cause the stack to become misaligned and leads
to segfaults.  Modified version of a patch from Matthias Schwarzott
(zzam@gentoo.org).  Fixes #324050.

Also, fix the configure check in configure.ac for
-mpreferred-stack-boundary=2 so that it checks whether this is
allowable for 32-bit code generation even on 64-bit (x86) hosts.  This
check was wrong before now and led to 32-bit builds on 64-bit hosts
generating poorer code for speed critical helper functions (eg
helperc_LOADV32le) than on 32-bit builds on 32-bit hosts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14471
2014-09-05 20:00:22 +00:00
Bart Van Assche
d665dce62e drd: Add __cxa_guard_*() intercepts
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14012
2014-06-09 07:55:14 +00:00
Bart Van Assche
24d9acaac7 drd: Revert r12651 because it didn't change drd's behavior on any platform
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12799
2012-07-28 14:32:03 +00:00
Bart Van Assche
7d201ff42b drd: Make sure that frame unwind information is generated for DRD intercepts
such that pthread_cancel() works properly. See also Ulrich Drepper, Cancellation
and C++ Exceptions, 2010 (http://udrepper.livejournal.com/21541.html).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12651
2012-06-17 08:46:32 +00:00
Bart Van Assche
6cfdbe2eab drd: Switch to new pool allocator
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12344
2012-01-18 09:46:57 +00:00
Bart Van Assche
8a25238262 drd: Add drd/docs/drd-xml-output.xsd to the distribution tarball
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12156
2011-10-14 17:53:30 +00:00
Bart Van Assche
c5f17ab61b DRD: Added a (non-functional so far) file drd_darwin_intercepts.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11596
2011-03-06 12:39:12 +00:00
Bart Van Assche
295d0f65df Added and commented out the CFLAG -DENABLE_DRD_CONSISTENCY_CHECKS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11323
2010-09-02 14:09:57 +00:00
Nicholas Nethercote
6fd0eb7b07 Merged the MACOSX106 branch to the trunk. Merge command:
svn merge -r11143:HEAD svn://svn.valgrind.org/valgrind/branches/MACOSX106

There were some easy-to-resolve conflicts.

Then I had to fix up coregrind/link_tool_exe*.in -- those files had been
added independently on both the trunk and the branch, AFAICT.  I just
overwrote the trunk versions with the branch versions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11194
2010-07-01 00:20:20 +00:00
Julian Seward
05124264b0 Remove link_tool_exe.c and replace it with perl scripts that do the
same thing.  A .c file doesn't work for cross compilation.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11174
2010-06-13 22:13:58 +00:00
Bart Van Assche
b0c39b2f5f Replaced dynamic initialization of DRD_(pthread_cond_initializer) by static initialization.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11145
2010-06-02 19:32:51 +00:00
Julian Seward
c46347280b Add a new program (link_tool_exe.c) and use this to link the tool
executables.  Gets rid of the linker script kludgery and uniformly
uses -Ttext=0x38000000 (or whatever) on Linux, so as to accomodate
both traditional ld and gold.  Should fix #193413 although I have
been unable to test it.  Using a whole new program seems like
overkill, but this is infrastructure to support static linking of
the tool executables on MacOS too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11141
2010-06-02 00:31:34 +00:00
Bart Van Assche
e5f5573f88 Changes:
- Generalized the behavior of happens-before / happens-after annotations such
  that not only 1:1 but also n:m patterns are supported.
- Dropped support for invoking happens-before / happens-after annotations on
  POSIX condition variables (pthread_cond_t).
- Report the details about the offending synchronization object in generic
  errors.
- Converted a few tl_assert() statements into error messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11073
2010-03-07 10:54:21 +00:00
Nicholas Nethercote
dbcea71779 More docs build tweaks:
- Actually remove the dead docs/images/massif*.png files (this was meant to
  happen in r10720).

- Inline $TOOL/docs/Makefile.am into $TOOL/Makefile.am for all 10 tools.  10
  fewer Makefile.am files FTW!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10721
2009-08-05 08:08:18 +00:00
Bart Van Assche
9c982f8ac5 Cleanup: removed source code commented out via #if 0 / #endif.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10541
2009-07-23 06:47:38 +00:00
Nicholas Nethercote
b05a2a18d7 This commit merges the BUILD_TWEAKS branch onto the trunk. It has the
following improvements:

- Arch/OS/platform-specific files are now included/excluded via the
  preprocessor, rather than via the build system.  This is more consistent
  (we use the pre-processor for small arch/OS/platform-specific chunks
  within files) and makes the build system much simpler, as the sources for
  all programs are the same on all platforms.

- Vast amounts of cut+paste Makefile.am code has been factored out.  If a
  new platform is implemented, you need to add 11 extra Makefile.am lines.
  Previously it was over 100 lines.

- Vex has been autotoolised.  Dependency checking now works in Vex (no more
  incomplete builds).  Parallel builds now also work.  --with-vex no longer
  works;  it's little use and a pain to support.  VEX/Makefile is still in
  the Vex repository and gets overwritten at configure-time;  it should
  probably be renamed Makefile-gcc to avoid possible problems, such as
  accidentally committing a generated Makefile.  There's a bunch of hacky
  copying to deal with the fact that autotools don't handle same-named files
  in different directories.  Julian plans to rename the files to avoid this
  problem.

- Various small Makefile.am things have been made more standard automake
  style, eg. the use of pkginclude/pkglib prefixes instead of rolling our
  own.

- The existing five top-level Makefile.am include files have been
  consolidated into three.

- Most Makefile.am files now are structured more clearly, with comment
  headers separating sections, declarations relating to the same things next
  to each other, better spacing and layout, etc.

- Removed the unused exp-ptrcheck/tests/x86 directory.

- Renamed some XML files.

- Factored out some duplicated dSYM handling code.

- Split auxprogs/ into auxprogs/ and mpi/, which allowed the resulting
  Makefile.am files to be much more standard.

- Cleaned up m_coredump by merging a bunch of files that had been
  overzealously separated.

The net result is 630 fewer lines of Makefile.am code, or 897 if you exclude
the added Makefile.vex.am, or 997 once the hacky file copying for Vex is
removed.  And the build system is much simpler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10364
2009-06-24 00:37:09 +00:00
Bart Van Assche
7c518a0c3f Merged revisions 10129:10130 from the DRDDEV branch to the trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10355
2009-06-21 10:11:15 +00:00
Nicholas Nethercote
07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +00:00
Bart Van Assche
9353dd404e - Moved several functions and variables from one source file to another.
- Created two new source files: drd_load_store.h and .c.
- Removed the header file drd_track.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9153
2009-02-14 15:13:31 +00:00
Nicholas Nethercote
ed322feb84 Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
  configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
  #defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
  in them.
- The ones that are in all-caps have a _CAPS suffix.

So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer.  The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.

cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities.  In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits.  Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones.  (This is partially merged from the DARWIN branch.)

configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.

valgrind.pc.in: try to make this more accurate.  I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031
2009-01-22 21:56:32 +00:00
Bart Van Assche
d5779b517d Sorted noinst_HEADERS filenames alphabetically.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8464
2008-07-28 12:03:53 +00:00
Julian Seward
361057f5dc Include inlined C files in tarball, else it's not buildable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8457
2008-07-23 20:08:41 +00:00
Bart Van Assche
ad3d50a818 Restored proper compiler flag order.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8423
2008-07-12 16:31:10 +00:00
Bart Van Assche
4b14906694 Cleanup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8422
2008-07-12 16:16:26 +00:00
Bart Van Assche
16c10b11d9 Qt4 and GOMP intercepts are now always built, whether or not runtime support for these libraries is present on the build system.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8387
2008-07-07 18:37:30 +00:00
Bart Van Assche
6036e0a75c Added intercepts for the public member functions of the Qt4 QMutex class.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8383
2008-07-07 17:27:48 +00:00
Bart Van Assche
8e96150945 Merged FORMATCHECK branch (r8368) to trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369
2008-07-07 06:49:24 +00:00
Bart Van Assche
d02145e4c2 Added -Wformat-nonliteral.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8366
2008-07-05 16:22:36 +00:00
Bart Van Assche
6e368a9f37 Renamed exp-drd directory into drd. Moved drd from the experimental tool class to the class of regular tools.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8361
2008-07-04 15:14:35 +00:00