Using GCC 3.3.1 on QNX NC 6.3.0

Hello, Evan!

EH> #ifndef HAVE_STD_TRANSFORM
EH> #include
EH> #include
EH> Umm, maybe a missing c++ include path me thinks …

So why you have excluded them then ???

With best regards, Mike Gorchak. E-mail: mike@malva.com.ua

Try adding -v to your command line?

Mike Gorchak wrote:

Hello, Evan!

EH> #ifndef HAVE_STD_TRANSFORM
EH> #include #include Umm, maybe a missing c++ include path me thinks …

So why you have excluded them then ???

With best regards, Mike Gorchak. E-mail: > mike@malva.com.ua


cburgess@qnx.com

Mike Gorchak wrote:

Hello, Evan!

EH> #ifndef HAVE_STD_TRANSFORM
EH> #include #include Umm, maybe a missing c++ include path me thinks …

So why you have excluded them then ???

cos they didn’t help. I’ve put them back in but still got the exact same result.


Evan

Colin Burgess wrote:

Try adding -v to your command line?

make -v

GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.


I figured that wasn’t what you wanted so if added it to the CC/CXX commands:

CPPFLAGS="-I/usr/include" CFLAGS="-I/usr/include" CXXFLAGS="-I/usr/include" LDFLAGS="-I/usr/lib" CC=“ntox86-gcc-3.3.1 -v” CXX=“ntox86-g+±3.3.1 -v” ./configure $1


make[2]: Entering directory /root/progs/boinc_public/api' if ntox86-g++-3.3.1 -v -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -include ../config.h -I/usr/include -D __NO_CTYPE -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -include ../config.h -I/usr/include -MT boinc_api.o -MD -MP -MF ".deps/boinc_ap i.Tpo" -c -o boinc_api.o boinc_api.C; \ then mv -f ".deps/boinc_api.Tpo" ".deps/boinc_api.Po"; else rm -f ".deps/boinc_api.Tpo"; exit 1; fi Reading specs from /usr/qnx630/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/specs Configured with: ../configure --srcdir=.. --enable-cheaders=c --with-gnu-as --with-gnu-ld --with-qnxsysroot=/ --target=i386-pc-nto-qnx6.3.0 --srcdir=/home/toolsbuild/cvs/too ls/gcc/nto-x86-o-ntox86/.. --prefix=/usr --exec-prefix=/usr --with-local-prefix=/usr --enable-haifa --enable-languages=c++ --enable-threads=posix --disable-nls --enable-shar ed --enable-multilib Thread model: posix gcc version 3.3.1 (qnx-nto) /usr/qnx630/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/cc1plus -quiet -v -I. -I. -I.. -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I. ../sched -I/usr/include -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -I/usr/include -MD boinc_api.d -MF .deps/boinc_api.Tpo -MP -MT boinc_a pi.o -MQ boinc_api.o -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__X86__ -Di386 -D__QNXNTO__ -D__QNX__ -D__LITTLEENDIAN__ -D__ELF__ -D__X86__ -D__i386__ -D__QN XNTO__ -D__QNX__ -D__LITTLEENDIAN__ -D__ELF__ -D__i386 -Asystem=unix -Asystem=nto -Asystem=qnxnto -Asystem=qnx -nostdinc -nostdinc++ -idirafter QNX_TARGET_TAG/usr/include -i system QNX_TARGET_TAG/usr/include/c++/3.3.1 -isystem QNX_TARGET_TAG/usr/include/c++/3.3.1/i386-pc-nto-qnx6.3.0 -isystem QNX_TARGET_TAG/usr/include/c++/3.3.1/backward -isyste m QNX_TARGET_TAG/usr/include -isystem QNX_HOST_TAG/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/include -DHAVE_CONFIG_H -D__NO_CTYPE -include ../config.h -include ../config.h boinc_api.C -D__GNUG__=3 -quiet -dumpbase boinc_api.C -auxbase-strip boinc_api.o -version -o /tmp/ccYmdRAY.s ignoring nonexistent directory "QNX_TARGET_TAG/usr/include" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1/i386-pc-nto-qnx6.3.0" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1/backward" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include" ignoring nonexistent directory "QNX_HOST_TAG/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/include" GNU C++ version 3.3.1 (qnx-nto) (i386-pc-nto-qnx6.3.0) compiled by GNU C version 2.95.3qnx-nto 20010315 (release). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring duplicate directory "." ignoring duplicate directory "../api" ignoring duplicate directory "../lib" ignoring duplicate directory "../api" ignoring duplicate directory "../db" ignoring duplicate directory "../RSAEuro/source" ignoring duplicate directory "../client" ignoring duplicate directory "../tools" ignoring duplicate directory "../sched" ignoring duplicate directory "/usr/include" #include "..." search starts here: #include <...> search starts here: . .. ../lib ../db ../RSAEuro/source ../client ../tools ../sched /usr/include End of search list. In file included from ../config.h:370, from <command line>:24: .../lib/std_fixes.h:56:21: algorithm: No such file or directory .../lib/std_fixes.h:57:20: iterator: No such file or directory In file included from ../config.h:370, from <command line>:24: .../lib/std_fixes.h:96: error: std::FILE* fopen(const char*, const char*)’
conflicts with previous using declaration `std::FILE* std::fopen(const
char*, const char*)’

… on and on and on and on …


Evan

Ok I think we have a gcc bug. I’ve reported it to the tools guys…

You see all host QNX_HOST_TAG and QNX_TARGET_TAG lines - they should be
replaced with $QNX_HOST and $QNX_TARGET.

Looking at the specs file on my system they appear to be alright, so you
might have to manually add them to your cc flags.

Just reproduce the -isystem etc etc stuff you see in that cpp0 line…

Colin

Evan Hillas wrote:

Colin Burgess wrote:

Try adding -v to your command line?

\

make -v

GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.


I figured that wasn’t what you wanted so if added it to the CC/CXX
commands:

CPPFLAGS="-I/usr/include" CFLAGS="-I/usr/include"
CXXFLAGS="-I/usr/include" LDFLAGS="-I/usr/lib" CC=“ntox86-gcc-3.3.1 -v”
CXX=“ntox86-g+±3.3.1 -v” ./configure $1


make[2]: Entering directory /root/progs/boinc_public/api' if ntox86-g++-3.3.1 -v -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -include ../config.h -I/usr/include -D __NO_CTYPE -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -include ../config.h -I/usr/include -MT boinc_api.o -MD -MP -MF ".deps/boinc_ap i.Tpo" -c -o boinc_api.o boinc_api.C; \ then mv -f ".deps/boinc_api.Tpo" ".deps/boinc_api.Po"; else rm -f ".deps/boinc_api.Tpo"; exit 1; fi Reading specs from /usr/qnx630/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/specs Configured with: ../configure --srcdir=.. --enable-cheaders=c --with-gnu-as --with-gnu-ld --with-qnxsysroot=/ --target=i386-pc-nto-qnx6.3.0 --srcdir=/home/toolsbuild/cvs/too ls/gcc/nto-x86-o-ntox86/.. --prefix=/usr --exec-prefix=/usr --with-local-prefix=/usr --enable-haifa --enable-languages=c++ --enable-threads=posix --disable-nls --enable-shar ed --enable-multilib Thread model: posix gcc version 3.3.1 (qnx-nto) /usr/qnx630/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/cc1plus -quiet -v -I. -I. -I.. -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I. ./sched -I/usr/include -I../lib -I../api -I../db -I../RSAEuro/source -I../client -I../tools -I../sched -I/usr/include -MD boinc_api.d -MF .deps/boinc_api.Tpo -MP -MT boinc_a pi.o -MQ boinc_api.o -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__X86__ -Di386 -D__QNXNTO__ -D__QNX__ -D__LITTLEENDIAN__ -D__ELF__ -D__X86__ -D__i386__ -D__QN XNTO__ -D__QNX__ -D__LITTLEENDIAN__ -D__ELF__ -D__i386 -Asystem=unix -Asystem=nto -Asystem=qnxnto -Asystem=qnx -nostdinc -nostdinc++ -idirafter QNX_TARGET_TAG/usr/include -i system QNX_TARGET_TAG/usr/include/c++/3.3.1 -isystem QNX_TARGET_TAG/usr/include/c++/3.3.1/i386-pc-nto-qnx6.3.0 -isystem QNX_TARGET_TAG/usr/include/c++/3.3.1/backward -isyste m QNX_TARGET_TAG/usr/include -isystem QNX_HOST_TAG/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/include -DHAVE_CONFIG_H -D__NO_CTYPE -include ../config.h -include ../config.h boinc_api.C -D__GNUG__=3 -quiet -dumpbase boinc_api.C -auxbase-strip boinc_api.o -version -o /tmp/ccYmdRAY.s ignoring nonexistent directory "QNX_TARGET_TAG/usr/include" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1/i386-pc-nto-qnx6.3.0" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include/c++/3.3.1/backward" ignoring nonexistent directory "QNX_TARGET_TAG/usr/include" ignoring nonexistent directory "QNX_HOST_TAG/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/include" GNU C++ version 3.3.1 (qnx-nto) (i386-pc-nto-qnx6.3.0) compiled by GNU C version 2.95.3qnx-nto 20010315 (release). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring duplicate directory "." ignoring duplicate directory "../api" ignoring duplicate directory "../lib" ignoring duplicate directory "../api" ignoring duplicate directory "../db" ignoring duplicate directory "../RSAEuro/source" ignoring duplicate directory "../client" ignoring duplicate directory "../tools" ignoring duplicate directory "../sched" ignoring duplicate directory "/usr/include" #include "..." search starts here: #include <...> search starts here: . .. ../lib ../db ../RSAEuro/source ../client ../tools ../sched /usr/include End of search list. In file included from ../config.h:370, from <command line>:24: ../lib/std_fixes.h:56:21: algorithm: No such file or directory ../lib/std_fixes.h:57:20: iterator: No such file or directory In file included from ../config.h:370, from <command line>:24: ../lib/std_fixes.h:96: error: std::FILE* fopen(const char*, const char*)’
conflicts with previous using declaration `std::FILE* std::fopen(const
char*, const char*)’

… on and on and on and on …


Evan


cburgess@qnx.com

Colin Burgess wrote:

Ok I think we have a gcc bug. I’ve reported it to the tools guys…

Excellent. Thanks for the attention.

Thanks, also, to Mike Gorchak for the help with env variables.


You see all host QNX_HOST_TAG and QNX_TARGET_TAG lines - they should be
replaced with $QNX_HOST and $QNX_TARGET.

Looking at the specs file on my system they appear to be alright, so you
might have to manually add them to your cc flags.

Umm, cc flags? Changing CFLAGS and co don’t work. I presume I’m to dig in the resultant Makefile or someplace like that?


Evan

Try adding something like

ntox86-gcc-3.3.5 -c foo.cpp -v
-isystem C:/QNX630/target/qnx6/usr/include/c++/3.3.5
-isystem C:/QNX630/target/qnx6/usr/include/c++/3.3.5/i386-pc-nto-qnx6.3.0
-isystem C:/QNX630/target/qnx6/usr/include/c++/3.3.5/backward
-isystem C:/QNX630/target/qnx6/usr/include
-isystem
C:/QNX630/host/win32/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.5/inc
lude
~

Evan Hillas wrote:

Colin Burgess wrote:

Ok I think we have a gcc bug. I’ve reported it to the tools guys…


Excellent. Thanks for the attention.

Thanks, also, to Mike Gorchak for the help with env variables.


You see all host QNX_HOST_TAG and QNX_TARGET_TAG lines - they should be
replaced with $QNX_HOST and $QNX_TARGET.

Looking at the specs file on my system they appear to be alright, so
you might have to manually add them to your cc flags.


Umm, cc flags? Changing CFLAGS and co don’t work. I presume I’m to dig
in the resultant Makefile or someplace like that?


Evan


cburgess@qnx.com

Right, got that done and compiling now. :slight_smile:

I added to the CPPFLAGS -DSA_RESTART=0 to bypass that particular error.


Next is a rather confusing error for me:

parse.C: In function bool parse_int(const char*, const char*, int&)': parse.C:68: error: invalid conversion from const char*’ to char*' parse.C: In function bool parse_double(const char*, const char*, double&)’:
parse.C:81: error: invalid conversion from const char*' to char*’

Lines 67 and 68 from parse.C …

bool parse_int(const char* buf, const char* tag, int& x) {
char* p = strstr(buf, tag);

Looking up strstr() in string.h I find a tangle that is more than I can understand. It is declared as const all round …

extern _Const_return char *strstr( const char *__s1, const char *__s2 );

I’m a bit concerned about that _Const_return piece.
And later there is this little gem …

inline char *strstr(char *_S, const char _P)
{ /
call with const first argument */
union { char *_Out; _Const_return char * _In; } _Result;
return (_Result._In = _CSTD strstr((const char *)_S, _P)), _Result._Out; }


Evan

Evan Hillas wrote:

parse.C: In function bool parse_int(const char*, const char*, int&)': parse.C:68: error: invalid conversion from const char*’ to `char*’

Lines 67 and 68 from parse.C …

bool parse_int(const char* buf, const char* tag, int& x) {
char* p = strstr(buf, tag);

Oh, click!, it is returning a pointer to a const char which means p should be declared as such. Hmm, I just assumed they would have something like that all nice and clean in such, supposedly, portable code.


Evan

Evan Hillas wrote:

Right, got that done and compiling now. > :slight_smile:

I added to the CPPFLAGS -DSA_RESTART=0 to bypass that particular error.

Danger - we don’t support SA_RESTART so that was why it wasn’t defined.
So you may have problems with interrupted kernel calls.

Next is a rather confusing error for me:

parse.C: In function bool parse_int(const char*, const char*, int&)': parse.C:68: error: invalid conversion from const char*’ to char*' parse.C: In function bool parse_double(const char*, const char*,
double&)’:
parse.C:81: error: invalid conversion from const char*' to char*’

Lines 67 and 68 from parse.C …

bool parse_int(const char* buf, const char* tag, int& x) {
char* p = strstr(buf, tag);

Looking up strstr() in string.h I find a tangle that is more than I can
understand. It is declared as const all round …

extern _Const_return char *strstr( const char *__s1, const char *__s2 );

I’m a bit concerned about that _Const_return piece.
And later there is this little gem …

inline char *strstr(char *_S, const char _P)
{ /
call with const first argument */
union { char *_Out; _Const_return char * _In; } _Result;
return (_Result._In = _CSTD strstr((const char *)_S, _P)),
_Result._Out; }


Evan


cburgess@qnx.com

Colin Burgess wrote:

Danger - we don’t support SA_RESTART so that was why it wasn’t defined.
So you may have problems with interrupted kernel calls.

What constitutes an interrupted kernel call? I can guess at something like a wait being aborted. And what is likely to happen without this support?


Will Robertson

If a signal is dropped on you then the kernel call (say MsgReceivev)
will return with -1 and errno==EINTR

SA_RESTART is a unixism to tell the kernel to restart the kernel call as
if nothing happened.

Evan Hillas wrote:

Colin Burgess wrote:

Danger - we don’t support SA_RESTART so that was why it wasn’t
defined. So you may have problems with interrupted kernel calls.


What constitutes an interrupted kernel call? I can guess at something
like a wait being aborted. And what is likely to happen without this
support?


Will Robertson


cburgess@qnx.com

Evan Hillas wrote:

Evan Hillas wrote:

parse.C: In function bool parse_int(const char*, const char*, int&)': parse.C:68: error: invalid conversion from const char*’ to `char*’

Lines 67 and 68 from parse.C …

bool parse_int(const char* buf, const char* tag, int& x) {
char* p = strstr(buf, tag);


Oh, click!, it is returning a pointer to a const char which means p
should be declared as such. Hmm, I just assumed they would have
something like that all nice and clean in such, supposedly, portable code.

Yes, you should declare p as “const char* p”.

But unless you’re compiling in C++ mode, the definition of “strstr”
should be

char *strstr(const char *s1, const char *s2);

This is a constness violation, but standardized as such in IEEE Std 1003.1-2001
for backwards compatibility with code that predates the
addition of “const” to C.

In C++ mode, there are two forms of “strstr”, const and non-const.
Only C++ supports such overloading. So in C++, if you
put in “const” arguments to strstr, you get a const output,
which looks like what you’re seeing.

So if you’re getting that error, I suspect you’ve somehow
enabled C++ mode in “gcc”. Which isn’t necessarily bad;
good C code should compile in C++ mode.

Or maybe the Gnu people decided to pull that old compatibility hack
out.

John Nagle

This “unixism” (SA_RESTART) is also an XSI extension.

Are we ever planning to support it?

Meanwhile, how can one distinguish between a system which doesn’t
support it at all (like Neutrino) and one which just doesn’t declare
SA_RESTART because automatic resumption is already the semantics
(like old BSD-based, non-XSI systems)?

dB


Colin Burgess wrote ~ Thu, 16 Jun 2005 20:13:19 -0400:

If a signal is dropped on you then the kernel call (say MsgReceivev)
will return with -1 and errno==EINTR

SA_RESTART is a unixism to tell the kernel to restart the kernel call as
if nothing happened.

Evan Hillas wrote:
Colin Burgess wrote:

Danger - we don’t support SA_RESTART so that was why it wasn’t
defined. So you may have problems with interrupted kernel calls.


What constitutes an interrupted kernel call? I can guess at something
like a wait being aborted. And what is likely to happen without this
support?


Will Robertson


cburgess@qnx.com

David Bacon wrote:

This “unixism” (SA_RESTART) is also an XSI extension.

Are we ever planning to support it?

I don’t believe we have any plans.

Meanwhile, how can one distinguish between a system which doesn’t
support it at all (like Neutrino) and one which just doesn’t declare
SA_RESTART because automatic resumption is already the semantics
(like old BSD-based, non-XSI systems)?

I’m not sure. Some standards guy might be ablee to comment. :v)

dB


Colin Burgess wrote ~ Thu, 16 Jun 2005 20:13:19 -0400:

If a signal is dropped on you then the kernel call (say MsgReceivev)
will return with -1 and errno==EINTR

SA_RESTART is a unixism to tell the kernel to restart the kernel call as
if nothing happened.

Evan Hillas wrote:

Colin Burgess wrote:


Danger - we don’t support SA_RESTART so that was why it wasn’t
defined. So you may have problems with interrupted kernel calls.


What constitutes an interrupted kernel call? I can guess at something
like a wait being aborted. And what is likely to happen without this
support?


Will Robertson


cburgess@qnx.com


cburgess@qnx.com