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

This is a discussion on g++ 4.1.1 with pthread option on powerpc-ibm-aix5.3.0.0 - Aix ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

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

  1. 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


  2. 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 ****ing 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


  3. 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 ****ing 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



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

    On 2006-12-04 09:38:33 -0600, "Alberto" 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 ****ing 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


  5. 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 ****ing english
    > thank you very much
    > bye Alberto



+ Reply to Thread