Patchwork [2,of,2] config/target.in+scripts/glibc-eglibc.sh-common: Allow building multilib gcc without full c library

login
register
mail settings
Submitter David Holsgrove
Date Sept. 19, 2012, 3:42 a.m.
Message ID <24e33e3717f8a740f7c6.1348026169@localhost.localdomain>
Download mbox | patch
Permalink /patch/184925/
State Rejected
Headers show

Comments

David Holsgrove - Sept. 19, 2012, 3:42 a.m.
# HG changeset patch
# User David Holsgrove <david.holsgrove@xilinx.com>
# Date 1348016531 -36000
# Node ID 24e33e3717f8a740f7c65a0d05a1bed51535c690
# Parent  95abeed3a485c4d5b02e4860fc554d6841e1cc41
config/target.in+scripts/glibc-eglibc.sh-common: Allow building multilib gcc without full c library

Add option to enable building a multilib aware gcc, without building out all the multilib combos
for the c library


--
For unsubscribe information see http://sourceware.org/lists.html#faq
Mike Frysinger - Sept. 19, 2012, 4:42 a.m.
On Tuesday 18 September 2012 23:42:49 David Holsgrove wrote:
> Add option to enable building a multilib aware gcc, without building out
> all the multilib combos for the c library

erm, gcc needs a multilib glibc in order to build its own multilibs (libgcc_s, 
libstdc++, etc...).  all of its shared libs get linked against glibc's shared 
libs, and i think it uses glibc's start objects too.

i'm not really sure what it is you're trying to do (since the stated 
description makes no sense), but if all you want is a gcc which can do code 
generation for all of its native targets, then it sounds like you want to pass 
--enable-targets=all.  for ppc/sparc/x86, this allows the compiler to 
simultaneously support things like -m32/-m64 (minus the libraries/start 
objects of course).
-mike
Yann E. MORIN - Sept. 19, 2012, 9:38 p.m.
David, All,

On Wednesday 19 September 2012 05:42:49 David Holsgrove wrote:
> # HG changeset patch
> # User David Holsgrove <david.holsgrove@xilinx.com>
> # Date 1348016531 -36000
> # Node ID 24e33e3717f8a740f7c65a0d05a1bed51535c690
> # Parent  95abeed3a485c4d5b02e4860fc554d6841e1cc41
> config/target.in+scripts/glibc-eglibc.sh-common: Allow building multilib gcc without full c library
> 
> Add option to enable building a multilib aware gcc, without building out all the multilib combos
> for the c library

As Mike stated, gcc needs the full set of C library combos to do the
actual link. So, it's not obvious why you are trying to disable those
combos.

Care to elaborate a bit on the use-case?

> diff -r 95abeed3a485 -r 24e33e3717f8 config/target.in
> --- a/config/target.in	Wed Sep 19 11:03:59 2012 +1000
> +++ b/config/target.in	Wed Sep 19 11:02:11 2012 +1000
> @@ -60,6 +60,20 @@
>        in gcc, so it is not possible to say what variants to support, only
>        whether hard-coded variants should be supported or not.
>  
> +if MULTILIB
> +
> +config MULTILIB_GCC_ONLY
> +    bool
> +    prompt "Disable building multilib combos of c-library"
> +    depends on EXPERIMENTAL
> +    depends on MULTILIB

This 'depends on MULTILIB' is redundant with the 'if MULTILIB', above.
Drop the 'if MULTILIB'.

> +    default n
> +    help
> +      If you say 'y' here, then gcc will be built with multi-lib support,
> +      but the eglibc/glibc multilib combos won't
> +
> +endif # MULTILIB
> +
>  #--------------------------------------
>  config ARCH_SUPPORTS_BOTH_MMU
>      bool
> diff -r 95abeed3a485 -r 24e33e3717f8 scripts/build/libc/glibc-eglibc.sh-common
> --- a/scripts/build/libc/glibc-eglibc.sh-common	Wed Sep 19 11:03:59 2012 +1000
> +++ b/scripts/build/libc/glibc-eglibc.sh-common	Wed Sep 19 11:02:11 2012 +1000
> @@ -103,7 +103,13 @@
>  
>      # If gcc is not configured for multilib, it still prints
>      # a single line for the default settings
> -    multilibs=( $("${CT_TARGET}-gcc" -print-multi-lib 2>/dev/null) )
> +    if [ "${CT_MULTILIB_GCC_ONLY}" = "y" ]; then
> +        CT_DoLog EXTRA "Building of multilib C library Disabled"
> +        multilibs=".;"

$multilibs is expected to be an array, not a string, so this should be:
    multilibs=( ".;" )

Regards,
Yann E. MORIN.
David Holsgrove - Sept. 21, 2012, 4:40 a.m.
Hi Yann / Mike, All,

On 20 September 2012 07:38, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> David, All,
>
> On Wednesday 19 September 2012 05:42:49 David Holsgrove wrote:
>> # HG changeset patch
>> # User David Holsgrove <david.holsgrove@xilinx.com>
>> # Date 1348016531 -36000
>> # Node ID 24e33e3717f8a740f7c65a0d05a1bed51535c690
>> # Parent  95abeed3a485c4d5b02e4860fc554d6841e1cc41
>> config/target.in+scripts/glibc-eglibc.sh-common: Allow building multilib gcc without full c library
>>
>> Add option to enable building a multilib aware gcc, without building out all the multilib combos
>> for the c library
>
> As Mike stated, gcc needs the full set of C library combos to do the
> actual link. So, it's not obvious why you are trying to disable those
> combos.
>
> Care to elaborate a bit on the use-case?

Thanks for the comments,

My reason for adding this locally was to replicate the toolchains we
produced in the era before crosstool-NG
had multi-lib building capability (and we had more external steps), by
essentially just passing --enable-multilib
to the gcc configure stage.

I used it more for rapidly building a pseudo-multilibed toolchain
(which has multilib versions of libgcc/libstdc++
etc, even if they were linked against a non multilibed c library) for
platform integration tests (eg correct
response to -print-multi-lib) as opposed to validity.

It also allowed me to side step an issue I've noticed with the C
library multilib loop where it created symlinks
to bridge the difference in where gcc / glibcs expects to install - if
we have nested multi_dirs (eg bs/m/mh),
the symlinks are broken. I've got a patch to propose which works for
me which I'll send on now for review.

In relation to this patch - please disregard - on second thoughts it
wont be useful to upstream :-)

thanks again,
David

[--SNIP--]

>
> 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.  |
> '------------------------------^-------^------------------^--------------------'
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Patch

diff -r 95abeed3a485 -r 24e33e3717f8 config/target.in
--- a/config/target.in	Wed Sep 19 11:03:59 2012 +1000
+++ b/config/target.in	Wed Sep 19 11:02:11 2012 +1000
@@ -60,6 +60,20 @@ 
       in gcc, so it is not possible to say what variants to support, only
       whether hard-coded variants should be supported or not.
 
+if MULTILIB
+
+config MULTILIB_GCC_ONLY
+    bool
+    prompt "Disable building multilib combos of c-library"
+    depends on EXPERIMENTAL
+    depends on MULTILIB
+    default n
+    help
+      If you say 'y' here, then gcc will be built with multi-lib support,
+      but the eglibc/glibc multilib combos won't
+
+endif # MULTILIB
+
 #--------------------------------------
 config ARCH_SUPPORTS_BOTH_MMU
     bool
diff -r 95abeed3a485 -r 24e33e3717f8 scripts/build/libc/glibc-eglibc.sh-common
--- a/scripts/build/libc/glibc-eglibc.sh-common	Wed Sep 19 11:03:59 2012 +1000
+++ b/scripts/build/libc/glibc-eglibc.sh-common	Wed Sep 19 11:02:11 2012 +1000
@@ -103,7 +103,13 @@ 
 
     # If gcc is not configured for multilib, it still prints
     # a single line for the default settings
-    multilibs=( $("${CT_TARGET}-gcc" -print-multi-lib 2>/dev/null) )
+    if [ "${CT_MULTILIB_GCC_ONLY}" = "y" ]; then
+        CT_DoLog EXTRA "Building of multilib C library Disabled"
+        multilibs=".;"
+    else
+        multilibs=( $("${CT_TARGET}-gcc" -print-multi-lib 2>/dev/null) )
+    fi
+
     for multilib in "${multilibs[@]}"; do
         multi_dir="${multilib%%;*}"
         if [ "${multi_dir}" != "." ]; then