From: Arnaud Lacombe <lacombar@gmail.com>
To: crossgcc@sourceware.org
Subject: Re: Building a static toolchain ?
Date: Mon, 05 Apr 2010 00:31:00 -0000 [thread overview]
Message-ID: <l2n1a69a9d81004041730z9289d7f0x5c662a190d5a39bf@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
Hi,
[sorry to break the thread, I'm not yet subscribed to the list]
Marc Kleine-Budde wrote:
>Dimitry Andric wrote:
>> On 2010-03-31 23:25, Yann E. MORIN wrote:
>>>> - make sure any extra dependencies, usually libgmp and/or libmpfr,
>>>> *are* statically linked into the toolchain executables, since not
>>>> everybody will have those as .so files on their system, or may have
>>>> different, incompatible versions.
>>>
>>> Yes, and those *I* was not able to properly build statically (yet!)...
>>> :-(
>>
>> For that, I use something like the attached patch, which should apply
>> cleanly to gcc 4.3.3, but most likely also to later versions.
>
>Why bother to patch gcc. Just ./configure the mpfr and friends with
>"--enable-static --disable-shared". Works like charm here.
Yes, I just build a i486/GCC 4.4.3/uclibc 0.9.31 that way, see the
attached patch. These is just a nasty hack to fix gcc link (ppl needs
libstdc++, which is not used automatically when gcc is called ()).
--enable-static was not needed in my case, but may solve the stdc++
crap... I'll give it a try.
The reason I need that is to get rid of the wrapper logic which
doesn't play nice on non GNU system.
- Arnaud
[-- Attachment #2: 0001-static-companion-libs.patch --]
[-- Type: application/octet-stream, Size: 7322 bytes --]
From 41b77c9e245aa6740936b1eed92eff5a687b265d Mon Sep 17 00:00:00 2001
From: Arnaud Lacombe <lacombar@gmail.com>
Date: Sun, 4 Apr 2010 20:17:34 -0400
Subject: [PATCH] static companion libs
---
config/companion_libs.in | 6 ------
scripts/build/cc/gcc.sh | 2 ++
scripts/build/companion_libs/cloog.sh | 2 +-
scripts/build/companion_libs/gmp.sh | 2 +-
scripts/build/companion_libs/libelf.sh | 4 ++--
scripts/build/companion_libs/mpc.sh | 2 +-
scripts/build/companion_libs/mpfr.sh | 2 +-
scripts/build/companion_libs/ppl.sh | 2 +-
8 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/config/companion_libs.in b/config/companion_libs.in
index 64cf138..e93386d 100644
--- a/config/companion_libs.in
+++ b/config/companion_libs.in
@@ -17,7 +17,6 @@ config WRAPPER_NEEDED
config GMP
bool
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc 4.3.0 and above requires GMP to build some frontends, and some
other components can use them as well.
@@ -35,7 +34,6 @@ config MPFR
bool
select GMP
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc 4.3.0 and above requires MPFR to build some frontends, and some
other components can use them as well.
@@ -54,7 +52,6 @@ config PPL
select GMP
select MPFR
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc-4.4.0 and above requires PPL to build some parts of the optimiser
(the GRAPHITE loop optimisation, to be precise).
@@ -69,7 +66,6 @@ config CLOOG
select MPFR
select PPL
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc-4.4.0 and above requires CLooG/PPL to build some parts of the
optimiser (the GRAPHITE loop optimisation, to be precise).
@@ -85,7 +81,6 @@ config MPC
select PPL
select CLOOG
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc-4.4.0 and above can also optionally use MPC to enable additional
optimisations on complex numbers. Although MPC is optional,
@@ -98,7 +93,6 @@ config MPC
config LIBELF
bool
select COMPLIBS
- select WRAPPER_NEEDED
help
gcc-4.5.0 and above can also use libelf to enable some optimisation
(LTO, Link-Time Optimisation, to be precise). Although libelf is
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index f4cf7cb..6dc97e4 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -165,6 +165,7 @@ do_cc_core() {
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ LDFLAGS="-lstdc++" \
CT_DoExecLog ALL \
"${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \
--build=${CT_BUILD} \
@@ -330,6 +331,7 @@ do_cc() {
# embedded systems don't really need message catalogs...
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ LDFLAGS="-lstdc++" \
CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
index f2e0f0f..b10f47f 100644
--- a/scripts/build/companion_libs/cloog.sh
+++ b/scripts/build/companion_libs/cloog.sh
@@ -57,7 +57,7 @@ do_cloog() {
--prefix="${CT_PREFIX_DIR}" \
--with-gmp="${CT_PREFIX_DIR}" \
--with-ppl="${CT_PREFIX_DIR}" \
- --enable-shared \
+ --disable-shared \
--disable-static \
--with-bits=gmp
diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh
index 731838e..deee6c1 100644
--- a/scripts/build/companion_libs/gmp.sh
+++ b/scripts/build/companion_libs/gmp.sh
@@ -38,7 +38,7 @@ do_gmp() {
--build=${CT_BUILD} \
--host=${CT_HOST} \
--prefix="${CT_PREFIX_DIR}" \
- --enable-shared \
+ --disable-shared \
--disable-static \
--enable-fft \
--enable-mpbsd \
diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh
index ecda8ff..54e7407 100644
--- a/scripts/build/companion_libs/libelf.sh
+++ b/scripts/build/companion_libs/libelf.sh
@@ -72,9 +72,9 @@ do_libelf_target() {
--prefix=/usr \
--enable-compat \
--enable-elf64 \
- --enable-shared \
+ --disable-shared \
+ --disable-static \
--enable-extended-format \
- --enable-static
CT_DoLog EXTRA "Building libelf"
CT_DoExecLog ALL make
diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh
index 796e798..6d9bed3 100644
--- a/scripts/build/companion_libs/mpc.sh
+++ b/scripts/build/companion_libs/mpc.sh
@@ -37,7 +37,7 @@ do_mpc() {
--prefix="${CT_PREFIX_DIR}" \
--with-gmp="${CT_PREFIX_DIR}" \
--with-mpfr="${CT_PREFIX_DIR}" \
- --enable-shared \
+ --disable-shared \
--disable-static \
CT_DoLog EXTRA "Building MPC"
diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh
index 12fe125..08ff7fe 100644
--- a/scripts/build/companion_libs/mpfr.sh
+++ b/scripts/build/companion_libs/mpfr.sh
@@ -90,7 +90,7 @@ do_mpfr() {
--host=${CT_HOST} \
--prefix="${CT_PREFIX_DIR}" \
${mpfr_opt} \
- --enable-shared \
+ --disable-shared \
--disable-static \
--with-gmp="${CT_PREFIX_DIR}"
diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh
index 15312f0..d8d2e6d 100644
--- a/scripts/build/companion_libs/ppl.sh
+++ b/scripts/build/companion_libs/ppl.sh
@@ -40,7 +40,7 @@ do_ppl() {
--prefix="${CT_PREFIX_DIR}" \
--with-libgmp-prefix="${CT_PREFIX_DIR}" \
--with-libgmpxx-prefix="${CT_PREFIX_DIR}" \
- --enable-shared \
+ --disable-shared \
--disable-static \
--disable-debugging \
--disable-assertions \
--
1.7.0.rc2.16.g99c03.dirty
[-- Attachment #3: Type: text/plain, Size: 71 bytes --]
--
For unsubscribe information see http://sourceware.org/lists.html#faq
next reply other threads:[~2010-04-05 0:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 0:31 Arnaud Lacombe [this message]
2010-04-10 10:50 ` Yann E. MORIN
2010-04-10 17:10 ` Arnaud Lacombe
2010-04-10 17:20 ` Yann E. MORIN
2010-04-10 17:28 ` Yann E. MORIN
2010-04-10 21:35 ` Yann E. MORIN
-- strict thread matches above, loose matches on Subject: below --
2010-03-23 17:46 M P
2010-03-24 19:44 ` Yann E. MORIN
2010-03-24 20:04 ` Josh Henderson
2010-03-25 22:24 ` Yann E. MORIN
2010-03-31 20:37 ` Trevor Woerner
2010-03-31 20:50 ` Dimitry Andric
2010-03-31 21:08 ` Trevor Woerner
2010-03-31 21:18 ` Josh Henderson
2010-03-31 21:22 ` Khem Raj
2010-03-31 21:23 ` Trevor Woerner
2010-03-31 21:31 ` Yann E. MORIN
2010-03-31 21:26 ` Yann E. MORIN
2010-04-01 9:43 ` Dimitry Andric
2010-04-01 18:53 ` Khem Raj
2010-04-01 19:05 ` Marc Kleine-Budde
2010-04-01 20:29 ` Dimitry Andric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=l2n1a69a9d81004041730z9289d7f0x5c662a190d5a39bf@mail.gmail.com \
--to=lacombar@gmail.com \
--cc=crossgcc@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).