On Thu, Jun 02, 2005 at 6:16PM +0100, John Levon wrote:
> > Is g++ 2.95.4 still supported by oprofile?
> In theory yes, but I've not personally got it for testing. I probably
> should have...
The patch below gets 0.9 compiling on debian woody. I don't claim that
#define _GNU_SOURCE is necessarily the right thing to do; but it works.
It causes INFINITY to be defined with older glibc.
The patched source still compiles on debian sarge with g++ 3.3.5, though
I didn't attempt to compile any of the QT parts in either case.
Jason
diff -urp oprofile-0.9/libpp/diff_container.cpp oprofile-0.9.oldgcc/libpp/diff_container.cpp
--- oprofile-0.9/libpp/diff_container.cpp Fri May 27 14:06:30 2005
+++ oprofile-0.9.oldgcc/libpp/diff_container.cpp Thu Jun 2 15:17:51 2005
@@ -9,6 +9,7 @@
* @author John Levon
*/
+#define _GNU_SOURCE
#include "diff_container.h"
#include <cmath>
diff -urp oprofile-0.9/libpp/format_output.cpp oprofile-0.9.oldgcc/libpp/format_output.cpp
--- oprofile-0.9/libpp/format_output.cpp Mon Apr 11 23:09:35 2005
+++ oprofile-0.9.oldgcc/libpp/format_output.cpp Thu Jun 2 15:18:00 2005
@@ -9,6 +9,7 @@
* @author John Levon
*/
+#define _GNU_SOURCE
#include <sstream>
#include <iomanip>
#include <iostream>
diff -urp oprofile-0.9/libutil++/bfd_support.cpp oprofile-0.9.oldgcc/libutil++/bfd_support.cpp
--- oprofile-0.9/libutil++/bfd_support.cpp Thu May 5 10:43:46 2005
+++ oprofile-0.9.oldgcc/libutil++/bfd_support.cpp Thu Jun 2 14:35:11 2005
@@ -18,6 +18,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
+#include <string>
using namespace std;
@@ -548,7 +549,8 @@ find_nearest_line(bfd_info const & b, op
fail:
info.found = false;
- info.filename.clear();
+ // some stl lacks string::clear()
+ info.filename.erase(info.filename.begin(), info.filename.end());
info.line = 0;
return info;
}
diff -urp oprofile-0.9/libutil++/op_bfd.cpp oprofile-0.9.oldgcc/libutil++/op_bfd.cpp
--- oprofile-0.9/libutil++/op_bfd.cpp Thu May 5 10:43:46 2005
+++ oprofile-0.9.oldgcc/libutil++/op_bfd.cpp Thu Jun 2 14:26:31 2005
@@ -14,9 +14,11 @@
#include "config.h"
#include <fcntl.h>
+#include <sys/stat.h>
#include <cstdlib>
+#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
|