help-bash
[Top][All Lists]
Advanced

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

Re: in bash devel tree , how to make it build static bash


From: Emanuele Torre
Subject: Re: in bash devel tree , how to make it build static bash
Date: Fri, 30 Jun 2023 19:52:04 +0200
User-agent: Mutt/2.2.10 (2023-03-25)

On Fri, Jun 30, 2023 at 12:35:32PM -0400, Chet Ramey wrote:
> On 6/29/23 6:32 PM, Emanuele Torre wrote:
> > On Fri, Jun 30, 2023 at 12:10:28AM +0200, alex xmb ratchev wrote:
> > > .. whats the right way to produce a static bash build ?
> > 
> >    $ ./configure --enable-static-link LDFLAGS=-static
> 
> The LDFLAGS assignment shouldn't be necessary.

It is necessary. For some reason, --enable-static-link does not add
-static to LDFLAGS on linux when using GCC even though it is required:

  if test "$opt_static_link" = yes; then
        prefer_static=yes
        prefer_shared=no
        # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2
        if test "$GCC" = "yes"; then
                STATIC_LD="-static" 
                case "$host_os" in
                solaris2*|linux*)       ;;
                *)              LDFLAGS="$LDFLAGS -static" ;;   # XXX 
experimental
                esac
        fi
  fi


This change was introduced in 216e2e9b8 (2016-11-12) with this
comment:

 configure.ac
        - changes to make --enable-profiling work on Linux (-pg, no static link,
          no -static in LDFLAGS)

o/
 emanuele6



reply via email to

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