diff -Naru tracef-0.16.org/configure tracef-0.16/configure --- tracef-0.16.org/configure 2007-10-13 18:47:08.000000000 +0900 +++ tracef-0.16/configure 2008-05-09 10:54:45.000000000 +0900 @@ -4947,7 +4947,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 diff -Naru tracef-0.16.org/src/main.h tracef-0.16/src/main.h --- tracef-0.16.org/src/main.h 2007-10-04 01:30:52.000000000 +0900 +++ tracef-0.16/src/main.h 2008-05-09 10:58:41.000000000 +0900 @@ -18,6 +18,7 @@ #include #include #include +#include // ILP32 and LP64 are supported. LLP64 is not. BOOST_STATIC_ASSERT(sizeof(uintptr_t) == sizeof(unsigned long)); diff -Naru tracef-0.16.org/src/opt.cpp tracef-0.16/src/opt.cpp --- tracef-0.16.org/src/opt.cpp 2007-10-13 18:21:32.000000000 +0900 +++ tracef-0.16/src/opt.cpp 2008-05-09 13:19:29.000000000 +0900 @@ -112,8 +112,10 @@ { if (pid != -1 && output_per_pid_) { // XXX: ad-hoc optimization - static TLS_ std::ostream* cache = NULL; - static TLS_ pid_t cache_pid = -1; + // static TLS_ std::ostream* cache = NULL; + static std::ostream* cache = NULL; + // static TLS_ pid_t cache_pid = -1; + static pid_t cache_pid = -1; if (cache != NULL && cache_pid == pid) { return *cache; } @@ -129,7 +131,8 @@ return *cache; } else { // XXX: ad-hoc optimization - static TLS_ std::ostream* cache = NULL; + // static TLS_ std::ostream *cache = NULL; + static std::ostream *cache = NULL; if (cache != NULL) { return *cache; } @@ -185,12 +188,17 @@ #if defined(HAVE_EXT_STDIO_FILEBUF) // GCC3 or later int fd; - if ((fd = ::open(filename.c_str(), - O_WRONLY | O_CREAT | O_TRUNC, 0600)) == -1) { - THROW_ERRNO(open); + FILE *f; + f = fopen(filename.c_str(), "rw"); + fd = fileno(f); +// if ((fd = ::open(filename.c_str(), +// O_WRONLY | O_CREAT | O_TRUNC, 0600)) == -1) { + if (fd == -1) { + THROW_ERRNO(fopen); } boost::shared_ptr - fbuf(new __gnu_cxx::stdio_filebuf(fd, std::ios_base::out)); +// fbuf(new __gnu_cxx::stdio_filebuf(fd, std::ios_base::out)); + fbuf(new __gnu_cxx::stdio_filebuf(f, std::ios_base::out)); boost::shared_ptr ost(new std::ostream(fbuf.get())); if (fd_ == -1) { diff -Naru tracef-0.16.org/src/trace.cpp tracef-0.16/src/trace.cpp --- tracef-0.16.org/src/trace.cpp 2007-10-13 18:28:38.000000000 +0900 +++ tracef-0.16/src/trace.cpp 2008-05-09 11:11:38.000000000 +0900 @@ -3,6 +3,8 @@ #include "main.h" #include +#include +#include #include "trace.h" #include diff -Naru tracef-0.16.org/src/xelf.cpp tracef-0.16/src/xelf.cpp --- tracef-0.16.org/src/xelf.cpp 2007-10-13 18:46:35.000000000 +0900 +++ tracef-0.16/src/xelf.cpp 2008-05-09 13:10:35.000000000 +0900 @@ -32,8 +32,10 @@ #endif namespace { - TLS_ char mnemonic[32]; - TLS_ int count; + // TLS_ char mnemonic[32]; + char mnemonic[32]; + // TLS_ int count; + int count; int disasm_cb(FILE*, const char* fmt, ...) { @@ -665,7 +667,7 @@ // detail long elf::filter_symbols(void* minisyms, unsigned int size, long symcount, - const std::set& exclude_syms UNUSED_) + const std::set& exclude_syms)/* UNUSED_) */ { // XXX: should use for_each