grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Division clash between core and libgcc on ARM


From: Colin Watson
Subject: Division clash between core and libgcc on ARM
Date: Wed, 13 Nov 2013 13:42:53 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

  ./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                                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]