Bug 35602 - xmalloc.c error is undefined
Summary: xmalloc.c error is undefined
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: kdevelop 2.x (obsolete) (show other bugs)
Version: unspecified
Platform: Compiled Sources FreeBSD
: NOR normal
Target Milestone: ---
Assignee: KDevelop-Devel List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-30 19:03 UTC by keith
Modified: 2002-09-16 14:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keith 2001-11-30 18:55:40 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kdevelop
Version:           KDE 2.2.2 
Severity:          normal
Installed from:    Compiled From Sources
Compiler:          gcc 2.95.3
OS:                FreeBSD
OS/Compiler notes: FreeBSD 4.4

while compiling kdesdk-2.2.2 kbabel does not compile due to error being undefined in common/libgettext.a from xmalloc.c

/bin/sh ../../libtool --mode=link --tag=CXX g++  -O2 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT
-DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST   -o libkbabelcommon.la.closure libkbabelcommon_la_closure.lo -Llibgettext -L/usr/X11R6/lib -L/usr/local/qt-2.3.1//lib -L/usr/local/kde/lib  -L/usr/local/lib -module
-version-info 1:0:0 -no-undefined catalog.lo catalogitem.lo editcmd.lo msgfmt.lo catalogsettings.lo tagextractor.lo diff.lo libkbabelcommon_la_meta_unload.lo  -lkio -lkdecore -lgettext
libtool: link: warning: `-version-info' is ignored for programs
g++ -O2 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o libkbabelcommon.la.closure .libs/libkbabelcommon_la_closure.o .libs/catalog.o .libs/catalogitem.o .libs/editcmd.o .libs/msgfmt.o .libs/catalogsettings.o .libs/tagextractor.o .libs/diff.o .libs/libkbabelcommon_la_meta_unload.o  -L/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext -L/usr/X11R6/lib -L/usr/local/qt-2.3.1//lib -L/usr/local/kde/lib -L/usr/local/lib /usr/local/kde/lib/libkio.so -L/usr/libexec/elf -L/usr/libexec -L/usr/lib
/usr/local/kde/lib/libkdesu.so -lutil /usr/local/kde/lib/libkssl.so /usr/local/kde/lib/libkdeui.so /usr/local/kde/lib/libkdecore.so /usr/local/kde/lib/libDCOP.so -lqt -lpng -lz -ljpeg -lXext -lX11 -lSM -lICE -lstdc++ -lm /home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext/.libs/libgettext.a -Wl--rpath -Wl/usr/local/kde/lib -Wl--rpath -Wl/usr/local/kde/lib
/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common/libgettext/.libs/libgettext.a(xmalloc.o): In function `fixup_null_alloc':
xmalloc.o(.text+0x44): undefined reference to `error'
gmake[1]: *** [libkbabelcommon.la.closure] Error 1
gmake[1]: Leaving directory `/home/keith/src/kde2.2.2/kdesdk-2.2.2/kbabel/common'
gmake: *** [all-recursive] Error 1

the following patch will fix the problem.  Note: only tested on FreeBSD 4.4

*** xmalloc.c.orig      Mon Apr  9 06:30:55 2001
--- xmalloc.c   Fri Nov 30 10:54:45 2001
***************
*** 2631 ****
--- 2632 ----
  #endif
 
  #include <sys/types.h>
+ #include <err.h>
 
  #if STDC_HEADERS
  # include <stdlib.h>
***************
*** 6167 ****
     The caller may set it to some other value.  */
  int xmalloc_exit_failure = EXIT_FAILURE;
 
- void error (int int const char * ...);
 
  static VOID *
  fixup_null_alloc (n)
--- 6267 ----
***************
*** 7379 ****
    if (n == 0)
      p = malloc ((size_t) 1);
    if (p == 0)
!     error (xmalloc_exit_failure 0 _("Memory exhausted"));
    return p;
  }
 
--- 7379 ----
    if (n == 0)
      p = malloc ((size_t) 1);
    if (p == 0)
!     err (xmalloc_exit_failure "Memory exhausted");
    return p;
  }

---------
--Keith


(Submitted via bugs.kde.org)
Comment 1 Lars Tunkrans 2001-12-05 20:00:18 UTC
Bug id 35602   is  valid for Solaris 8 as well.  I get the error text
below.




Undefined                       first referenced
 symbol                             in file
error
/opt/src/kde222/kdesdk-2.2.2/kbabel/common/libgettext/.libs/libgettext.a(xmalloc.o)

ld: fatal: Symbol referencing errors. No output written to
libkbabelcommon.la.closure
collect2: ld returned 1 exit status


--
========================================================
Lars Tunkrans
ICL Distinguished Engineer
SUN Certified Network Administrator
Microsoft MCP MCP+I MCSE MCSE+I
Phone: +46-87937419 +46-707937419
Internet Mail: ltu@icl.se
Exchange Mail: lars.tunkrans@icl.se
Hemma:         lars.tunkrans@bredband.net
--------------------------------------------------------
Comment 2 John Firebaugh 2002-09-15 20:53:58 UTC
No longer applicable