This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Provide macro NO_WERROR to disable -Werror for backend compiling.


Currently we always turn on -Werror when compiling the kernel module and
the dyninst DSO. This causes compile-time errors when the user input stap
scripts contain inefficiencies like `a == a` or `a != a`, which can be
common for automatically generated stap code from naive tools.

Now we can build systemtap with `./configure CXXFLAGS='-DNO_WERROR'` to
disable the -Werror option for the kernel and dyninst backends (the bpf
backend is not applicable here).
---
 buildrun.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/buildrun.cxx b/buildrun.cxx
index 59b9e88ca..41ea3d021 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -34,7 +34,11 @@ extern "C" {
 // A bit of obfuscation for Gentoo's sake.
 // We *need* -Werror for stapconf to work correctly.
 // https://bugs.gentoo.org/show_bug.cgi?id=522908
+#ifndef NO_WERROR
 #define WERROR ("-W" "error")
+#else
+#define WERROR ("-W" "no-error")
+#endif
 
 #define PATH_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+,-./_"
 
-- 
2.11.0.295.gd7dffce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]