GCC 3.4.6 error after good compile on AIX 5.2.08 - Aix

This is a discussion on GCC 3.4.6 error after good compile on AIX 5.2.08 - Aix ; Hello All I did a compile of entire core of GCC 3.4.6 yesterday. I think compile came out clean (i have the log file for the entire compile and it's huge and I dont know what to check if the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: GCC 3.4.6 error after good compile on AIX 5.2.08

  1. GCC 3.4.6 error after good compile on AIX 5.2.08

    Hello All

    I did a compile of entire core of GCC 3.4.6 yesterday. I think compile
    came out clean (i have the log file for the entire compile and it's
    huge and I dont know what to check if the compile is bad or not).
    This is how the end of compile looked like (last 20 lines from compile
    log). I am new at AIX and UNIX and GCC. So i am assuming that this is
    a good compile.

    make[8]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/pthread/ppc64/libstdc++-v3/testsuite'
    make[8]: Entering directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ib
    m-aix5.2.0.0/pthread/ppc64/libstdc++-v3'
    : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc"
    "CC_FOR_TARGET=/usr/sys/inst
    ..images/gcc-3.4.6/gcc-build/gcc/xgcc
    -B/usr/sys/inst.images/gcc-3.4.6/gcc-build/
    gcc/ -B/opt/gcc-3.4.6/powerpc-ibm-aix5.2.0.0/bin/
    -B/opt/gcc-3.4.6/powerpc-ibm-a
    ix5.2.0.0/lib/ -isystem /opt/gcc-3.4.6/powerpc-ibm-aix5.2.0.0/include
    -isystem /
    opt/gcc-3.4.6/powerpc-ibm-aix5.2.0.0/sys-include" "CFLAGS=-O2 -g -O2
    -pthread -
    maix64" "CXXFLAGS=-g -O2 -pthread -maix64" "CFLAGS_FOR_BUILD="
    "CFLAGS_FOR_TARG
    ET=-O2 -g -O2" "INSTALL=/opt/freeware/bin/install -c"
    "INSTALL_DATA=/opt/freewar
    e/bin/install -c -m 644" "INSTALL_PROGRAM=/opt/freeware/bin/install -c"
    "INSTALL
    _SCRIPT=/opt/freeware/bin/install -c" "LDFLAGS=-pthread -maix64"
    "LIBCFLAGS=-O2
    -g -O2 -pthread -maix64" "LIBCFLAGS_FOR_TARGET=-O2 -g -O2" "MAKE=make"
    "MAKEINF
    O=/usr/sys/inst.images/gcc-3.4.6/gcc-3.4.6/missing makeinfo
    --split-size=5000000
    --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET="
    "SHELL=/opt/freew
    are/bin/bash" "RUNTESTFLAGS=" "exec_prefix=/opt/gcc-3.4.6"
    "infodir=/opt/gcc-3.4
    ..6/info" "libdir=/opt/gcc-3.4.6/lib"
    "includedir=/opt/gcc-3.4.6/include" "prefix
    =/opt/gcc-3.4.6" "tooldir=/opt/gcc-3.4.6/powerpc-ibm-aix5.2.0.0"
    "gxx_include_di
    r=/opt/gcc-3.4.6/include/c++/3.4.6" "AR=ar -X32_64" "AS=as" "LD=ld"
    "LIBCFLAGS=-
    O2 -g -O2 -pthread -maix64" "PICFLAG=" "RANLIB=ranlib" "NM=nm -B
    -X32_64" "NM_F
    OR_BUILD=" "NM_FOR_TARGET=nm -B -X32_64" "DESTDIR=" "WERROR=" DO=all
    multi-do
    make[8]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/pthread/ppc64/libstdc++-v3'
    make[7]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/pthread/ppc64/libstdc++-v3'
    make[6]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/pthread/ppc64/libstdc++-v3'
    make[5]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/libstdc++-v3'
    make[4]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/libstdc++-v3'
    make[3]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/libstdc++-v3'
    make[2]: Leaving directory
    `/usr/sys/inst.images/gcc-3.4.6/gcc-build/powerpc-ibm
    -aix5.2.0.0/libstdc++-v3'
    make[1]: Leaving directory `/usr/sys/inst.images/gcc-3.4.6/gcc-build'

    compile was done with following options
    #!/bin/sh
    #
    # configures and makes gcc
    CONFIG_SHELL=/opt/freeware/bin/bash
    export CONFIG_SHELL
    gccversion=3.4.6
    blddir=gcc-build

    rm -rf gcc-3.4.6
    rm build.log
    gzip -cd gcc-3.4.6.tar.gz | tar -xvf -
    rm -rf $blddir
    mkdir $blddir
    cd $blddir

    # make sure default flags haven't been modified
    unset CFLAGS
    unset CXXFLAGS
    export MAKEFLAGS=''

    # put gnu tools on the path
    PATH=/opt/freeware/bin:$PATH
    export PATH

    echo "building gcc $gccversion..." | tee -a ../build.log
    date >> ../build.log

    # configure
    .../gcc-${gccversion}/configure \
    --prefix=/opt/gcc-${gccversion} \
    --enable-languages=c,c++ \
    --with-pic \
    --disable-shared \
    --disable-nls \
    --with-gnu-ld \
    --with-ld=/opt/binutils-2.17/bin/ld \
    --with-gnu-as \
    --with-as=/opt/binutils-2.17/bin/as \
    --enable-threads=posix 2>&1 | tee -a ../build.log

    make bootstrap 2>&1 | tee -a ../build.log


    Now when we try to compile simple programs these are the errors we get
    I added the gcc compiler to my path and tried to compile a very
    simple C++ program.

    Here is the test program :
    bash-3.00$ cat test.cpp
    #include

    int main(int argc, char **argv)
    {
    return printf("Hello world.\n");
    }

    Here is the location of gcc 3.4.6:

    bash-3.00$ which gcc
    /opt/gcc-3.4.6/bin/gcc


    Here is the version information for gcc:
    bash-3.00$ gcc --version
    gcc (GCC) 3.4.6
    Copyright (C) 2006 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.


    Here is what happens when I try to compile and link a simple program:
    bash-3.00$ gcc test.cpp
    ld: 0711-317 ERROR: Undefined symbol: __gxx_personality_v0
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
    information.
    collect2: ld returned 8 exit status


    Here is what happens when I try to compile and link explicitly using
    the C++ compiler:
    bash-3.00$ g++ test.cpp
    ld: 0711-317 ERROR: Undefined symbol: typeinfo for std::bad_exception
    (Many more link errors follow).



    Interestingly, gcc is compiling, but we cannot seem to link
    programs into something that will run. I've tried both the default
    linker (/usr/bin/ld) and the updated one (/usr/binutils-2.17/bin/ld)
    and was not successful with either of them.


    I cannot proceed very far with VHI porting until these linkage
    problems get addressed. I don't know what is causing these, except
    possibly for problems with gcc libraries such as libstdc++

    If I rename the file to test.c, I can compile, link, and run it as
    a straight "C" program.

    Can anyone help?????? any suggestions? what went wrong or how should I
    check if the compile is good or bad?

    Thanks

    Abid


  2. Re: GCC 3.4.6 error after good compile on AIX 5.2.08


    >
    > Here is what happens when I try to compile and link a simple program:
    > bash-3.00$ gcc test.cpp
    > ld: 0711-317 ERROR: Undefined symbol: __gxx_personality_v0
    > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
    > information.
    > collect2: ld returned 8 exit status
    >
    >
    > Here is what happens when I try to compile and link explicitly using
    > the C++ compiler:
    > bash-3.00$ g++ test.cpp
    > ld: 0711-317 ERROR: Undefined symbol: typeinfo for std::bad_exception
    > (Many more link errors follow).
    >
    >
    >
    > Interestingly, gcc is compiling, but we cannot seem to link
    > programs into something that will run. I've tried both the default
    > linker (/usr/bin/ld) and the updated one (/usr/binutils-2.17/bin/ld)
    > and was not successful with either of them.
    >
    >
    > I cannot proceed very far with VHI porting until these linkage
    > problems get addressed. I don't know what is causing these, except
    > possibly for problems with gcc libraries such as libstdc++
    >
    > If I rename the file to test.c, I can compile, link, and run it as
    > a straight "C" program.
    >
    > Can anyone help?????? any suggestions? what went wrong or how should I
    > check if the compile is good or bad?
    >
    > Thanks
    >
    > Abid


    I've gotten the __gxx_personality error before- when trying to get a
    good working Python. I solved THAT by finding that symbol (nm -A
    /usr/local/lib* | grep __gxx_personality_v0) and forcing the -l
    at compile time. (It's in stdc++ somewhere)

    That worked for me. It sounds like the standard C++ library isn't a
    default library. Mine isn't.

    J

  3. Re: GCC 3.4.6 error after good compile on AIX 5.2.08

    > Here is what happens when I try to compile and link explicitly using
    > the C++ compiler:
    > bash-3.00$ g++ test.cpp
    > ld: 0711-317 ERROR: Undefined symbol: typeinfo for std::bad_exception
    > (Many more link errors follow).


    I'd say C++ is far beyond the limits of the human understanding,
    but you can try:

    add line "using namespace std;" to your program
    compile with '-Wall' option to see any warning.

+ Reply to Thread