Unix Technical Forum

g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0

This is a discussion on g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0 within the AIX Operating System forums, part of the Unix Operating Systems category; --> hi, I'm porting a C++ multithread application from Solaris to IBM AIX 5.3 platform. The gcc configuration is : ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 10:54 AM
Alberto
 
Posts: n/a
Default 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 fucking english
thank you very much
bye Alberto

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 10:54 AM
bennett.tony@con-way.com
 
Posts: n/a
Default Re: g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0


Alberto wrote:
> 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 fucking english
> thank you very much
> bye Alberto


Alberto,

Review this (little bit dated) link:
http://www-128.ibm.com/developerwork...ry/au-gnu.html

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 10:54 AM
Alberto
 
Posts: n/a
Default 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

bennett.tony@con-way.com ha scritto:

> Alberto wrote:
> > 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 fucking english
> > thank you very much
> > bye Alberto

>
> Alberto,
>
> Review this (little bit dated) link:
> http://www-128.ibm.com/developerwork...ry/au-gnu.html
>
> 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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 10:55 AM
Perry Smith
 
Posts: n/a
Default 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:

> bennett.tony@con-way.com ha scritto:
>
>> Alberto wrote:
>>> 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 fucking english
>>> thank you very much
>>> bye Alberto


I would suggest subscribing to the GCC help email list:

http://gcc.gnu.org/lists.html

The place to subscribe (it was confusing to me) is about half way down
the page.

--
Perry Smith (*pedz@easesoftware.com )
Ease Software, Inc. (*http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 11:03 AM
Alberto
 
Posts: n/a
Default 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:

> 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 fucking english
> thank you very much
> bye Alberto


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com