This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[patch] compile failed when runtime set to relative path
- From: "Zhaolei" <zhaolei at cn dot fujitsu dot com>
- To: <systemtap at sources dot redhat dot com>
- Date: Thu, 29 May 2008 09:37:08 +0800
- Subject: [patch] compile failed when runtime set to relative path
- References: <1212011823.32135.6.camel@multics.rdu.redhat.com>
Hi, everyone
When relative path is set as runtime directory, stap kernel module can not compile.
The problem is like:
# pwd
/root
# stap -v -R ./runtime t.stp
Pass 1: parsed user script and 56 library script(s) in 350usr/10sys/614real ms.
Pass 2: analyzed script: 2 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 300usr/300s
ys/4694real ms.
Pass 3: translated to C into "/tmp/staprYPcfP/stap_51ab93995aca8966db397d992f4aa27d_366.c"
in 0usr/0sys/12real ms.
Pass 4: compiled C into "stap_51ab93995aca8966db397d992f4aa27d_366.ko" in 320usr/120sys/86
8real ms.
Pass 4: compilation failed. Try again with more '-v' (verbose) options.
The reason is that stap writes path of runtime(may be relative path) into Makefile directly.
This problem can be fixed by using absolute path of runtime lib.
If no objection, I will commit the following patch:
Signed-off-by: "Zhaolei" zhaolei@cn.fujitsu.com
diff -Nur systemtap_org/main.cxx systemtap_new/main.cxx
--- systemtap_org/main.cxx 2008-05-27 04:52:29.000000000 +0800
+++ systemtap_new/main.cxx 2008-05-29 08:56:32.000000000 +0800
@@ -662,6 +662,12 @@
usage(s, 1);
}
+ // translate path of runtime to absolute path
+ if (s.runtime_path[0] != '/')
+ {
+ s.runtime_path = string (getenv ("PWD")) + "/" + s.runtime_path;
+ }
+
int rc = 0;
// override PATH and LC_ALL
Regards
Zhaolei