LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-24-2017, 04:13 PM   #1
GrumpyGnome
Member
 
Registered: May 2004
Location: El Sobrante, CA (the scraps)
Distribution: Fedora, RH, & Slack
Posts: 57

Rep: Reputation: 15
error for undefined rpl_malloc compiling scalpel


Hello,
I am building scalpel 2.0 on Slackware 14.2 and after successful ./configure the make fails with multiple errors:

Code:
./.libs/libscalpel.a(syncqueue.o): In function `syncqueue_init(char const*, unsigned long)':
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:84: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:86: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:88: undefined reference to `rpl_malloc'
./.libs/libscalpel.a(prioque.o): In function `nolock_add_to_queue(Queue*, void*, int)':
/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:152: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:158: undefined reference to `rpl_malloc'
./.libs/libscalpel.a(prioque.o):/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:482: more undefined references to `rpl_malloc' follow
I have not found much on rpl_malloc. I read that this could be caused by an automake tool or cross compiling problem. I am not cross compiling. In the configure.ac I commented out the test for AC_FUNC_MALLOC. This did not help. My error reads like a missing function definition to me rather than a makefile error.
Do I need to add a lib to my 14.2 install or ...?

Happy Trails
 
Old 01-24-2017, 04:43 PM   #2
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Any reason why you're not using the SlackBuild?
https://slackbuilds.org/repository/14.2/system/scalpel/

It requires something called tre
https://slackbuilds.org/repository/14.2/libraries/tre/

Edit: Do you have multilib installed? If you didn't have a full Slackware installation, you would tell us, right?

Last edited by 55020; 01-24-2017 at 05:28 PM.
 
1 members found this post helpful.
Old 01-25-2017, 07:42 AM   #3
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by GrumpyGnome View Post
Hello,
I am building scalpel 2.0 on Slackware 14.2 and after successful ./configure the make fails with multiple errors:

Code:
./.libs/libscalpel.a(syncqueue.o): In function `syncqueue_init(char const*, unsigned long)':
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:84: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:86: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/syncqueue.cpp:88: undefined reference to `rpl_malloc'
./.libs/libscalpel.a(prioque.o): In function `nolock_add_to_queue(Queue*, void*, int)':
/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:152: undefined reference to `rpl_malloc'
/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:158: undefined reference to `rpl_malloc'
./.libs/libscalpel.a(prioque.o):/usr/local/docs/recov-ware/scalpel-2.0/src/prioque.cpp:482: more undefined references to `rpl_malloc' follow
I have not found much on rpl_malloc. I read that this could be caused by an automake tool or cross compiling problem. I am not cross compiling. In the configure.ac I commented out the test for AC_FUNC_MALLOC. This did not help. My error reads like a missing function definition to me rather than a makefile error.
Do I need to add a lib to my 14.2 install or ...?

Happy Trails
A possible cause of this issue is when you have a library in a non standard directory.

In fact, I guess, that you have build tre with ./configure && make && make install, which leads libtre.* libraries to be installed in /usr/local/lib instead of /usr/lib{64} :

Code:
$ cd tre-0.8.0/
$ ./configure && make && make install
...
Libraries have been installed in:
   /usr/local/lib

$ cd ../scalpel-git
$ ./bootstrap && ./configure && make
...
./.libs/libscalpel.a(dig.o):/home/seb/scalpel-git/scalpel/src/dig.cpp:2692: more undefined references to `rpl_malloc' follow
When tre is configured with --prefix=/usr and --libdir=/usr/lib64 (or /usr/lib on slackware 32-bit), scalpel build fine :

Code:
$ cd tre-0.8.0/
$ ./configure --prefix=/usr --libdir=/usr/lib64 && make && make install
...
Libraries have been installed in:
   /usr/lib64

...
$ cd ../scalpel-git
$ make clean
$ ./bootstrap && ./configure && make
...
cc/x86_64-slackware-linux/5.3.0/../../../../lib64/libtre.so /usr/lib64/../lib64/libstdc++.so /usr/lib64/libtre.so -lpthread -lm -Wl,-rpath -Wl,/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64 -Wl,-rpath -Wl,/usr/lib64/../lib64 -Wl,-rpath -Wl,/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64 -Wl,-rpath -Wl,/usr/lib64/../lib64
make[1]: Leaving directory '/home/seb/TEST/scalpel.git'
Anyway, the easiest way to fix your issue is to use the tre and scalpel slackbuilds from slackbuilds.org as 55020 has suggested that earlier.

--
SeB

Last edited by phenixia2003; 01-25-2017 at 08:44 AM.
 
1 members found this post helpful.
Old 01-25-2017, 12:58 PM   #4
GrumpyGnome
Member
 
Registered: May 2004
Location: El Sobrante, CA (the scraps)
Distribution: Fedora, RH, & Slack
Posts: 57

Original Poster
Rep: Reputation: 15
Thank you both, the reason I didn't go to slackbuild is ignorance. I let slackware64-14.2-install-dvd.iso do a default install and did install tre using the defaults. I don't know Slackware very well; I'm helping a friend who uses Slackware recover some files. I had tried a search for scalpel and Slackware but missed slackbuild. Thanks for the details on the tre lib. I'll press on to slackbuild but also will study the config and make files I used to understand what went wrong.

A part of me wants to do this the hard way but I have not had time in the last 10 years to keep up with Linux. I am a Unix and Linux user from many decades ago as in when we had to write our own serial port drivers for printers and then rebuild the OS to install them.
Thank you for that help it is much appreciated.

Happy Trails from a shiny head with a fuzzy brain
 
Old 01-25-2017, 01:51 PM   #5
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by GrumpyGnome View Post
Thanks for the details on the tre lib. I'll press on to slackbuild but also will study the config and make files I used to understand what went wrong.
When configure checks for gnu libc compatible malloc, it writes a small program, called conftest.c, and builds it by running :
Code:
$ gcc -o conftest -g -O2   conftest.c -ltre -lpthread -lm  >&5
When the build fails, the variable ac_cv_func_malloc_0_nonnull is set to no, and thus, the option -Dmalloc=rpl_malloc is added to the scalpel compiler options. This is what happens when tre is not in any of the standard system directories. Snippet of config.log in this case :

Code:
...
configure:16673: checking for GNU libc compatible malloc
configure:16697: gcc -o conftest -g -O2   conftest.c -ltre -lpthread -lm  >&5
configure:16697: $? = 0
configure:16697: ./conftest
./conftest: error while loading shared libraries: libtre.so.5: cannot open shared object file: No such file or directory
configure:16697: $? = 127
configure: program exited with status 127

...
ac_cv_func_malloc_0_nonnull=no
...

DEFS='-DPACKAGE_NAME=\"scalpel\" -DPACKAGE_TARNAME=\"scalpel\"
-DPACKAGE_VERSION=\"2.0\" -DPACKAGE_STRING=\"scalpel\ 2.0\" 
-DPACKAGE_BUGREPORT=\"scalpel@digdeeply.com\" -DPACKAGE_URL=\"\" 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DLT_OBJDIR=\".libs/\" -DPACKAGE=\"scalpel\" -DVERSION=\"2.0\" 
-DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBTRE=1 -DHAVE_FCNTL_H=1 
-DHAVE_LIMITS_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
-DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_SYS_PARAM_H=1 
-DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMEB_H=1 -DHAVE_UNISTD_H=1 
-DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_FSEEKO=1 -DHAVE_STDLIB_H=1 
-DHAVE_MALLOC=0 -Dmalloc=rpl_malloc -DHAVE_STDLIB_H=1 
-DHAVE_REALLOC=0 -Drealloc=rpl_realloc -DHAVE_BZERO=1 
-DHAVE_GETTIMEOFDAY=1 -DHAVE_MKDIR=1 -DHAVE_REALPATH=1 -DHAVE_REGCOMP=1
-DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRNCASECMP=1 
-DHAVE_STRTOUL=1 -DHAVE_STRTOULL=1'
--
SeB
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error (undefined reference to `pow') while compiling a C code in terminal islam_assi Linux - Newbie 5 05-30-2013 08:43 AM
openssh compiling error Undefined symbol: .AES_encrypt LinuxLover AIX 3 09-17-2012 05:51 AM
[SOLVED] kernel compiling undefined reference error bahhti Programming 5 04-01-2010 11:00 PM
Error while compiling ecryptfs utils : undefined reference to `PK11_ImportSymKey' nitinarora Linux - Kernel 3 11-24-2009 04:21 AM
undefined reference to `rpl_malloc' madkris Linux - Software 5 10-02-2007 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration