This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Dec 8, 2010 at 2:58 PM, Yann E. MORIN <yann.morin.1998@anciens.enib.fr> wrote: > Bryan, All, > > On Monday 18 October 2010 23:12:04 Bryan Hundven wrote: >> # HG changeset patch >> # User Bryan Hundven <bryanhundven@gmail.com> >> # Date 1287435325 25200 >> # Node ID fa5bd6f1ea1aa117771e4c53fefaba16ba603d82 >> # Parent Â8091950d99a8b10bbff4b7a35518380afeefc5f6 >> cc/gcc: add support for a statcally linked shared core for static toolchain > >> diff -r 8091950d99a8 -r fa5bd6f1ea1a scripts/build/cc/gcc.sh >> --- a/scripts/build/cc/gcc.sh Mon Oct 18 12:15:08 2010 -0700 >> +++ b/scripts/build/cc/gcc.sh Mon Oct 18 13:55:25 2010 -0700 >> @@ -66,9 +66,18 @@ >>     Ây,*,*) Âdo_cc_core mode=baremetal build_libgcc=yes build_libstdcxx=yes;; >>     Â,y,*)  ;; >>     Â,,nptl) >> -      Âdo_cc_core mode=shared build_libgcc=yes >> +      Âif [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then >> +        Âdo_cc_core mode=shared build_libgcc=yes build_staticlinked=yes >> +      Âelse >> +        Âdo_cc_core mode=shared build_libgcc=yes >> +      Âfi >>       Â;; >> -    Â,,win32) do_cc_core mode=static build_libgcc=yes >> +    Â,,win32) >> +      Âif [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then >> +        Âdo_cc_core mode=static build_libgcc=yes build_staticlinked=yes >> +      Âelse >> +        Âdo_cc_core mode=static build_libgcc=yes >> +      Âfi > > Unfortunately, you got it wrong: > > - when not bare-metal, the core pass 1 & 2 gcc are discarded, and only the > Âfinal gcc is part of the toolchain. And that is the final gcc we want to > Âbe statically linked. You got it right in your first patch. > > - but when doing bare-metal, the final gcc is coming from the core_cc_pass_2 > Â(yes, that's odd, but that's the way it goes). And that is that pass 2 gcc > Âwe want to be statically linked. > > Unfortunately, your patch #2 only builds static core gcc when not bare-metal. > So, for bare-metal (the first match in the case statement) the useful gcc > will never be statically linked. > > Don't worry, I've fixed this in my local copy. ;-) > >>       Â;; >>     Â*) Âif [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then >>         Âdo_cc_core mode=static build_libgcc=yes >> @@ -84,18 +93,20 @@ >> Â# This function is used to build both the static and the shared core C conpiler, >> Â# with or without the target libgcc. We need to know wether: >> Â# Â- we're building static, shared or bare metal: mode=[static|shared|baremetal] >> -# Â- we need to build libgcc or not       : build_libgcc=[yes|no]   (default: no) >> -# Â- we need to build libstdc++ or not     Â: build_libstdcxx=[yes|no] Â(default: no) >> -# Usage: do_cc_core_static mode=[static|shared|baremetal] build_libgcc=[yes|no] >> +# Â- we need to build libgcc or not       : build_libgcc=[yes|no]    (default: no) >> +# Â- we need to build libstdc++ or not     Â: build_libstdcxx=[yes|no]  Â(default: no) >> +# Â- we need to build statically linked or not Â: build_staticlinked=[yes|no] (default: no) >> +# Usage: do_cc_core mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no] >> Âdo_cc_core() { >>   Âlocal mode >>   Âlocal build_libgcc=no >>   Âlocal build_libstdcxx=no >> +  Âlocal build_staticlinked=no >>   Âlocal core_prefix_dir >>   Âlocal lang_opt >>   Âlocal tmp >>   Âlocal -a extra_config >> -  Âlocal core_LDFLAGS >> +  Âlocal -a core_LDFLAGS >>   Âlocal -a core_targets >> >>   Âwhile [ $# -ne 0 ]; do >> @@ -163,7 +174,12 @@ >>   Â# is needed. Shoe-horn it in our LDFLAGS >>   Â# Ditto libm on some Fedora boxen >>   Âif [ "${CT_COMPLIBS_SHARED}" != "y" ]; then >> -    Âcore_LDFLAGS='-lstdc++ -lm' >> +    Âif [ "${build_staticlinked}" = "yes" ]; then >> +      Âcore_LDFLAGS+=("-static") >> +      Âextra_config+=("--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++ -lm") >> +    Âfi >> +    Âcore_LDFLAGS+=("-lstdc++") >> +    Âcore_LDFLAGS+=("-lm") > > Well, not your fault, but this part of the code is incomplete. > I've fixed it as well. > > Regards, > Yann E. MORIN. > > -- > .-----------------.--------------------.------------------.--------------------. > | ÂYann E. MORIN Â| Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | > | +33 662 376 056 | Software ÂDesigner | \ / CAMPAIGN   | Â___        | > | +33 223 225 172 `------------.-------: ÂX ÂAGAINST   Â| Â\e/ ÂThere is no Â| > | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL  Â|  v  conspiracy. Â| > '------------------------------^-------^------------------^--------------------' > I'd love to see your patch. -- Bryan Hundven bryanhundven@gmail.com -- For unsubscribe information see http://sourceware.org/lists.html#faq
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |