This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Provide macro NO_WERROR to disable -Werror for backend compiling.
- From: "Yichun Zhang (agentzh)" <agentzh at gmail dot com>
- To: systemtap at sourceware dot org
- Cc: "Yichun Zhang (agentzh)" <agentzh at gmail dot com>
- Date: Sat, 4 Aug 2018 01:40:25 -0700
- Subject: [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