64 Commits

Author SHA1 Message Date
Paul Floyd
e2583c02a5 FreeBSD support, patch 2
Files in the root directory
Several Makefile.am files that have dependencies on FreeBSD autoconf
variables. Included a few new filter files to act as placeholders
to create new freebsd subdirectories.

Updated NEWS with the FreeBSD bugzilla items plus a couple of other
items fixed indirectly.
2021-10-07 08:18:47 +02:00
Tulio Magno Quites Machado Filho
a63e9c28b5 powerpc: Add .machine directives for scv, copy, paste, cpabort instructions
GCC is no longer passing the "-many" flag to the assembler.  So, the
inline assembly instructions statements need to use the .machine directives
for the specific platform.

(gcc commit e154242724b084380e3221df7c08fcdbd8460674 ; "[RS6000] Don't
pass -many to the assembler".

Hardware sync instruction (hwsync) added after the copy, paste and cpabort
instructions to improve the reliability of the test.
2021-09-30 17:30:01 -05:00
Carl Love
8afb49abe0 PPC64: Add support for the darn instruction 2021-05-04 10:38:48 -05:00
Mark Wielaard
c9d1cd0db3 Use pkglibexec as vglibdir.
vglibdir is the directory from where valgrind loads its internal tool
executables and vgpreloads. Currently vglibdir is pkglibdir, so those
internal tools are intermingeled with normal executables and libraries
that the user might use directly.

Make vglibdir equal to pkglibexecdir so the internal tools get installed
and loaded from libexec and don't get get stored under lib.

This leaves just the static archives and the mpiwrapper libraries that
the user would link/load themselves under pkglibdir.

This seems more in line with the FHS lib/libexec standard and makes it
slightly easier to combine the tools from a multilib target (say the
memcheck-amd64-linux and memcheck-x86-linux tools) because they would
be installed under the same directory, while the pkglibdir can differ
depending on arch/target (lib/lib64).

https://bugs.kde.org/show_bug.cgi?id=433323
2021-02-28 17:49:40 +01:00
Paul Floyd
8caab853a7 Bug 391853 - Makefile.all.am:L247 and @SOLARIS_UNDEF_LARGESOURCE@ being empty 2021-01-06 10:57:11 +01:00
Carl Love
025bdca23b PowerPC, fix for conv_f16_to_double xscvhpdp assembler code
The previous commit:

  commit eb82a294573d15c1be663673d55b559a82ca29d3
  Author: Julian Seward <jseward@acm.org>
  Date:   Tue Nov 10 21:10:48 2020 +0100

      Add a missing ifdef, whose absence caused build breakage on non-POWER targets.

fixed the compile issue in conv_f16_to_double() where non-Power platforms
do not support the power xscvhpdp assembly instructions.  The instruction
is supported by ISA 3.0 platforms.  Older Power platforms still fail to
compile with the assembly instruction.  This patch fixes the if def for
power systems that do not support ISA 3.0.
2020-11-16 11:50:39 -06:00
Petar Jovanovic
deae79f733 mips: Add nanoMIPS support to Valgrind 4/4
Necessary changes to support nanoMIPS on Linux.

Part 4/4 - Other changes (mainly include/*)

Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic,
Nikola Milutinovic and Aleksandra Karadzic.

Related KDE issue: #400872.
2019-12-31 12:05:33 +00:00
Mark Wielaard
f04ae9f359 Use gcc -Wimplicit-fallthrough=2 by default if available
GCC 7 instroduced -Wimplicit-fallthrough
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

It caught a couple of bugs, but it does need a bit of extra comments to
explain when a switch case statement fall-through is deliberate. Luckily
with -Wimplicit-fallthrough=2 various existing comments already do that.
I have fixed the bugs, but adding explicit break statements where
necessary and added comments where the fall-through was correct.

https://bugs.kde.org/show_bug.cgi?id=405430
2019-03-27 15:34:45 +01:00
Rhys Kidd
3cd099ab5f macOS: Don't duplicate -fno-stack-protector
Since f38d96d -fno-stack-protector has been added to $(AM_CFLAGS_BASE) on all
platforms, if the compiler supports it. Accordingly, there's no need to still add
this a second time specifically for macOS.

Fixes: f38d96d ("Add -Wformat -Wformat-security to the list of compile flags.")
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
2019-03-11 22:49:37 +11:00
Rhys Kidd
71cf18c120 config: Conditionalize -finline-functions on compiler support
Certain clang compiler versions do not support -finline-functions, so only apply
this compiler option conditionally if supported.

Warnings with Apple LLVM version 8.0.0 (clang-800.0.42.1), based on upstream clang 3.9.0:

  clang: warning: optimization flag '-finline-functions' is not supported
  clang: warning: argument unused during compilation: '-finline-functions'

Fixes: 7dd9a7f ("Add -finline-functions to standard build flags, so gcc will
                 consider all functions as candidates for inlining.")

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
2019-03-11 22:49:37 +11:00
Julian Seward
3e94579a5a Enable warning flag -Wenum-conversion if the compiler supports it.
This picks up some enum type confusion, and so looks useful.  Unfortunately
only Clang seems to have it; gcc doesn't.
2019-01-26 18:19:50 +01:00
Petar Jovanovic
9a6cf7a41c mips64: add N32 ABI support
Adding MIPS N32 ABI support.

BZ issue - #345763.

Contributed and maintained by mulitple people over the years:
  Crestez Dan Leonard, Maran Pakkirisamy, Dimitrije Nikolic,
  Aleksandar Rikalo, Tamara Vlahovic.
2018-06-14 17:40:08 +00:00
Ivo Raisr
f19a956e0a Enable -Wlogical-op for Valgrind; fix an obvious typo.
Fixes BZ#389065.
Reported by: dcb314@hotmail.com
2018-01-23 10:43:19 +01:00
Mark Wielaard
ea1c229392 Remove all extra -std=c99 flags from Makefiles.
Configure now makes sure we build everything in c99 mode already.
No need to have extra special cases in the Makefiles.
2018-01-19 13:52:29 +01:00
Julian Seward
7dd9a7f8b3 Add -finline-functions to standard build flags, so gcc will consider all functions as candidates for inlining. 2017-11-07 14:18:16 +01:00
Petar Jovanovic
c069589178 mips: add support for bi-arch build on mips64
If native compiler can build Valgrind for mips32 o32 on native mips64
system, it should do it.
This change adds a second architecture for MIPS in a similar way how it has
been previously done for amd64 and ppc64.
2017-10-10 18:06:14 +02:00
Mark Wielaard
3387b8ba5f Fix vgversion.h generation for builddir != srcdir.
Make sure to include the builddir include directory to find the
generated vgversion.h. Make include/vgversion.h a .PHONY target
so it always gets regenerated even if the file is already there.
Make sure to run svnversion in the srcdir.

Patch by Matthias Schwarzott <zzam@gentoo.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16397
2017-05-17 20:38:18 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Julian Seward
0661bc7e60 Merge from branches/VALGRIND_3_12_BRANCH:
16095 Build fixes for MacOS X 10.10.5.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16099
2016-10-23 05:56:27 +00:00
Ivo Raisr
970c6d26d2 New gcc versions (4.9, 5.3) provided by Solaris enable
largefile support by default. This gets in the way what
Valgrind core expects (vki, various m_libc modules).
Therefore disable largefile support if it is enabled.
Anyway, support for 32-bit applications is going away in Solaris 12.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15785
2016-02-12 13:43:59 +00:00
Florian Krohm
b41e80f228 Do not compile with -Wcast-align on arm. There are too many
warnings due to GCC being very conservative. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15651
2015-09-14 21:11:32 +00:00
Florian Krohm
9a3883bf3d Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15510
2015-08-08 21:45:33 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Florian Krohm
2de98199b0 Add -Wempty-body to the list of compile flags.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15319
2015-06-05 16:26:14 +00:00
Mark Wielaard
d2b96ae95b GCC 5.1 is too smart. Disable Identical Code Folding for preload libs.
We want to disabled Identical Code Folding for the tools preload shared
objects to get better backraces. For GCC 5.1 -fipa-icf is enabled by
default at -O2.

    The optimization reduces code size and may disturb
    unwind stacks by replacing a function by equivalent
    one with a different name.

Add a configure check to see if GCC supports -fno-ipa-icf.
If it does then add the flag to AM_CFLAGS_PSO_BASE.

Without this GCC will notice some of the preload replacement functions
in vg_replace_strmem are identical and fold them all into one picking
a random (existing) function name. This causes backtraces showing
completely unexpected function names.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15305
2015-06-02 20:23:06 +00:00
Florian Krohm
096bcbf059 Enable a few more compiler warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15243
2015-05-16 16:17:52 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Florian Krohm
6dce653240 Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan 
- add __ubsan helpers (by Julian)

This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14995
2015-03-10 16:13:59 +00:00
Florian Krohm
522dc6e7ce Add -std=gnu99 to the list of compile flags.
Remove -Wno-long-long as it is no longer needed. long long is part
of C99.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14841
2015-01-01 18:26:05 +00:00
Florian Krohm
f38d96dd61 Add -Wformat -Wformat-security to the list of compile flags.
This was not as straight forward as expected. Specifically, adding the
new flag to CFLAGS in configure.ac did not work and was causing
compiler warnings. For instance, compiling memcheck/tests/execve2.c will
generate a -Wnonnull warning even though the testcase is explicitly
compiled with -Wno-nonnull. The reason is that (a) -Wformat is implied by
-Wnonnull and (b) the list of compiler flags gets assembled in the wrong
order. The culprit appears to be that we modify CFLAGS in configure.ac and
that really is not the right place. Conceptually, configure should determine
tool-chain capabilities and not assemble compiler flags. That should be done
in Makefiles. This patch entangles all this.

So, whatever was added to CFLAGS in configure.ac has now been moved to
Makefile.all.am and Makefile.tool-tests.am. Those are:
-Wno-long-long
-Wwrite-strings
-Wcast-qual
-fno-stack-protector
Note, that this change allows us to simplify Makefile.tool-tests.am which
in the past was disabling some of those flags (e.g. by adding -Wno-cast-qual
again).
In case of the clang compiler, extra command line options are needed. I've
moved those into a separate 'if COMPILER_IS_CLANG' section and not merge
them into baseline flags.

Related to BZ 334727.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14798
2014-12-03 22:53:00 +00:00
Florian Krohm
69d42e3d4b Fix BZ 334802. Patch by Mark Wielaard with a few mods to make it apply.
r14794 is related as well.
Also: remove -Wno-format-zero-length from compile options.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14795
2014-11-29 14:41:32 +00:00
Julian Seward
3f24896f10 Back out r14781, which was unintended.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14782
2014-11-25 11:43:54 +00:00
Julian Seward
bf927a2e32 arm64: implement "BRK #imm16".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14781
2014-11-25 11:37:14 +00:00
Florian Krohm
a509865ccb Enable -Wcast-align globally.
Tested on x86-64, s390, and ppc64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14551
2014-09-18 18:10:37 +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
Carl Love
a63481696f This commit is for Bugzilla 334834.
A performance regression was found due to the
-02 -m64 flags not being included when compiling
the VEX PPC64 code.  This commit fixes the Makefile
to pass the needed flags when compiling VEX PPC64
code.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14246
2014-08-08 22:29:10 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Julian Seward
e9fa7e1483 Add -Wno-tautological-compare to the standard compile flags, if that
is accepted.  With XCode 5.5.1 -Wtautological-compare appears to come
as standard, and it generates a lot of mostly useless noise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14136
2014-07-08 07:40:56 +00:00
Julian Seward
91350dc8a5 Add initial build support for Mac OS X 10.9 (Mavericks). Bug 326724
comment 12.  (Diego Giagio, diego@giagio.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14055
2014-06-20 11:48:38 +00:00
Mark Wielaard
895f25f4a2 Add uninstall-local rules to make distcheck happy.
Also remove generated FAQ.txt in docs distclean-local rule.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13950
2014-05-09 14:25:39 +00:00
Mark Wielaard
fbd9fe855d Out of tree build. Partial fix for Bug 333628.
Patch by Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
Partial fix. make && make check now works with builddir != srcdir.
But make regtest doesn't yet.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13949
2014-05-09 13:34:13 +00:00
Dejan Jevtic
1413bad9ec mips32/64: Remove default flags -mips32 and -mips64 from the Makefile.all.am.
During configuration of Valgrind we check does the compiler support -march=mips32 and
-march=mips64. If compiler supports these flags we are using them as default flags for
mips32 and mips64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13815
2014-02-18 16:40:25 +00:00
Julian Seward
3f6d211236 Add support for ARMv8 AArch64 (the 64 bit ARM instruction set).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13770
2014-01-12 12:54:00 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Philippe Waroquiers
ab7b338320 301265 - add x86 support to Android build
Patch by Dragos Tatulea.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12835
2012-08-05 00:08:25 +00:00
Julian Seward
3e344c57f6 Merge in a port for mips32-linux, by Petar Jovanovic and Dejan Jevtic,
mips-valgrind@rt-rk.com, Bug 270777.

Valgrind: changes to existing files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12616
2012-06-07 09:13:21 +00:00
Florian Krohm
92c67b0ade Add -fomit-frame-pointer for s390. The GCC maintainer was telling me that
this has been the preferred way to compile for quite a while. So let's follow
suit. The perf bucket did not reveal any measurable difference.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12572
2012-05-21 16:18:23 +00:00
Philippe Waroquiers
cad5f2ea1d Bypass gcc 4.4/4.5 compilation bug by moving -fomit-frame-pointer to Makefile.all.am
gcc 4.4 and 4.5 has a bug which causes miscompilation of mc_main.c:
 args are not correctly given to VG_(am_munmap_valgrind).
This causes the secondary map entries to not be unmapped
(which can cause unlimited memory growth) 
and/or causes the assert on VG_(am_munmap_valgrind) result to fail.

Removing the pragma optimize from mc_main.c and inserting it instead
in Makefile.all.am for x86 solves the gcc bug.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12564
2012-05-15 21:04:31 +00:00
Florian Krohm
46b85eeb12 Require automake-1.10 for proper handling of include file dependencies
in .S files. Also included here is some cleanup, including a reversion
of r10378. Fixes bugzilla #197914.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12555
2012-05-06 03:37:25 +00:00
Julian Seward
e8ce3f7abb Compile everything with -fno-builtin, so as to disable LLVM's
idiom-recognition optimisation.  This identifies memset-style
loops and turns them into calls to memset, which in this case
leads to infinite recursion because it does this transformations
in VG_(memset), which is called from memset(), which we also define.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12065
2011-09-29 17:29:53 +00:00