bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --enable-part-static


From: Andrew Clausen
Subject: Re: --enable-part-static
Date: Sun, 15 Dec 2002 08:57:43 +1100
User-agent: Mutt/1.4i

On Sat, Dec 14, 2002 at 10:59:48AM -0500, TenThumbs wrote:
> I see you know that it segfaults. It's actually the dynamic linker
> looping and running out of stack space. Parted never runs.
> 
> This is happening because you're linking the wrong way. You should be
> using -Bstatic to tell ld when to switch to static linking and -Bdynamic
> to switch back.
> 
> Here's a test script that illustrates the method.
> 
> #!/bin/sh
> /usr/new/gcc3.2.1/bin/gcc -g -Wall -W -O -D_REENTRANT  \
> -D_FILE_OFFSET_BITS=64 -DLOCALEDIR=\"/usr/share/locale\"  \
> -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wno-unused -Wno-switch  \
> -Wno-format -Werror -o parted command.o parted.o strlist.o ui.o  \
> ../libparted/.libs/libparted.a  \
> -Wl,-Bstatic -luuid -lreadline  -ldl -lncurses  -Wl,-Bdynamic  \
> "$@"
> 
> If you omit -Bdynamic then the implicit -lc will also be statically
> linked which may be a feature.

Ah, interesting.  Thanks for that!

Any ideas how to make that work with libtool/automake?

I guess I should stick these flags in parted_LDADD rather than
parted_LDFLAGS, so I can control the ordering.

I wonder if there are portability issues?  Not that we support
anything other than GNU[/Linux] ATM.

Cheers,
Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]