I could introduce a story... some facts is that have recently needed to
toole myself with static cross compiled binaries for some other - non amd64
- architecture. This included `strace`, several programs from the
`valgrind` suite and even the naivité of `cpulimit`. In part trying for a
quicker development process I decided - I think successfully - to drop
dynamic loading. This tooling set was to be used over a bare kernel,
complimenting the `busybox`. I saw the bare kernel as an additional
prompting to use only static whenever storage and speed allowed it.

But as earlier written, this current question is purely for joy. I was
finding in `aptitude` that all precompiled shells where available also as
static, with the notable exception of `fish`. Also saw a potential easy
contribution on the bottomright corner of the first table in
http://en.wikipedia.org/wiki/Comparison_of_shells. But me as a junior
machines operator am not even fully fish-compatible, so don't really mind
the question at all.

Getting back to the question, I suppose that in a serious need of this, my
next step would have been to dive the 'configure' script, and I honestly
thank the tips about $LIBS and the live load of dynamic libraries.

*****


2013/11/8 David Adam <zanc...@ucc.gu.uwa.edu.au>

> On Thu, 7 Nov 2013, uxio prego wrote:
> > Hallo, I just did
> >
> > $ ./configure
> > checking if autoconf needs to be run... no
> > ...
> > Use 'make' and 'make install' to build and install fish.
> > $
> >
> > But then I wanted to get a static version just to amuse myself, so did:
>
> I'm not sure that this is a use-case we support!
>
> > $ CXXFLAGS=-static LDFLAGS=-Bstatic ./configure
> > checking libintl.h usability... yes
> > checking if autoconf needs to be run... no
> > ...
> > configure: error: Could not find a curses implementation, needed to
> > build fish. If this is Linux, try running 'sudo apt-get install li
> > bncurses5-dev' or 'sudo yum install ncurses-devel' $
> >
> > How am supposed to configure fish to get a static executable doc?
>
> If you're compiling statically, you have to do the entire dependency chain
> yourself. ncurses pulls in libtermcap, so normally this would be by adding
> "LIBS=-ltermcap" to the arguments to configre. Unforutnately, our
> configure script does something a bit funky with the $LIBS stuff so this
> doesn't work.
>
> I've fixed this in a commit I'll push, but even then statically linking
> fish is not a great idea - we call e.g. getpwent() and getpwnam(), and
> those will load (through NSS) dynamic libraries depending on system
> configuration.
>
> See, e.g.
>
> http://stackoverflow.com/questions/11654143/statically-linking-system-libraries-libc-pthreads-to-aid-in-debugging
>
> Is there a good requirement for static linking?
>
> David Adam
> fish committer
> zanc...@ucc.gu.uwa.edu.au
>
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to