LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2005, 11:19 AM   #1
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Rep: Reputation: 30
Error in make bash with static-link


bash-3.0

./configure --enable-static-link --enable-minimal-config

This causes an error when I run make. But, not when I leave out the option --enable-static-link.

It appears that malloc and realloc are both being redefined when it throws up the error. I don't get any error at all if I leave off that option, but I'm trying to make a small version of bash for a floppy.

I'm afraid my expertise is limited on compiling and I'm just trying to run some examples to learn more. Any help is appreciated. Google is not my friend in this case.
 
Old 08-07-2005, 04:07 AM   #2
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Can you help us help you by giving us the error text you're seeing?
 
Old 08-07-2005, 06:34 PM   #3
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Original Poster
Rep: Reputation: 30
Code:
gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -static -static -rdynamic  -g -O2 -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o nojobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o bashline.o  list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lsh    -lglob -ltilde -lmalloc   
./lib/tilde/libtilde.a(tilde.o)(.text+0x20c): In function `tilde_expand_word':
/home/kurran/src/bash-3.0/lib/tilde/tilde.c:350: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
shell.o(.text+0x5d): In function `get_current_user_info':
/home/kurran/src/bash-3.0/shell.c:1580: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
shell.o(.text+0x10e):/home/kurran/src/bash-3.0/shell.c:1596: warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../libc.a(malloc.o)(.text+0x1b30): In function `__libc_free':
/usr/src/packages/BUILD/glibc-2.3/malloc/malloc.c:3360: multiple definition of `free'
./lib/malloc/libmalloc.a(malloc.o)(.text+0x360):/home/kurran/src/bash-3.0/lib/malloc/malloc.c:1209: first defined here
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `free' changed from 23 in ./lib/malloc/libmalloc.a(malloc.o) to 165 in ./lib/malloc/libmalloc.a(malloc.o)
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../libc.a(malloc.o)(.text+0x3990): In function `__libc_malloc':
/usr/src/packages/BUILD/glibc-2.3/malloc/malloc.c:3318: multiple definition of `malloc'
./lib/malloc/libmalloc.a(malloc.o)(.text+0xb80):/home/kurran/src/bash-3.0/lib/malloc/malloc.c:1194: first defined here
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `malloc' changed from 23 in ./lib/malloc/libmalloc.a(malloc.o) to 412 in ./lib/malloc/libmalloc.a(malloc.o)
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../libc.a(malloc.o)(.text+0x3ed0): In function `__libc_realloc':
/usr/src/packages/BUILD/glibc-2.3/malloc/malloc.c:3403: multiple definition of `realloc'
./lib/malloc/libmalloc.a(malloc.o)(.text+0xe10):/home/kurran/src/bash-3.0/lib/malloc/malloc.c:1202: first defined here
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `realloc' changed from 31 in ./lib/malloc/libmalloc.a(malloc.o) to 472 in ./lib/malloc/libmalloc.a(malloc.o)
collect2: ld returned 1 exit status
make: *** [bash] Error 1
 
Old 08-10-2005, 12:22 PM   #4
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Original Poster
Rep: Reputation: 30
I have added the error text.
 
Old 10-11-2005, 08:50 PM   #5
jarraneil
LQ Newbie
 
Registered: Oct 2005
Distribution: fedora core3
Posts: 8

Rep: Reputation: 0
Did you ever get a reply to this? I am seeing the same problem when trying to run through the first chapter of PocketLinux. I can not get bash to compile with the --enable-static-link option
 
Old 10-20-2005, 03:14 AM   #6
reup
LQ Newbie
 
Registered: Aug 2003
Location: Eindhoven, The Netherlands
Distribution: Ubuntu Breezy Badger
Posts: 2

Rep: Reputation: 0
I've had the same issue. With both bash-2.0.5a and 3.0 I couldn't compile with --enable-static-link. (The distro I'm using is Ubuntu Breezy Badger, btw). I tried compiling without statically linking and that works fine. I patched the 3.0-source with the 15 or so patches available and though it seems the process goes on longer, it still won't build...
Anyone a suggestion

Last edited by reup; 10-20-2005 at 03:17 AM.
 
Old 10-21-2005, 10:19 PM   #7
jarraneil
LQ Newbie
 
Registered: Oct 2005
Distribution: fedora core3
Posts: 8

Rep: Reputation: 0
It seems that this is a known problem with certain distributions; I use Fedora Core 3. I did see mention somewhere that it could be down to a difference in compilers but I suspect that may be clutching at straws. I know it seems like admitting failure but the best option may be to forget it and move onto the next chapter, where the first thing you do is compile bash without the static links and for me this worked fine.
 
Old 02-25-2006, 12:53 AM   #8
marauder133
LQ Newbie
 
Registered: Apr 2005
Location: India
Distribution: SuSE 10.0(with KDE 3.5)
Posts: 8

Rep: Reputation: 0
use this option with configure

--without-bash-malloc

For example,

./configure --enable-static-link --enable-minimal-config --without-bash-malloc

This is because of comflict with malloc in C library and also in bash... or so i read.
 
  


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
problem when trying to static link with gcc glvgfz Programming 11 09-18-2005 07:58 PM
Binutils Pass 1 error make LDFLAGS="-all-static" Phyrexicaid Linux From Scratch 5 08-25-2005 10:43 AM
lfs-6.1 Bash-3.0 [make test]log:could be error to continue?? ukyo Linux From Scratch 2 08-25-2005 07:35 AM
make: *** [insmod.static] Error 1 _InTeNsDoWn_ Linux From Scratch 1 08-09-2005 01:47 PM
Smart Link Modem, error running make, I dont want a newbs help randyriver10 Mandriva 0 03-05-2004 03:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:06 AM.

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