and how to get it running under AIX

Collection of the problems various users had



 

[KDE] 

1. configure fails with "checking for KDE paths... problems"

    Problem

    I want to compile the kdebase src in Aix 3.2.5. I run the configure script and the following error ocurs:
        checking for KDE paths... problems
        configure: error: configure can not run a little KDE program to test
            the environment.
    I've looked int the config.log file and the error is the result from the command: 
        g++ -o conftest -O2 -Wall -I/util/usr/local/include
            -I/util/qt-1.33//include -s -L/util/usr/local/lib conftest.C
            -lkdecore -lqt -lXext -lX11
    I use the same command without the -s option and it compiles just fine. What does the -s option mean?
    I have compiled the kdesupport and the kdelibs succesfuly. I have the gcc 2.8.1 version with the libstdc++ 2.8.1. I also looked in the gcc man for the -s option but I can't find it! What am I missing? 

    Solution

    gcc -s strips the binary after compiling it. See the section about strip on the KDE-Aix-Page, there is a description what can go wrong with strip, and how you can solve the problem. 

2. I have trouble linking on Aix 4.x (programs crash/I get undefined symbols). [beta3 or below only]

    Problem

    Either: I want to compile the kde beta3 under Aix 4.x. While compiling I get lots of undefined symbols.
    Or: I have compiled kde beta3 under Aix 4.x. Some programs work, but most (kdehelp, kfm, ...) tend to crash upon start or in many situations.

    Solution

    First of all: use kde beta4 or later, this is only provided for documentation and information purposes.

    The libtool version that comes with the KDE beta3 will not produce working binaries - at least with gcc-2.7.2.x and binutils-2.8.1. Some of them might look good when you start them (for instance kfm), others will coredump immediately (kedit, kdehelp).

    To avoid the problem, you have to do comment the following lines in libtool, after running configure and before running make. Do this each time you compile the next part, such as kdelibs, kdebase, kdegames, kdeutils and similar.

    # AIX sometimes has problems with the GCC collect2 program.  For some
    # reason, if we set the COLLECT_NAMES environment variable, the problems
    # vanish in a puff of smoke.
    if test "${COLLECT_NAMES+set}" != set; then
      COLLECT_NAMES=
      export COLLECT_NAMES
    fi
    

    They should rather look like that:

    # AIX sometimes has problems with the GCC collect2 program.  For some
    # reason, if we set the COLLECT_NAMES environment variable, the problems
    # vanish in a puff of smoke.
    # if test "${COLLECT_NAMES+set}" != set; then
    #   COLLECT_NAMES=
    #   export COLLECT_NAMES
    # fi
    

    If you are curious what goes wrong, here is an explenation, otherwise skip the rest of this section:

    The problem was always the same:

    foo.h:
    ------
    class kfoo {
       static QList windowList;
    };
    
    foo.cpp:
    --------
    QList kfoo::windowList;
    

    In an application which uses foo.o and somehow accesses kfoo::windowList (from inside or outside kfoo), AIX says SIGILL (illegal instruction) and the program terminates.

    The problem is that the constructor of the QList never gets called. (But also other classes than QList cause problems). So generally speaking, "static member classes" don't work. Some programs (e.g. kfm) have been tuned in the past to avoid such, because AIX was not the only architecture causing troubles. But this has never been official KDE programming style, and newer libtools will fix the problem out-of-the-box, even without patching.

3. I get some error message with a TOC overflow while linking

    Problem

    using the beta4 tar bzip2 source files:
    /bin/sh ../libtool --mode=link g++ -O2 -Wall -s -o kfm  kfmgui.o
    kfmview.o kbind.o main.o htmlopts.o kfmdlg.o bookmark.o kfmprops.o
    kfmserver_ipc.o kfmserver_ipc2.o kfmserver.o kioserver.o kioserver_ipc.o
    kioserver_ipc2.o kfmipc.o root.o kfmman.o kiojob.o kmsgwin.o htmlcache.o
    autostart.o kfmtree.o xview.o krenamewin.o passworddialog.o
    kURLcompletion.o debug.o kfm.o kfmpaths.o kfmjob.o kfmexec.o
    kmimemagic.o kfinder.o utils.o useragentdlg.o kproxydlg.o kkfmoptdlg.o
    -L/usr/local/kde/lib -L/usr/local/qt/lib  -lkhtmlw -lkdeui -lkdecore
    -lqt -lXext -lX11  -ljpeg -ljscript -lm -rpath /usr/local/kde/lib -rpath
    /usr/local/qt/lib 
    g++ -O2 -Wall -s -o kfm kfmgui.o kfmview.o kbind.o main.o htmlopts.o
    kfmdlg.o bookmark.o kfmprops.o kfmserver_ipc.o kfmserver_ipc2.o
    kfmserver.o kioserver.o kioserver_ipc.o kioserver_ipc2.o kfmipc.o root.o
    kfmman.o kiojob.o kmsgwin.o htmlcache.o autostart.o kfmtree.o xview.o
    krenamewin.o passworddialog.o kURLcompletion.o debug.o kfm.o kfmpaths.o
    kfmjob.o kfmexec.o kmimemagic.o kfinder.o utils.o useragentdlg.o
    kproxydlg.o kkfmoptdlg.o -L/usr/local/kde/lib -L/usr/local/qt/lib
    -lkhtmlw -lkdeui -lkdecore -lqt -lXext -lX11 -ljpeg -ljscript -lm
    collect2: ld returned 12 exit status
    ld: 0711-781 ERROR: TOC overflow. TOC size: 69296       Maximum size:
    65536

    Solution

    To prevent that I have added the -mminimal-toc option to the compiler options.
    (Note: That means using
    CXXFLAGS="-O2 -mminimal-toc" ./configure
    while compiling kdesupport, kdelibs, kdebase,...)


Feel free to send comments, reports or questions to Stefan Westerfeld.