I'm not an expert in C++. This bug report's subject is "HPCToolkit compiles
with GCC 4.2 (and earlier) but won't compile with GCC 4.3" . I don't know if it
is because GCC was less fussy previously or there is a fault in GCC 4.3.

There are so many warnings and errors, and the program _might_ be of interest
to persons working with GCC source, so I will provide a little info about it:


HPCToolkit is an open-source suite of multi-platform tools for profile-based
performance analysis of applications. http://www.hipersoft.rice.edu/hpctoolkit/
It produces a navigable HTML document that combines the performance metrics
with the source code.


The toolkit components include: 

hpcrun: a tool for profiling executions of unmodified application binaries
using statistical sampling of hardware performance counters. 

hpcprof & xprof: tools for interpeting sample-based execution profiles and
relating them back to program source lines. 

bloop: a tool for analyzing application binaries to recover program structure;
namely, to identify where loops are present and what program source lines they
contain. 

hpcview: a tool for correlating program structure information, multiple
sample-based performance profiles, and program source code to produce a
performance database. 

hpcviewer: a java-based GUI for exploring databases consisting of performance
information correlated with program source. 

HPCToolkit-OneStopShopping-TRUNK-4.9.0=810.tar.gz 
http://www.hipersoft.rice.edu/hpctoolkit/downloads/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810.tar.gz


The authors complain of "slight differences in the operation of binutils
between various platforms" and have attempted to resolve those problems - that
might be interesting reading for some.



I configured and installed GCC 4.3, here is the "-v":

# /usr/test/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /root/downloads/gcc-4_3-trunk/configure --verbose
--enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --prefix=/usr/test
--enable-objc-gc --disable-multilib
--with-gxx-include-dir=/usr/test/include/c++/4.3 --enable-libstdcxx-debug
--enable-static --enable-shared --enable-initfini-array --enable-__cxa_atexit
--enable-threads=posix --enable-version-specific-runtime-libs --enable-libssp
--enable-libmudflap --enable-libgomp --disable-werror --enable-nls
--with-included-gettext --enable-decimal-float --enable-debug
--enable-java-gc=boehm --with-x --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo
--enable-qt-peer --enable-xmlj --enable-gconf-peer --enable-tool-wrappers
--enable-portable-native-sync --enable-examples --with-dwarf2 --with-stabs
--enable-hash-synchronization --enable-gc-debug --enable-interpreter
--with-system-zlib --enable-libada --with-tls --with-tune=athlon-xp
--with-cpu=athlon-xp --with-arch=athlon-xp
--enable-stage1-checking=assert,df,fold,gc,misc,rtl,rtlflag,runtime,tree
Thread model: posix
gcc version 4.3.0 20070630 (experimental)

I am not using a more recent version because there is a problem (it won't
build) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32589 .


I set my environment like this (since 4.3 is not in my path):

export CC=/usr/test/bin/gcc
export CXX=/usr/test/bin/g++
export F77=/usr/test/bin/gfortran
export JAVAC='javac -1.5'

If you wish to build the viewer you'll need to use "javac -1.5" to avoid
complaints about using annotations.


I configured HPCToolkit like this:

./configure --prefix=/usr --enable-hpcviewer --enable-develop --enable-devtools
--enable-hpc-binutils --with-monitor --with-objcopy


It turns out that my OS's bash doesn't like "=" in file names they use the name
"HPCToolkit-OneStopShopping-TRUNK-4.9.0-810" . You might want to rename it
before you configure and make this project.

When building HPCToolkit some files produced _many_ warnings and errors. I am
not an expert on C++ but I did try adding "-ansi", "-std=c++98", and
"-std=gnu++98" to the 4.3 command line - still the same errors.

I tried to compile a _few_ of these files with gcc 3.4 and 4.2 - it worked fine
on the _small_ number of files I tested. All the failing files were compiled
using GCC 4.1 and compiled without warning or error. My checking of 3.4 and 4.2
is limited.

The files attached all failed to compile with GCC 4.3 (20070630) and compiled
_perfectly_ (no warning or errors) with "gcc version 4.1.2 20061115
(prerelease) (Debian 4.1.1-21)".


Here is a couple of reduced testcases, The people who wrote this C++ and some
other people at GCC's bugzilla know more about C++ than I do, so I'll leave the
rest ...


Here is a reduced testcase for bloop_LocationMgr.cpp (no claim the testcase is
a useful program!):

#include <string>
using std::string;

static const string RELOCATED = "[reloc-from]";

inline bool
RELOCATEDcmp(const char* x)
{
  return (strncmp(x, RELOCATED.c_str(), RELOCATED.length()) == 0);
}


# gcc-3.4 -c -o test_1.o test_1.cpp 
(Prints nothing)
# gcc-4.1 -c -o test_1.o test_1.cpp 
(Prints nothing)
# gcc-4.2 -c -o test_1.o test_1.cpp 
(Prints nothing)
# gcc-4.3 -c -o test_1.o test_1.cpp 
test_1.cpp: In function 'bool RELOCATEDcmp(const char*)':
test_1.cpp:9: error: 'strncmp' was not declared in this scope


Here is a reduced testcase for PerfMetric.cpp:

#include <string>
using std::string;

#define DIAG_Assert(expr)  \
  if (!(expr)) void();

void
Ctor(const char* displayNm)
{
  DIAG_Assert(strlen(displayNm));
}


# gcc-3.4 -c -o test_2.o test_2.cpp 
(Prints nothing)
# gcc-4.1 -c -o test_2.o test_2.cpp 
(Prints nothing)
# gcc-4.2 -c -o test_2.o test_2.cpp 
(Prints nothing)
# gcc-4.3 -c -o test_2.o test_2.cpp 
test_2.cpp: In function 'void Ctor(const char*)':
test_2.cpp:10: error: 'strlen' was not declared in this scope



Here is the _abbreviated_ list of warnings and errors for the problem files:


cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/banal

bloop_LocationMgr.cpp: In function 'bool RELOCATEDcmp(const char*)':
bloop_LocationMgr.cpp:91: error: 'strncmp' was not declared in this scope


OAInterface.cpp
In file included from OAInterface.hpp:69,
                 from OAInterface.cpp:67:
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/ISA.hpp:80:
error: 'ushort' does not name a type
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/ISA.hpp:
In constructor 'DecodingCache::DecodingCache()':
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/IA64ISA.hpp:112:
error: 'ushort' was not declared in this scope
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/IA64ISA.hpp:112:
error: expected `;' before 'offset'
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/IA64ISA.hpp:113:
error: 'offset' was not declared in this scope
LM.cpp: At global scope:
LM.cpp:321: error: prototype for 'MachInsn* binutils::LM::findMachInsn(VMA,
ushort&) const' does not match any in class 'binutils::LM'
LM.hpp:205: error: candidate is: MachInsn* binutils::LM::findMachInsn(VMA,
int&) const
LM.cpp: In member function 'MachInsn* binutils::LM::findMachInsn(VMA, ushort&)
const':
LM.cpp:327: error: 'class binutils::Insn' has no member named 'GetSize'
LM.cpp: At global scope:
LM.cpp:335: error: prototype for 'binutils::Insn* binutils::LM::findInsn(VMA,
ushort) const' does not match any in class 'binutils::LM'


Seg.cpp
Seg.cpp: In constructor 'binutils::TextSeg::TextSeg(binutils::LM*,
std::string&, VMA, VMA, uint64_t, asymbol**, int, bfd*)':
Seg.cpp:191: error: 'memset' was not declared in this scope
Seg.cpp: In member function 'std::string binutils::TextSeg::FindProcName(bfd*,
asymbol*) const':
Seg.cpp:442: error: 'strlen' was not declared in this scope
make: *** [libHPCbinutils_la-Seg.lo] Error 1


Proc.cpp
In file included from Proc.hpp:63,
                 from Proc.cpp:64:
LM.hpp:205: error: 'ushort' has not been declared
LM.hpp:206: error: 'ushort' has not been declared
LM.hpp:207: error: 'ushort' has not been declared
Insn.hpp:301: error: 'ushort' does not name a type
Insn.hpp: In constructor 'binutils::VLIWInsn::VLIWInsn(MachInsn*, VMA, int)':
Insn.hpp:273: error: class 'binutils::VLIWInsn' does not have any field named
'opIndex'
Proc.cpp: In member function 'binutils::Insn* binutils::Proc::GetLastInsn()
const':
Proc.cpp:101: error: 'class binutils::Insn' has no member named 'GetNumOps'
Proc.cpp: In member function 'virtual void binutils::Proc::dump(std::ostream&,
int, const char*) const':
Proc.cpp:130: error: 'class binutils::Insn' has no member named 'GetOpIndex'
Proc.cpp:174: error: 'class binutils::Insn' has no member named 'GetOpIndex'


Insn.cpp
In file included from Insn.hpp:62,
                 from Insn.cpp:64:
LM.hpp:205: error: 'ushort' has not been declared
LM.hpp:206: error: 'ushort' has not been declared
Insn.hpp: In member function 'ISA::InsnDesc binutils::Insn::GetDesc() const':
Insn.hpp:91: error: 'GetOpIndex' was not declared in this scope
Insn.hpp:91: error: 'GetSize' was not declared in this scope
Insn.hpp: In member function 'VMA binutils::Insn::GetEndVMA() const':
Insn.hpp:301: error: 'ushort' does not name a type
Insn.hpp: In constructor 'binutils::VLIWInsn::VLIWInsn(MachInsn*, VMA, int)':
Insn.hpp:273: error: class 'binutils::VLIWInsn' does not have any field named
'opIndex'
Insn.cpp: In member function 'virtual void binutils::Insn::dump(std::ostream&,
int, const char*) const':
Insn.cpp:82: error: 'GetOpIndex' was not declared in this scope
Insn.cpp: In member function 'virtual void
binutils::CISCInsn::dumpme(std::ostream&, const char*) const':
Insn.cpp:131: error: 'GetSize' was not declared in this scope
Insn.cpp: In member function 'virtual void
binutils::VLIWInsn::dumpme(std::ostream&, const char*) const':
Insn.cpp:167: error: 'GetOpIndex' was not declared in this scope
make: *** [libHPCbinutils_la-Insn.lo] Error 1


VMAInterval.cpp
VMAInterval.cpp: In member function 'void VMAIntervalSet::fromString(const
char*)':
VMAInterval.cpp:426: error: 'strchr' was not declared in this scope
make: *** [libHPCbinutils_la-VMAInterval.lo] Error 1


cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/binutils

LM.cpp
In file included from LM.cpp:70:
LM.hpp:205: error: 'ushort' has not been declared
LM.hpp:206: error: 'ushort' has not been declared


cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/isa

AlphaISA.cpp
In file included from AlphaISA.hpp:61,
                 from AlphaISA.cpp:58:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
ISA.hpp:326: error: 'ushort' does not name a type
AlphaISA.cpp:760: error: 'ushort' has not been declared
AlphaISA.cpp: In member function 'virtual VMA
AlphaISA::GetInsnTargetVMA(MachInsn*, VMA, int, int)':
AlphaISA.cpp:790: error: 'MINSN_SIZE' was not declared in this scope


IA64ISA.cpp
In file included from IA64ISA.hpp:62,
                 from IA64ISA.cpp:64:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
IA64ISA.hpp:109: error: 'ushort' has not been declared
IA64ISA.hpp: In member function 'virtual VMA IA64ISA::ConvertOpVMAToVMA(VMA,
int&) const':
IA64ISA.hpp:112: error: 'ushort' was not declared in this scope
IA64ISA.hpp:112: error: expected `;' before 'offset'
IA64ISA.hpp:113: error: 'offset' was not declared in this scope
IA64ISA.cpp: At global scope:
IA64ISA.cpp:123: error: prototype for 'ISA::InsnDesc
IA64ISA::GetInsnDesc(MachInsn*, ushort, ushort)' does not match any in class
'IA64ISA'
IA64ISA.hpp:86: error: candidate is: virtual ISA::InsnDesc
IA64ISA::GetInsnDesc(MachInsn*, int, int)
IA64ISA.cpp:178: error: prototype for 'VMA IA64ISA::GetInsnTargetVMA(MachInsn*,
VMA, ushort, ushort)' does not match any in class 'IA64ISA'
IA64ISA.hpp:89: error: candidate is: virtual VMA
IA64ISA::GetInsnTargetVMA(MachInsn*, VMA, int, int)
IA64ISA.cpp:198: error: no 'ushort IA64ISA::GetInsnNumOps(MachInsn*)' member
function declared in class 'IA64ISA'
make: *** [libHPCisa_la-IA64ISA.lo] Error 1


ISA.cpp
In file included from ISA.cpp:55:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
ISA.hpp:391: error: 'ushort' has not been declared
ISA.hpp: In member function 'void ISA::CacheSet(MachInsn*, int)':
ISA.hpp:392: error: 'class DecodingCache' has no member named 'insnSize'
make: *** [libHPCisa_la-ISA.lo] Error 1


MipsISA.cpp
In file included from MipsISA.hpp:60,
                 from MipsISA.cpp:57:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
MipsISA.cpp:225: error: 'ushort' has not been declared
MipsISA.cpp: In member function 'virtual VMA
MipsISA::GetInsnTargetVMA(MachInsn*, VMA, int, int)':
MipsISA.cpp:256: error: 'MINSN_SIZE' was not declared in this scope
MipsISA.cpp: At global scope:
MipsISA.cpp:288: error: 'ushort' does not name a type
make: *** [libHPCisa_la-MipsISA.lo] Error 1


SparcISA.cpp
In file included from SparcISA.hpp:61,
                 from SparcISA.cpp:65:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
ISA.hpp:330: error: 'ushort' has not been declared
SparcISA.cpp:118: error: 'ushort' has not been declared
SparcISA.cpp: In member function 'virtual ISA::InsnDesc
SparcISA::GetInsnDesc(MachInsn*, int, int)':
SparcISA.cpp:123: error: 'ushort' was not declared in this scope
SparcISA.cpp:123: error: expected `;' before 'size'
SparcISA.cpp:124: error: 'size' was not declared in this scope


x86ISA.cpp
In file included from x86ISA.hpp:60,
                 from x86ISA.cpp:64:
ISA.hpp:80: error: 'ushort' does not name a type
ISA.hpp: In constructor 'DecodingCache::DecodingCache()':
ISA.hpp:70: error: 'insnSize' was not declared in this scope
ISA.hpp: At global scope:
ISA.hpp:320: error: 'ushort' does not name a type
x86ISA.cpp:191: error: 'ushort' has not been declared
x86ISA.cpp: In member function 'virtual VMA x86ISA::GetInsnTargetVMA(MachInsn*,
VMA, int, int)':
x86ISA.cpp:196: error: 'ushort' was not declared in this scope
x86ISA.cpp:196: error: expected `;' before 'size'
x86ISA.cpp:197: error: 'size' was not declared in this scope
make: *** [libHPCisa_la-x86ISA.lo] Error 1


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/prof-juicy
PerfMetric.cpp
PerfMetric.cpp: In member function 'void PerfMetric::Ctor(const char*, const
char*)':
PerfMetric.cpp:91: error: 'strlen' was not declared in this scope


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/prof-juicy

PgmScopeTreeInterface.cpp
PgmScopeTreeInterface.cpp: In member function 'FileScope*
NodeRetriever::MoveToFile(const char*)':
PgmScopeTreeInterface.cpp:154: error: 'strcmp' was not declared in this scope
make: *** [libHPCprof_juicy_la-PgmScopeTreeInterface.lo] Error 1


FlatProfileReader.cpp
FlatProfileReader.cpp: In member function 'int ProfFile::read(const
std::string&)':
FlatProfileReader.cpp:99: error: 'strncmp' was not declared in this scope
FlatProfileReader.cpp:102: error: 'strncmp' was not declared in this scope


cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/support

StrUtil.cpp
StrUtil.cpp: In function 'long int StrUtil::toLong(const char*, unsigned
int*)':
StrUtil.cpp: In function 'uint64_t StrUtil::toUInt64(const char*, unsigned
int*)':
StrUtil.cpp: In function 'double StrUtil::toDbl(const char*, unsigned int*)':
StrUtil.cpp:128: error: 'strlen' was not declared in this scope
StrUtil.cpp:133: error: 'strerror' was not declared in this scope


Files.cpp
Files.cpp: In function 'const char* CopyFile(const char*, ...)':
Files.cpp:99: error: 'strerror' was not declared in this scope
Files.cpp:108: error: 'strerror' was not declared in this scope
Files.cpp: In function 'const char* TmpFileName()':
Files.cpp:176: error: 'strcpy' was not declared in this scope
Files.cpp: In function 'std::string BaseFileName(const char*)':
Files.cpp: In function 'std::string PathComponent(const char*)':
Files.cpp:228: error: 'strrchr' was not declared in this scope


SrcFile.cpp
SrcFile.cpp: In constructor 'SrcFile::SrcFile::SrcFile(const char*)':
SrcFile.cpp:72: error: 'strlen' was not declared in this scope
SrcFile.cpp: In member function 'bool SrcFile::SrcFile::GetLine(unsigned int,
char*, unsigned int) const':
SrcFile.cpp:91: error: 'strncpy' was not declared in this scope


cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/lib/xml

xml.cpp
xml.cpp: In function 'std::string xml::Substitute(const char*, const
std::string*, const std::string*)':
xml.cpp:151: error: 'strlen' was not declared in this scope
xml.cpp:159: error: 'strncmp' was not declared in this scope


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/hpctoolkit/hpcprof

hpcprof.cpp
hpcprof.cpp: In function 'int dump_PROFILE(Summary&)':
hpcprof.cpp:280: warning: deprecated conversion from string constant to 'char*'
hpcprof.cpp: In function 'int dump_html_or_text(Summary&)':
hpcprof.cpp:429: error: 'strerror' was not declared in this scope


loadmodule.cpp
loadmodule.cpp: In member function 'void BFDLoadModule::read_file(const
std::string&, bool)':
loadmodule.cpp:224: error: 'qsort' was not declared in this scope
loadmodule.cpp: In member function 'virtual std::string
BFDLoadModule::demangle(const std::string&) const':
loadmodule.cpp:382: error: 'free' was not declared in this scope


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/hpctoolkit/hpcview

Args.cpp
Args.cpp: In member function 'void Args::setHPCHome()':
Args.cpp:399: error: 'strlen' was not declared in this scope


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/hpctoolkit/xcsprof

CSProfTreeIterator.cpp
CSProfTreeIterator.cpp:320: error: 'strcmp' was not declared in this scope


cd
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0\=810/HPCToolkit/src/hpctoolkit/xprof

main.cpp
main.cpp:389: error: 'strcmp' was not declared in this scope
main.cpp: In function 'StringList* ConvertColonListToStringList(const char*)':
main.cpp:427: error: 'strtok' was not declared in this scope


DCPIMetricDesc.cpp
DCPIMetricDesc.cpp:198: error: 'strcmp' was not declared in this scope
DCPIMetricDesc.cpp: In function 'DCPIMetricDesc String2DCPIMetricDesc(const
char*)':
DCPIMetricDesc.cpp:237: error: 'strlen' was not declared in this scope
DCPIMetricDesc.cpp:244: error: 'strchr' was not declared in this scope
DCPIMetricDesc.cpp:269: error: 'strtok' was not declared in this scope
DCPIMetricDesc.cpp: In function 'int SetDCPIMetricDescBit(const char*,
DCPIMetricDesc&)':
DCPIMetricDesc.cpp:289: error: 'strlen' was not declared in this scope


DCPIProfile.cpp
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/ISA.hpp:80:
error: 'ushort' does not name a type
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/ISA.hpp:
In constructor 'DecodingCache::DecodingCache()':
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/HPCToolkit/src/lib/isa/ISA.hpp:70:
error: 'insnSize' was not declared in this scope
PCProfileMetric.hpp:78: error: 'ulong' does not name a type
PCProfileMetric.hpp:103: error: 'PCProfileDatum' was not declared in this scope
PCProfileMetric.hpp:103: error: template argument 2 is invalid
PCProfileMetric.hpp:103: error: template argument 4 is invalid
PCProfileMetric.hpp:104: error: typedef name may not be a nested-name-specifier
PCProfileMetric.hpp:104: error: expected ';' before 'PCToPCProfileDatumMapVal'
PCProfile.hpp:247: error: 'ushort' has not been declared
PCProfile.hpp:326: error: ISO C++ forbids declaration of 'PCProfileDatum' with
no type


DCPIProfileFilter.cpp - similar errors to DCPIProfile.cpp

DCPIProfileMetric.cpp - similar errors to DCPIProfile.cpp

DerivedProfile.cpp - similar errors to DCPIProfile.cpp

PCProfile.cpp - similar errors to DCPIProfile.cpp

PCProfileFilter.cpp - similar errors to DCPIProfile.cpp

PCProfileMetric.cpp - similar errors to DCPIProfile.cpp


ProfileReader.cpp
ProfileReader.cpp:92: error: 'strcmp' was not declared in this scope
ProfileReader.cpp: In function 'DCPIProfile::PMMode DeterminePMMode(const
char*)':
ProfileReader.cpp:413: error: 'strncmp' was not declared in this scope


ProfileWriter.cpp - similar errors to DCPIProfile.cpp



Along with the string functions not being in scope most of the errors are
these:

error: 'ushort' does not name a type
error: 'ushort' was not declared in this scope
error: 'offset' was not declared in this scope
error: 'memset' was not declared in this scope
error: 'ushort' has not been declared
prototype for 'ISA::InsnDesc IA64ISA::GetInsnDesc(MachInsn*, ushort, ushort)'
does not match any in class 'IA64ISA'



Remember, each of those lists of warnings and errors was edited down. If
unedited, each failing file produced many pages of info in some cases. Where
the file produced only a couple of lines I showed all the messages.



That was all the files I found that caused errors and needed to be compiled
with GCC 4.1 instead of GCC 4.3 .  After I was finished I tarred and bzip2'd
the ".ii" files, here is how big it would be (too big):
-rw-r--r-- 1 root  root 2555291 Jul  8 13:44 HPCToolkit-4_3-errors.tar.bz2


So I am not including _all_ the .ii files - you'll need to get the source.

Here is the included list. This list seems to cover all the duplicated errors:
-rw-r--r-- 1 root root 852739 Jul  8 18:20 bloop_LocationMgr.ii
-rw-r--r-- 1 root root 817349 Jul  8 18:20 OAInterface.ii
-rw-r--r-- 1 root root 852603 Jul  8 18:21 Seg.ii
-rw-r--r-- 1 root root 589250 Jul  8 18:21 IA64ISA.ii
-rw-r--r-- 1 root root 588396 Jul  8 18:22 loadmodule.ii

Those few files, tarred and bzip2'd are only 400k.
-rw-r--r-- 1 root  root  399690 Jul  8 18:24 HPCToolkit-4_3-errors.tar.bz2


I ended up compiling over 10% of the files with GCC 4.1 and the rest with 4.3.
Everything linked up fine and it seems to run except for the Java "hpcviewer" .


Short version: Works on GCC < 4.3 ,  fails on GCC == 4.3 .

---------------------------------------
There is at least one Java error:


1. ERROR in
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java
(at line 40)
        @SuppressWarnings("serial")
         ^^^^^^^^^^^^^^^^
SuppressWarnings cannot be resolved to a type


Commenting out this annotation causes a number of warnings to be printed and
then another file with this annotation causes the same problem.

Commenting out that line causes more warnings and leads to yet another file.
Eventually I get to a file that compiled fine without errors previously, but
now has errors:

8. ERROR in
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/hpcviewer/src/edu/rice/cs/hpcviewer/experiment/xml/ExperimentBuilder.java
(at line 576)
        this.experiment.setMetrics(this.metricList);
                        ^^^^^^^^^^
The method setMetrics(List) is undefined for the type Experiment


Since I am not knowledgable enough to fix this I downloaded the .jar file that
the site provides on page:
http://www.hipersoft.rice.edu/hpctoolkit/examples.html

http://www.hipersoft.rice.edu/hpctoolkit/examples/HPCViewer.jar.gz


If I start Iceweasel and click on the jar file I get this message:
Exception in thread "main" java.lang.NoClassDefFoundError:
/opt/HPCToolkit-OneStopShopping-TRUNK-4/9/0=810/hpcviewer/build-unix/HPCViewer/jar


The .jar file works fine with WinXP Internet Explorer and sun Java but doesn't
work with GCC's gij.


With GCC 4.2 gij I get this message:

# gij -jar HPCViewer.jar

(.:5821): Gtk-WARNING **: Unable to locate theme engine in module_path:
"qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path:
"qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:71)

(.:5821): Gtk-WARNING **: Unable to locate theme engine in module_path:
"qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path:
"qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:71)
/root/downloads/gcc-4_2-branch/libjava/classpath/native/jni/gtk-peer/gthread-jni.c:1223:
AWT JNI failure (BROKEN): cannot enter monitor

Description follows to System.err:
java.lang.NullPointerException
   at java.lang.Object.getClass(natObject.cc:55)
/root/downloads/gcc-4_2-branch/libjava/classpath/native/jni/gtk-peer/gthread-jni.c:1223:
Aborting execution; BROKEN: cannot enter monitor

Aborting execution
Aborted



With GCC 4.3 gij I get this message:


Exception in thread "main" java.lang.NoClassDefFoundError:
/opt/HPCToolkit-OneStopShopping-TRUNK-4/9/0=810/hpcviewer/build-unix/HPCViewer/jar

cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/hpcviewer/src
/usr/test/bin/gij -jar HPCViewer.jar

Starts (creates the 'open file' dialog window), but gives error message:

(.:5841): Gtk-WARNING **: Unable to locate theme engine in module_path:
"qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path:
"qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:92)

(.:5841): Gtk-WARNING **: Unable to locate theme engine in module_path:
"qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path:
"qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:92)
failure while exiting GTK monitor
Exception during event dispatch:
java.lang.IllegalMonitorStateException: current thread not owner
   <<No stacktrace available>>

I do configure GCC to build Java with "--with-x --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo
--enable-qt-peer --enable-xmlj --enable-gconf-peer" and it passes many mauve
tests (and ALL the GCC testsuite). There is something about the way GCC builds
gij that does not let it run .jar files that work perfectly on the WinXP
platform with Internet Explorer.

In Internet Explorer, if I click [Tools][Sun Java Console], it says I have this
version:
Java Plug-in 1.6.0_01
Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM

----------

Since it is usually the practice to include ".i" files I am including the ".ii"
files. These files reproduce the warnings and errors _IF_ they are compiled in
the directory in which they were "-save-temps"'d in. They do not build in a
seperate directory - perhaps it is only ".i" files that are "all-inclusive".

Building in the directory where they were created gives this sort of ouput:

# /usr/test/bin/gcc -c -o test.o bloop_LocationMgr-4.3.ii 
bloop_LocationMgr.cpp: In function 'bool RELOCATEDcmp(const char*)':
bloop_LocationMgr.cpp:91: error: 'strncmp' was not declared in this scope


Building in a different directory gives this sort of output:

# gcc -c -o test.o bloop_LocationMgr.ii 
In file included from /usr/test/include/c++/4.3/bits/char_traits.h:47,
                 from /usr/test/include/c++/4.3/string:48,
                 from bloop_LocationMgr.cpp:56:
/usr/test/include/c++/4.3/bits/stl_algobase.h: In function '_OI
std::__copy_aux(_II, _II, _OI)':
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: expected
primary-expression before ')' token
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: there are no
arguments to '__is_pod' that depend on a template parameter, so a declaration
of '__is_pod' must be available
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: (if you use
'-fpermissive', G++ will accept your code, but allowing the use of an
undeclared name is deprecated)
/usr/test/include/c++/4.3/bits/stl_algobase.h:368: error: '__simple' cannot
appear in a constant-expression
/usr/test/include/c++/4.3/bits/stl_algobase.h:368: error: template argument 1
is invalid
... many pages of errors ...


If I build in a different directory using GCC 4.1 I get no errors related to
the file itself but instead only to GCC's gthr-default.h :

# gcc-4.1 -o test.o bloop_LocationMgr.ii 
/usr/test/include/c++/4.3/i686-pc-linux-gnu/bits/c++config.h:159: error:
expected `=' before '__attribute__'
/usr/test/include/c++/4.3/i686-pc-linux-gnu/bits/c++config.h:159: error:
expected identifier before '__attribute__'
/usr/test/include/c++/4.3/i686-pc-linux-gnu/bits/c++config.h:159: error:
expected `;' before '__attribute__'
/usr/test/include/c++/4.3/i686-pc-linux-gnu/bits/c++config.h:159: error:
expected unqualified-id before '{' token


If I build in a different directory using GCC 4.2 I get no errors related to
the file itself but instead GCC 4.2 want to use GCC 4.3 's  include files when
it compiles an ".ii" file:

# gcc-4.2 -o test.o bloop_LocationMgr.ii 
In file included from /usr/test/include/c++/4.3/bits/char_traits.h:47,
                 from /usr/test/include/c++/4.3/string:48,
                 from bloop_LocationMgr.cpp:56:
/usr/test/include/c++/4.3/bits/stl_algobase.h: In function '_OI
std::__copy_aux(_II, _II, _OI)':
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: expected
primary-expression before ')' token
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: there are no
arguments to '__is_pod' that depend on a template parameter, so a declaration
of '__is_pod' must be available
/usr/test/include/c++/4.3/bits/stl_algobase.h:363: error: (if you use
'-fpermissive', G++ will accept your code, but allowing the use of an
undeclared name is deprecated)
/usr/test/include/c++/4.3/bits/stl_algobase.h:368: error: '__simple' cannot
appear in a constant-expression
/usr/test/include/c++/4.3/bits/stl_algobase.h:368: error: template argument 1
is invalid


So I don't know how I am to include ".ii" files that are of any help.
There are so many errors exposed and so many files that are in error it
may be best to simply get the origonal source and build it. If you need me to
.tar.gz a whole directory and send that please ask. I'm trying to keep this
small. :( .


-- 
           Summary: Compiling HPCToolkit causes many errors and warnings
                    using GCC 4.3 (but not prior versions)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32683

Reply via email to