diff mbox

[1,of,2] scripts/build/gcc.sh: When compiling a Canadian Cross avoid using -print-multi-lib

Message ID CAM=EW8aQDoNx-CkJHjXBoDP4iTDJ8z5hh3=KhO5UTU6rp3Pj=w@mail.gmail.com
State Accepted
Commit bcfcd68a4e0d
Headers show

Commit Message

David Holsgrove Oct. 4, 2012, 6:20 a.m. UTC
Hi Yann, All

On 20 September 2012 11:47, David Holsgrove <david.holsgrove@xilinx.com> wrote:
> Hi Yann, Mike, Ralf, All
>
> On 20 September 2012 06:57, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>>
>> David, All,
[SNIP]
>>
>> Unfortunately, that part also deals with the final compiler for bare
>> metal,
>> which we indeed can not run when it's canadian.
>>
>
> Yes, this is the reason for my change to the do_cc_core_backend as
> well as the do_cc_backend version of this print-multi-lib log output,
> my use cases are for canadian cross baremetal / canadian cross linux toolchains.
>
[SNIP]
>> Here, that's right. This is the part that deals with the final gcc for non
>> bare-metal. So we can only run it if its not canadian.
>>
>> >          multilibs=( $( "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc"
>> > -print-multi-lib \
>>                            ^^^^^^^^^^^^^^^^
>> There's a latent bug here --/      That should be ${prefix}
>>
>> I'll fix here.
>>

I've updated the patch to only skip the print-multi-lib log output for
baremetal canadian cross
on the final compiler stage, and both final compiler passes for linux
canadian crosses.

I also updated the CT_PREFIX_DIR to be ${prefix}.

>> So, do we still need to print the multilib status, after all?
>> Could we just remove that?

Or, would you prefer to remove the log out altogether? Updated patch
is as follows.

thanks,
David


# HG changeset patch
# User David Holsgrove <david.holsgrove@xilinx.com>
# Date 1349330371 -36000
# Node ID ce3b27420d90afb20a68a013669d5ef097c55477
# Parent  43ace4bb005eef085437e3d4fbaef528ef0ef005
scripts/gcc: Canadian Cross skip -print-multi-lib log output

Attempting to ${CT_TARGET}-gcc -print-multi-lib will fail

In do_cc_core_backend, for the final compiler in a canadian cross
baremetal, warn that multi-libs cannot be determined

In do_cc_backend, for either final compiler for a canadian cross,
warn that multi-libs cannot be determined

(Plus fixed CT_PREFIX_DIR in do_cc_backend to be ${prefix})

Signed-off-by: "David Holsgrove" <david.holsgrove@xilinx.com>

+            fi
         fi
     fi
 }
@@ -816,17 +821,21 @@
     CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}"
"${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}"

     if [ "${CT_MULTILIB}" = "y" ]; then
-        multilibs=( $( "${CT_PREFIX_DIR}/bin/${CT_TARGET}-gcc"
-print-multi-lib \
-                       |tail -n +2 ) )
-        if [ ${#multilibs[@]} -ne 0 ]; then
-            CT_DoLog EXTRA "gcc configured with these multilibs
(besides the default):"
-            for i in "${multilibs[@]}"; do
-                dir="${i%%;*}"
-                flags="${i#*;}"
-                CT_DoLog EXTRA "   ${flags//@/ -}  -->  ${dir}/"
-            done
+        if [ "${CT_CANADIAN}" = "y" ]; then
+            CT_DoLog WARN "Canadian Cross unable to confirm multilibs
configured correctly"
         else
-            CT_DoLog WARN "gcc configured for multilib, but none available"
+            multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib \
+                           |tail -n +2 ) )
+            if [ ${#multilibs[@]} -ne 0 ]; then
+                CT_DoLog EXTRA "gcc configured with these multilibs
(besides the default):"
+                for i in "${multilibs[@]}"; do
+                    dir="${i%%;*}"
+                    flags="${i#*;}"
+                    CT_DoLog EXTRA "   ${flags//@/ -}  -->  ${dir}/"
+                done
+            else
+                CT_DoLog WARN "gcc configured for multilib, but none available"
+            fi
         fi
     fi
 }

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

Comments

Yann E. MORIN Oct. 12, 2012, 9:51 p.m. UTC | #1
David, All,

Your patch:
    scripts/gcc: Canadian Cross skip -print-multi-lib log output

has been applied as #a6981147ccc0. Thank you!

Regards,
Yann E. MORIN.



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

Patch

diff -r 43ace4bb005e -r ce3b27420d90 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh	Wed Sep 26 16:37:31 2012 +0200
+++ b/scripts/build/cc/gcc.sh	Thu Oct 04 15:59:31 2012 +1000
@@ -461,17 +461,22 @@ 
     CT_DoExecLog ALL ln -sfv "${CT_TARGET}-gcc${ext}"
"${prefix}/bin/${CT_TARGET}-cc${ext}"

     if [ "${CT_MULTILIB}" = "y" ]; then
-        multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc" -print-multi-lib   \
-                       |tail -n +2 ) )
-        if [ ${#multilibs[@]} -ne 0 ]; then
-            CT_DoLog EXTRA "gcc configured with these multilibs
(besides the default):"
-            for i in "${multilibs[@]}"; do
-                dir="${i%%;*}"
-                flags="${i#*;}"
-                CT_DoLog EXTRA "   ${flags//@/ -}  -->  ${dir}/"
-            done
+        if [ "${CT_CANADIAN}" = "y" -a "${mode}" = "baremetal" \
+             -a "${host}" = "${CT_HOST}" ]; then
+            CT_DoLog WARN "Canadian Cross unable to confirm multilibs
configured correctly"
         else
-            CT_DoLog WARN "gcc configured for multilib, but none available"
+            multilibs=( $( "${prefix}/bin/${CT_TARGET}-gcc"
-print-multi-lib   \
+                           |tail -n +2 ) )
+            if [ ${#multilibs[@]} -ne 0 ]; then
+                CT_DoLog EXTRA "gcc configured with these multilibs
(besides the default):"
+                for i in "${multilibs[@]}"; do
+                    dir="${i%%;*}"
+                    flags="${i#*;}"
+                    CT_DoLog EXTRA "   ${flags//@/ -}  -->  ${dir}/"
+                done
+            else
+                CT_DoLog WARN "gcc configured for multilib, but none available"