Bug 10380 - cannot build binutils statically
Summary: cannot build binutils statically
Status: RESOLVED WORKSFORME
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-09 16:50 UTC by booleandomain
Modified: 2009-07-14 07:42 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments
Document use of LDFLAGS="--static" (567 bytes, patch)
2009-07-14 07:41 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description booleandomain 2009-07-09 16:50:12 UTC
I'm trying to build binutils-2.19.1 statically. I tried with
../binutils-2.19.1/configure LDFLAGS="-static" && make but I get:

ldd binutils/ar
linux-vdso.so.1 =>  (0x00007fffaf9ff000)
libz.so.1 => /lib/libz.so.1 (0x00007fe1a223d000)
libc.so.6 => /lib/libc.so.6 (0x00007fe1a1ee2000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe1a2453000)

This procedure works for all other packages I'm trying to compile (gcc, bash,
...) but it seems not to work for binutils. Why? Is there perhaps another way to
accomplish this? I also tried reading ./configure --help, README and
binutils/README but there is no useful information.
Comment 1 Nick Clifton 2009-07-10 15:17:44 UTC
Subject: Re:  New: cannot build binutils statically

Hi,

> I'm trying to build binutils-2.19.1 statically. I tried with
> ../binutils-2.19.1/configure LDFLAGS="-static" && make but I get:

Try adding a second dash.  ie:

   ../binutils-2.19.1/configure LDFLAGS="--static" && make

Cheers
   Nick

Comment 2 booleandomain 2009-07-10 16:01:25 UTC
It seems to work, thanks. But why do I need --static while all other packages
(gmp, mpfr, bash, ...) work with -static? Also, I think there should be a
document either in binutils sources or on the binutils homepage that explains
how to build binutils statically.
Comment 3 Andreas Schwab 2009-07-10 18:24:46 UTC
binutils uses libtool, and libtool uses -all-static instead.
Comment 4 H.J. Lu 2009-07-13 16:16:08 UTC
Works with LDFLAGS="--static".
Comment 5 Nick Clifton 2009-07-14 07:41:40 UTC
Created attachment 4051 [details]
Document use of LDFLAGS="--static"
Comment 6 Nick Clifton 2009-07-14 07:42:39 UTC
Hi,

  I take your point about documenting the use of LDFLAGS="--static", so I am
going to apply the uploaded patch to the sources.

Cheers
  Nick
Comment 7 Sourceware Commits 2009-07-14 07:43:36 UTC
Subject: Bug 10380

CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2009-07-14 07:43:19

Modified files:
	binutils       : ChangeLog README 

Log message:
	PR 10380
	* README: Document use of LDFLAGS="--static".

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1495&r2=1.1496
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/binutils/README.diff?cvsroot=src&r1=1.8&r2=1.9