[ug-bosug] porting libntp .. AC_FUNC_MALLOC error
Jerry Raj
jerryr at sun.com
Fri Aug 10 03:20:14 PDT 2007
On 09/08/07 11:34, Anil Gulecha wrote:
> Hi all,
>
> I was trying to port libntp library that allows talking to
> Creative(and other) mp3 players.. the source consists of the libraries
> and a sample application.
>
> I had the initial -Wall errors that I corrected and the library has
> built fine. However, the sample app isnt building.
>
> bash-3.00$ pwd
> /tmp/libnjb-2.2.5
> bash-3.00$ ls src/.libs/
> base.o ioutil.o libnjb.so njbtime.o protocol3.o
> byteorder.o libnjb.a libnjb.so.5 playlist.o songid.o
> datafile.o libnjb.la libnjb.so.5.1.0 procedure.o unicode.o
> eax.o libnjb.lai njb_error.o protocol.o usb_io.o
> bash-3.00$ cd sample/
> bash-3.00$ make
> /bin/bash ../libtool --tag=CC --mode=link /opt/SUNWspro/bin/cc
> -I../src -g -L/usr/sfw/lib -o cursesplay cursesplay.o
> ../src/libnjb.la -lcurses -lusb
> /opt/SUNWspro/bin/cc -I../src -g -o .libs/cursesplay cursesplay.o
> -L/usr/sfw/lib ../src/.libs/libnjb.so -lcurses -lusb -R/usr/local/lib
> Undefined first referenced
> symbol in file
> rpl_malloc ../src/.libs/libnjb.so
> ld: fatal: Symbol referencing errors. No output written to .libs/cursesplay
> make: *** [cursesplay] Error 1
> bash-3.00$
>
>
> Upon googling I found out about AC_FUNC_MALLOC macro in configure.ac
> that checks for correct calling of malloc, and malloc is replaced by
> rpl_malloc for incorrect calling.
>
> Workarounds are given at http://wiki.buici.com/wiki/Autoconf_and_RPL_MALLOC
>
> but these appear to be more hacky that a correct workaround. According
> to http://cygwin.com/ml/automake/2003-05/msg00043.html that error
> comes forward when malloc isn't correctly called.. and thus the
> correct thing to do in this situation is patch the source by clearing
> this error.
>
> My questions are:
>
> What is the ideal way to patch this error?
> What is the best way to patch this error for a spec file?
> I removed the -Wall flag from the Makefiles.. however this was said to
> be hacky, What is the correct way of going about correcting this
> error?
This error should never happen on Solaris. The AC_FUNC_MALLOC autoconf
macro checks whether malloc(0) returns a valid pointer, which it does on
Solaris (and Linux). You could check the version of autoconf, maybe
upgrading it will help. Or there could be problems with the autoconf
input files for the project.
-Jerry
>
> Anil
> _______________________________________________
> ug-bosug mailing list
> List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
> List-Owner: mailto:ug-bosug-owner at opensolaris.org
> List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3701 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.opensolaris.org/pipermail/ug-bosug/attachments/20070810/c20fc2c6/attachment.bin
More information about the ug-bosug
mailing list