bugle xmalloc xrealloc & libreadline

2008-05-31
2013-06-13
  • I had a problem compiling bugle at first since gcc 4.2.1 reported this:

    ...
    ranlib filters/.libs/showstats.a
    rm -fr filters/.libs/showstats.lax
    creating filters/showstats.la
    (cd filters/.libs && rm -f showstats.la && ln -s ../showstats.la showstats.la)
    /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99  -g -O2   -o gldb/gldb -thread-safe gldb/gldb.o gldb/gldb-common.o src/libbugleutils.la -lhistory -lreadline -lncurses   lib/libgnu.la
    gcc -std=gnu99 -g -O2 -o gldb/.libs/gldb gldb/gldb.o gldb/gldb-common.o  src/.libs/libbugleutils.so -lhistory -lreadline -lncurses lib/.libs/libgnu.a  -Wl,--rpath -Wl,/usr/local/lib
    lib/.libs/libgnu.a(xmalloc.o): In function `xrealloc':
    /usr/local/src/bugle-0.0.20080303/lib/xmalloc.c:61: multiple definition of `xrealloc'
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../libhistory.a(xmalloc.o):(.text+0x50): first defined here
    lib/.libs/libgnu.a(xmalloc.o): In function `xmalloc':
    /usr/local/src/bugle-0.0.20080303/lib/xmalloc.c:49: multiple definition of `xmalloc'
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../libhistory.a(xmalloc.o):(.text+0xb0): first defined here
    collect2: ld returned 1 exit status
    make[2]: *** [gldb/gldb] Error 1
    make[2]: Leaving directory `/usr/local/src/bugle-0.0.20080303'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/usr/local/src/bugle-0.0.20080303'
    make: *** [all] Error 2

    When I commented these xmalloc and xrealloc functions out, I got a few undefined references. Now, instead of 'make' I tried 'make LIBS=-lreadline'. It almost worked.

    For tests I also had to manually link to readline library. Some of the tests failed but probably due to other reasons..

    'make install' was successful.

    Another problem occurred when I executed gldb-gui:
    ERROR: ld.so: object 'libbugle.so' from LD_PRELOAD cannot be preloaded: ignored

    It could not find libbugle.so from /usr/lib as it was in /usr/local/lib. So I made a soft link.

    But there is still 1 problem left - I get a symbol lookup error: /usr/lib/libbugle.so: undefined symbol: xmalloc.

    This one works:
    BUGLE_CHAIN=chain LD_PRELOAD=libbugle.so:libreadline.so program

    Is there a way to specify additional preloaded objects for gldb or gldb-gui aswell?

    All suggestions are welcome,
    Thank You

     
    • Bruce Merry
      Bruce Merry
      2009-03-15

      Hi

      Apologies for not replying to this months ago - it seems I missed the email notification.

      Is this still causing you problems with the latest bugle version? If so, you can open a ticket at http://apps.sourceforge.net/trac/bugle and I'll take a look.