Repository: lucy-clownfish
Updated Branches:
  refs/heads/master fbaafea1c -> 615d033e4


Don't use special compiler flags for Valgrind

We used to compile with -fno-inline-functions under Valgrind. The Perl
runtime also set the optimization level to -O1. I don't think this is
necessary.

Rename the LUCY_VALGRIND environment variable to CLOWNFISH_VALGRIND.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/3b5d9d00
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/3b5d9d00
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/3b5d9d00

Branch: refs/heads/master
Commit: 3b5d9d0074f174e755ebb884c75b8e5c6a8e8cb5
Parents: fbaafea
Author: Nick Wellnhofer <[email protected]>
Authored: Sun May 15 13:17:20 2016 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Sun May 15 13:17:20 2016 +0200

----------------------------------------------------------------------
 compiler/common/charmonizer.c                 |  4 ----
 compiler/common/charmonizer.main              |  4 ----
 compiler/perl/buildlib/Clownfish/CFC/Build.pm |  8 ++------
 compiler/src/CFCTestHierarchy.c               |  6 +++---
 runtime/common/charmonizer.c                  |  5 -----
 runtime/common/charmonizer.main               |  5 -----
 runtime/core/Clownfish/Test/TestVector.c      |  2 +-
 runtime/perl/buildlib/Clownfish/Build.pm      | 14 ++------------
 runtime/perl/t/binding/019-obj.t              |  4 ++--
 runtime/ruby/Rakefile.common                  |  8 --------
 10 files changed, 10 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index 87c80d0..58dfb47 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -7993,10 +7993,6 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
 
     if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags, "-fno-inline-functions");
-        }
-
         chaz_CFlags_append(extra_cflags,
             "-pedantic -Wall -Wextra -Wno-variadic-macros"
             " -Wno-overlength-strings");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/compiler/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.main b/compiler/common/charmonizer.main
index 80f161a..0fb262e 100644
--- a/compiler/common/charmonizer.main
+++ b/compiler/common/charmonizer.main
@@ -98,10 +98,6 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
 
     if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags, "-fno-inline-functions");
-        }
-
         chaz_CFlags_append(extra_cflags,
             "-pedantic -Wall -Wextra -Wno-variadic-macros"
             " -Wno-overlength-strings");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build.pm 
b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
index bb7e115..bd649d8 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
@@ -180,7 +180,7 @@ sub ACTION_code {
 
 sub _valgrind_base_command {
     return
-          "PERL_DESTRUCT_LEVEL=2 LUCY_VALGRIND=1 valgrind "
+          "PERL_DESTRUCT_LEVEL=2 CLOWNFISH_VALGRIND=1 valgrind "
         . "--leak-check=yes "
         . "--show-reachable=yes "
         . "--dsymutil=yes "
@@ -189,8 +189,7 @@ sub _valgrind_base_command {
 
 # Run the entire test suite under Valgrind.
 #
-# For this to work, Lucy must be compiled with the LUCY_VALGRIND environment
-# variable set to a true value, under a debugging Perl.
+# For this to work, the test suite must be run under a debugging Perl.
 #
 # A custom suppressions file will probably be needed -- use your judgment.
 # To pass in one or more local suppressions files, provide a comma separated
@@ -204,9 +203,6 @@ sub ACTION_test_valgrind {
     die "Must be run under a perl that was compiled with -DDEBUGGING"
         unless $self->config('ccflags') =~ /-D?DEBUGGING\b/
                || $^X =~ /\bdebugperl\b/;
-    if ( !$ENV{LUCY_VALGRIND} ) {
-        warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
-    }
     $self->depends_on('code');
 
     # Unbuffer STDOUT, grab test file names and suppressions files.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/compiler/src/CFCTestHierarchy.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestHierarchy.c b/compiler/src/CFCTestHierarchy.c
index 75c6393..83f9081 100644
--- a/compiler/src/CFCTestHierarchy.c
+++ b/compiler/src/CFCTestHierarchy.c
@@ -283,7 +283,7 @@ S_run_clash_tests(CFCTest *test) {
     char *cfclash_foo_path   = CFCTest_path("cfclash" CHY_DIR_SEP "foo");
     char *cfclash_bar_path   = CFCTest_path("cfclash" CHY_DIR_SEP "bar");
 
-    if (getenv("LUCY_VALGRIND")) {
+    if (getenv("CLOWNFISH_VALGRIND")) {
         SKIP(test, 1, "Exceptions leak");
     }
     else {
@@ -304,7 +304,7 @@ S_run_clash_tests(CFCTest *test) {
         CFCParcel_reap_singletons();
     }
 
-    if (getenv("LUCY_VALGRIND")) {
+    if (getenv("CLOWNFISH_VALGRIND")) {
         SKIP(test, 1, "Exceptions leak");
     }
     else {
@@ -342,7 +342,7 @@ S_run_clash_tests(CFCTest *test) {
         CFCParcel_reap_singletons();
     }
 
-    if (getenv("LUCY_VALGRIND")) {
+    if (getenv("CLOWNFISH_VALGRIND")) {
         SKIP(test, 1, "Exceptions leak");
     }
     else {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index 45a11bf..7adf55f 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -8097,11 +8097,6 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
 
     if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_VALGRIND -fno-inline-functions");
-        }
-
         chaz_CFlags_append(extra_cflags,
             "-pedantic -Wall -Wextra -Wno-variadic-macros");
         if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 93eb2b9..3e92f86 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -202,11 +202,6 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
 
     if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_VALGRIND -fno-inline-functions");
-        }
-
         chaz_CFlags_append(extra_cflags,
             "-pedantic -Wall -Wextra -Wno-variadic-macros");
         if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/core/Clownfish/Test/TestVector.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestVector.c 
b/runtime/core/Clownfish/Test/TestVector.c
index d032360..0310f6a 100644
--- a/runtime/core/Clownfish/Test/TestVector.c
+++ b/runtime/core/Clownfish/Test/TestVector.c
@@ -457,7 +457,7 @@ S_test_exception(TestBatchRunner *runner, Err_Attempt_t 
func,
 
 static void
 test_exceptions(TestBatchRunner *runner) {
-    if (getenv("LUCY_VALGRIND")) {
+    if (getenv("CLOWNFISH_VALGRIND")) {
         SKIP(runner, 5, "memory leak");
         return;
     }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm 
b/runtime/perl/buildlib/Clownfish/Build.pm
index 1f20d37..061759d 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -83,12 +83,6 @@ sub new {
         $self->extra_compiler_flags(@$extra_cflags);
     }
 
-    if ( $ENV{LUCY_VALGRIND} ) {
-        my $optimize = $self->config('optimize') || '';
-        $optimize =~ s/\-O\d+/-O1/g;
-        $self->config( optimize => $optimize );
-    }
-
     $self->charmonizer_params( charmonizer_c => $CHARMONIZER_C );
 
     return $self;
@@ -176,7 +170,7 @@ sub ACTION_compile_custom_xs {
 
 sub _valgrind_base_command {
     return
-          "PERL_DESTRUCT_LEVEL=2 LUCY_VALGRIND=1 valgrind "
+          "PERL_DESTRUCT_LEVEL=2 CLOWNFISH_VALGRIND=1 valgrind "
         . "--leak-check=yes "
         . "--show-reachable=yes "
         . "--dsymutil=yes "
@@ -185,8 +179,7 @@ sub _valgrind_base_command {
 
 # Run the entire test suite under Valgrind.
 #
-# For this to work, Lucy must be compiled with the LUCY_VALGRIND environment
-# variable set to a true value, under a debugging Perl.
+# For this to work, the test suite must be run under a debugging Perl.
 #
 # A custom suppressions file will probably be needed -- use your judgment.
 # To pass in one or more local suppressions files, provide a comma separated
@@ -200,9 +193,6 @@ sub ACTION_test_valgrind {
     die "Must be run under a perl that was compiled with -DDEBUGGING"
         unless $self->config('ccflags') =~ /-D?DEBUGGING\b/
                || $^X =~ /\bdebugperl\b/;
-    if ( !$ENV{LUCY_VALGRIND} ) {
-        warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
-    }
     $self->depends_on('code');
 
     # Unbuffer STDOUT, grab test file names and suppressions files.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/perl/t/binding/019-obj.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/019-obj.t b/runtime/perl/t/binding/019-obj.t
index 28efe88..3d22c4e 100644
--- a/runtime/perl/t/binding/019-obj.t
+++ b/runtime/perl/t/binding/019-obj.t
@@ -75,7 +75,7 @@ isa_ok( $object, "Clownfish::Obj",
 
 SKIP: {
     skip( "Exception thrown within STORABLE hook leaks", 1 )
-        if $ENV{LUCY_VALGRIND};
+        if $ENV{CLOWNFISH_VALGRIND};
     my $thawed = TestObj->new;
     eval { freeze($thawed) };
     like( $@, qr/implement/i,
@@ -130,7 +130,7 @@ like( $object->to_string, qr/STRING:.*?SonOfTestObj/,
 
 SKIP: {
     skip( "Exception thrown within callback leaks", 2 )
-        if $ENV{LUCY_VALGRIND};
+        if $ENV{CLOWNFISH_VALGRIND};
 
     # Invoke To_String() from C space.  This test verifies that the Perl
     # bindings generated by CFC handle non-`nullable` return values correctly,

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b5d9d00/runtime/ruby/Rakefile.common
----------------------------------------------------------------------
diff --git a/runtime/ruby/Rakefile.common b/runtime/ruby/Rakefile.common
index 3e61582..1179995 100644
--- a/runtime/ruby/Rakefile.common
+++ b/runtime/ruby/Rakefile.common
@@ -34,10 +34,6 @@ def all_ccflags
     ccflags += ENV['CFLAGS']
   end
   
-  if ENV.has_key?('LUCY_VALGRIND')
-    ccflags += "-fno-inline-functions "
-  end
-  
   # Compile as C++ under MSVC.  Turn off stupid warnings, too.
   if cc_command =~ /^cl\b/ 
     ccflags += '/TP -D_CRT_SECURE_NO_WARNINGS '
@@ -74,10 +70,6 @@ def extra_ccflags
     ccflags += ENV['CFLAGS']
   end
   
-  if ENV.has_key?('LUCY_VALGRIND')
-    ccflags += "-fno-inline-functions "
-  end
-  
   # Compile as C++ under MSVC.  Turn off stupid warnings, too.
   if cc_command =~ /^cl\b/ 
     ccflags += '/TP -D_CRT_SECURE_NO_WARNINGS '

Reply via email to