All of lore.kernel.org
 help / color / mirror / Atom feed
* Division clash between core and libgcc on ARM
@ 2013-11-13 13:42 Colin Watson
  2013-11-13 14:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 4+ messages in thread
From: Colin Watson @ 2013-11-13 13:42 UTC (permalink / raw)
  To: grub-devel

  ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --with-platform=uboot

This fails with:

  arm-linux-gnueabihf-gcc -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wcast-align -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition       -o grub-script-check util/grub_script_check-grub-script-check.o grub-core/kern/emu/grub_script_check-argp_common.o grub-core/osdep/grub_script_check-init.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a
  arm-linux-gnueabihf-gcc -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wcast-align -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition       -o grub-editenv util/grub_editenv-grub-editenv.o util/grub_editenv-editenv.o grub-core/osdep/grub_editenv-init.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a
  /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
  (.text+0x0): multiple definition of `__udivsi3'
  libgrubkern.a(libgrubkern_a-misc.o):misc.c:(.text+0xa3c): first defined here
  /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
  (.text+0x0): multiple definition of `__aeabi_uidiv'
  libgrubkern.a(libgrubkern_a-misc.o):misc.c:(.text+0xa3c): first defined here
  collect2: error: ld returned 1 exit status

I don't think we should redirect divisions when building userspace
utilities; it would be simpler to just let libgcc handle them in those
cases.  How does this look?

        * grub-core/kern/misc.c: Don't redirect divisions in the
        GRUB_UTIL case.

diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 8b771a5..194e770 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -596,6 +596,8 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
   return q;
 }
 
+#ifndef GRUB_UTIL
+
 #if defined (__arm__)
 
 grub_uint32_t
@@ -639,6 +641,8 @@ __umoddi3 (grub_uint64_t a, grub_uint64_t b)
 
 #endif
 
+#endif /* GRUB_UTIL */
+
 /* Convert a long long value to a string. This function avoids 64-bit
    modular arithmetic or divisions.  */
 static char *

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Division clash between core and libgcc on ARM
  2013-11-13 13:42 Division clash between core and libgcc on ARM Colin Watson
@ 2013-11-13 14:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-13 14:05 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 4165 bytes --]

On 13.11.2013 14:42, Colin Watson wrote:
>   ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --with-platform=uboot
> 
> This fails with:
> 
>   arm-linux-gnueabihf-gcc -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wcast-align -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreach
able-code -Wno-conversion -Wno-old-style-definition       -o grub-script-check util/grub_script_check-grub-script-check.o grub-core/kern/emu/grub_script_check-argp_common.o grub-core/osdep/grub_script_check-init.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a
>   arm-linux-gnueabihf-gcc -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wcast-align -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreach
able-code -Wno-conversion -Wno-old-style-definition       -o grub-editenv util/grub_editenv-grub-editenv.o util/grub_editenv-editenv.o grub-core/osdep/grub_editenv-init.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a
>   /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
>   (.text+0x0): multiple definition of `__udivsi3'
>   libgrubkern.a(libgrubkern_a-misc.o):misc.c:(.text+0xa3c): first defined here
>   /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
>   (.text+0x0): multiple definition of `__aeabi_uidiv'
>   libgrubkern.a(libgrubkern_a-misc.o):misc.c:(.text+0xa3c): first defined here
>   collect2: error: ld returned 1 exit status
> 
> I don't think we should redirect divisions when building userspace
> utilities; it would be simpler to just let libgcc handle them in those
> cases.  How does this look?
> 
good
go ahead
>         * grub-core/kern/misc.c: Don't redirect divisions in the
>         GRUB_UTIL case.
> 
> diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
> index 8b771a5..194e770 100644
> --- a/grub-core/kern/misc.c
> +++ b/grub-core/kern/misc.c
> @@ -596,6 +596,8 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
>    return q;
>  }
>  
> +#ifndef GRUB_UTIL
> +
>  #if defined (__arm__)
>  
>  grub_uint32_t
> @@ -639,6 +641,8 @@ __umoddi3 (grub_uint64_t a, grub_uint64_t b)
>  
>  #endif
>  
> +#endif /* GRUB_UTIL */
> +
>  /* Convert a long long value to a string. This function avoids 64-bit
>     modular arithmetic or divisions.  */
>  static char *
> 
> Thanks,
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Division clash between core and libgcc on ARM
  2013-11-13 13:42 Division clash between core and libgcc on ARM Colin Watson
  2013-11-13 14:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-13 14:47   ` Colin Watson
  1 sibling, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-13 14:08 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

On 13.11.2013 14:42, Colin Watson wrote:
> How does this look?
> 
>         * grub-core/kern/misc.c: Don't redirect divisions in the
>         GRUB_UTIL case.
You also need similar adjustment to misc.h


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Division clash between core and libgcc on ARM
  2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-13 14:47   ` Colin Watson
  0 siblings, 0 replies; 4+ messages in thread
From: Colin Watson @ 2013-11-13 14:47 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Nov 13, 2013 at 03:08:35PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 13.11.2013 14:42, Colin Watson wrote:
> >         * grub-core/kern/misc.c: Don't redirect divisions in the
> >         GRUB_UTIL case.
> 
> You also need similar adjustment to misc.h

Good catch, thanks.  Committed.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-13 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 13:42 Division clash between core and libgcc on ARM Colin Watson
2013-11-13 14:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13 14:47   ` Colin Watson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.