First test version of the compiler c++/g++ version 4.1.3 for QNX 6.3.0

First test version of the compiler c ++/ g ++ 4.1.3 for QNX 6.3.0, built on the base gcc-g++-4.1-20070604 (prerelease) is now available at http://www.ajam.org.pl/

  1. gcc --version

gcc (GCC) 4.1.3 20070604 (prerelease)

  1. c++ --version

c++ (GCC) 4.1.3 20070604 (prerelease)

This is the example of the compilation

  1. cat pr3.cc
  2. include
  3. include
  4. include
  5. include

class outbuf : public std::streambuf
{
protected:
/* central output function
* - print characters in uppercase mode
*/
virtual int_type overflow (int_type c) {
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(static_cast(c),getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
};
int main()
{
// create special output buffer
outbuf ob;
// initialize output stream with that output buffer
std::ostream out(&ob);
out << ""31 hexadecimal: ""
<< std::hex << 31 << std::endl;
return 0;
}

  1. g++ -v -o pr3 pr3.cc

Using built-in specs.
Target: i386-pc-nto-qnx6.3.0
Configured with: /src/gcc-4.1-20070604/configure --srcdir=/src/gcc-4.1-20070604 --program-suffix=4.1.3

Thread model: posix
gcc version 4.1.3 20070604 (prerelease)
/usr/local/libexec/gcc/i386-pc-nto-qnx6.3.0/4.1.3/cc1plus -quiet -v -nostdinc -nostdinc++

  • isystem /usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++
  • isystem /usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/i386-pc-nto-qnx6.3.0
  • isystem /usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/backward
  • idirafter /usr/qnx630/target/qnx6/usr/include

pr3.cc -quiet -dumpbase pr3.cc -auxbase pr3 -version -o /tmp/ccbkJpIr.s

  1. include ""..."" search starts here:
  2. include <...> search starts here:

/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++
/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/i386-pc-nto-qnx6.3.0
/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/backward
/usr/qnx630/target/qnx6/usr/include
End of search list.
GNU C++ version 4.1.3 20070604 (prerelease) (i386-pc-nto-qnx6.3.0)
compiled by GNU C version 4.1.3 20070604 (prerelease).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 0ba1a88cbabcebd22c3904fced6baada
/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/../../../../i386-pc-nto-qnx6.3.0/bin/as -V -Qy
-o /tmp/cc1Pzieg.o /tmp/ccbkJpIr.s
GNU assembler version 2.17 (i386-pc-nto-qnx6.3.0) using BFD version 2.17
/usr/local/libexec/gcc/i386-pc-nto-qnx6.3.0/4.1.3/collect2 -V -Y P,/usr/qnx630/target/qnx6/x86/lib

  • Qy -b elf32-i386 -m i386nto --dynamic-linker /usr/lib/ldqnx.so.2
  • opr3 /usr/qnx630/target/qnx6/x86/lib/crt1.o /usr/qnx630/target/qnx6/x86/lib/crti.o

/usr/qnx630/target/qnx6/x86/lib/crtbegin.o

  • L/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3
  • L/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/../../../../i386-pc-nto-qnx6.3.0/lib
  • L/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/../../.. /tmp/cc1Pzieg.o
  • lstdc++ -lm -lgcc
  • L /usr/qnx630/target/qnx6/x86/lib
  • L /usr/qnx630/target/qnx6/x86/usr/lib
  • L /usr/qnx630/target/qnx6/x86/opt/lib -lc -dn -Bstatic -lc -lgcc

/usr/qnx630/target/qnx6/x86/lib/crtend.o /usr/qnx630/target/qnx6/x86/lib/crtn.o
GNU ld version 2.17
Supported emulations:
i386nto

  1. ./pr3

31 HEXADECIMAL: 1F

  1. ldd pr3

./pr3:
libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 (0xb8200000)
libm.so.2 => /lib/libm.so.2 (0xb82db000)
libc.so.2 => /usr/lib/ldqnx.so.2 (0xb0300000)

[li]# # cat pr1.cc[/li]
  1. include

main( void )
{
cout << ""Hello .............."" << endl;
}

  1. c++ -o pr1 pr1.cc

In file included from /usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/backward/iostream.h:31, from pr1.cc:1:
/usr/local/lib/gcc/i386-pc-nto-qnx6.3.0/4.1.3/include/c++/backward/backward_warning.h:32:2: warning:

  1. warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header .

To disable this warning use -Wno-deprecated.

  1. ./pr1

Hello ..............
Press any key to continue...

Button of QOpenCD: