g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0
hi,
I'm porting a C++ multithread application from Solaris to IBM AIX 5.3
platform.
The gcc configuration is :
g++ -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ./configure --prefix=/home/dwam4/cross/aix64
--with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared
--enable-threads=posix --enable-languages=c,c++ --disable-nls
Thread model: aix
gcc version 4.1.1
The compiler options are:
CXXFLAGS="-O2 -g -pthread -maxi64"
LDFLAGS="-lpthread"
All sources compile without error but when i execute the output I get
"segmentation fault"
in STL sources code.
The same sources compile without "-pthread" options, are fine and are
executed without errors.
Do you have same ideas about this problem ??
sorry for my ****ing english
thank you very much
bye Alberto
Re: g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0
Alberto wrote:[color=blue]
> hi,
> I'm porting a C++ multithread application from Solaris to IBM AIX 5.3
> platform.
> The gcc configuration is :
> g++ -v
> Using built-in specs.
> Target: powerpc-ibm-aix5.3.0.0
> Configured with: ./configure --prefix=/home/dwam4/cross/aix64
> --with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared
> --enable-threads=posix --enable-languages=c,c++ --disable-nls
> Thread model: aix
> gcc version 4.1.1
>
> The compiler options are:
> CXXFLAGS="-O2 -g -pthread -maxi64"
> LDFLAGS="-lpthread"
>
> All sources compile without error but when i execute the output I get
> "segmentation fault"
> in STL sources code.
> The same sources compile without "-pthread" options, are fine and are
> executed without errors.
>
> Do you have same ideas about this problem ??
>
> sorry for my ****ing english
> thank you very much
> bye Alberto[/color]
Alberto,
Review this (little bit dated) link:
[url]http://www-128.ibm.com/developerworks/aix/library/au-gnu.html[/url]
Pay particular care to section on "Compiler Options", which says in
part:
-pthread compiles and links your application code with the POSIX
threads library, just as
you would do in VisualAge (or XL) C/C++. With VisualAge (or XL)
C/C++, you can also
compile and link using xlc_r or xlC_r to get thread support, but
this option doesn't exist
with GCC. Threaded code should therefore be linked with -pthread for
GCC. The -pthread
option sets flags for both the preprocessor and linker.
-tony
Re: g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0
Hi Tony,
thank you very much for your support.
I tried using "-pthread" as linking options but I had the same
problems of "Segmentation fault" when I run the executables.
Did you use GCC with pthread options on some projects or do you known
someone with experience on GCC in AIX environment ??
We ned to to resolve the problem and we have some good opportunites for
who
is able to help us.
thanks
bye Alberto
[email]bennett.tony@con-way.com[/email] ha scritto:
[color=blue]
> Alberto wrote:[color=green]
> > hi,
> > I'm porting a C++ multithread application from Solaris to IBM AIX 5.3
> > platform.
> > The gcc configuration is :
> > g++ -v
> > Using built-in specs.
> > Target: powerpc-ibm-aix5.3.0.0
> > Configured with: ./configure --prefix=/home/dwam4/cross/aix64
> > --with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared
> > --enable-threads=posix --enable-languages=c,c++ --disable-nls
> > Thread model: aix
> > gcc version 4.1.1
> >
> > The compiler options are:
> > CXXFLAGS="-O2 -g -pthread -maxi64"
> > LDFLAGS="-lpthread"
> >
> > All sources compile without error but when i execute the output I get
> > "segmentation fault"
> > in STL sources code.
> > The same sources compile without "-pthread" options, are fine and are
> > executed without errors.
> >
> > Do you have same ideas about this problem ??
> >
> > sorry for my ****ing english
> > thank you very much
> > bye Alberto[/color]
>
> Alberto,
>
> Review this (little bit dated) link:
> [url]http://www-128.ibm.com/developerworks/aix/library/au-gnu.html[/url]
>
> Pay particular care to section on "Compiler Options", which says in
> part:
> -pthread compiles and links your application code with the POSIX
> threads library, just as
> you would do in VisualAge (or XL) C/C++. With VisualAge (or XL)
> C/C++, you can also
> compile and link using xlc_r or xlC_r to get thread support, but
> this option doesn't exist
> with GCC. Threaded code should therefore be linked with -pthread for
> GCC. The -pthread
> option sets flags for both the preprocessor and linker.
>
> -tony[/color]
Re: g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0
On 2006-12-04 09:38:33 -0600, "Alberto" <albeporta@gmail.com> said:
[color=blue]
> [email]bennett.tony@con-way.com[/email] ha scritto:
>[color=green]
>> Alberto wrote:[color=darkred]
>>> hi,
>>> I'm porting a C++ multithread application from Solaris to IBM AIX 5.3
>>> platform.
>>> The gcc configuration is :
>>> g++ -v
>>> Using built-in specs.
>>> Target: powerpc-ibm-aix5.3.0.0
>>> Configured with: ./configure --prefix=/home/dwam4/cross/aix64
>>> --with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared
>>> --enable-threads=posix --enable-languages=c,c++ --disable-nls
>>> Thread model: aix
>>> gcc version 4.1.1
>>>
>>> The compiler options are:
>>> CXXFLAGS="-O2 -g -pthread -maxi64"
>>> LDFLAGS="-lpthread"
>>>
>>> All sources compile without error but when i execute the output I get
>>> "segmentation fault"
>>> in STL sources code.
>>> The same sources compile without "-pthread" options, are fine and are
>>> executed without errors.
>>>
>>> Do you have same ideas about this problem ??
>>>
>>> sorry for my ****ing english
>>> thank you very much
>>> bye Alberto[/color][/color][/color]
I would suggest subscribing to the GCC help email list:
[url]http://gcc.gnu.org/lists.html[/url]
The place to subscribe (it was confusing to me) is about half way down
the page.
--
Perry Smith (*pedz@easesoftware.com )
Ease Software, Inc. (*[url]http://www.easesoftware.com[/url] )
Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems
Re: g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0
Hi,
I have some news: you need to install a patch released in decembre 2006
by IBM to resolve this problem.
The patch is include in SP of dicember 2006 and modified the include
file /usr/include/sys/threads.h.
bye
Alberto
Alberto ha scritto:
[color=blue]
> hi,
> I'm porting a C++ multithread application from Solaris to IBM AIX 5.3
> platform.
> The gcc configuration is :
> g++ -v
> Using built-in specs.
> Target: powerpc-ibm-aix5.3.0.0
> Configured with: ./configure --prefix=/home/dwam4/cross/aix64
> --with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared
> --enable-threads=posix --enable-languages=c,c++ --disable-nls
> Thread model: aix
> gcc version 4.1.1
>
> The compiler options are:
> CXXFLAGS="-O2 -g -pthread -maxi64"
> LDFLAGS="-lpthread"
>
> All sources compile without error but when i execute the output I get
> "segmentation fault"
> in STL sources code.
> The same sources compile without "-pthread" options, are fine and are
> executed without errors.
>
> Do you have same ideas about this problem ??
>
> sorry for my ****ing english
> thank you very much
> bye Alberto[/color]