All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Watson <cjwatson@ubuntu.com>
To: grub-devel@gnu.org
Subject: Division clash between core and libgcc on ARM
Date: Wed, 13 Nov 2013 13:42:53 +0000	[thread overview]
Message-ID: <20131113134253.GL16147@riva.ucam.org> (raw)

  ./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]


             reply	other threads:[~2013-11-13 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 13:42 Colin Watson [this message]
2013-11-13 14:05 ` Division clash between core and libgcc on ARM Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13 14:47   ` Colin Watson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131113134253.GL16147@riva.ucam.org \
    --to=cjwatson@ubuntu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.