From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Thompson Date: Mon, 10 May 2010 11:39:03 +0100 Subject: [U-Boot] Building for da830 fails In-Reply-To: <4BE43218.2060209@freescale.com> References: <004001caeddc$719c30d0$54d49270$@raj@ti.com> <4BE42048.7000701@ge.com> <20100507151009.55582E8AAC9@gemini.denx.de> <4BE42FE9.3070208@psyent.com> <4BE43218.2060209@freescale.com> Message-ID: <4BE7E247.1030007@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/05/10 16:30, Timur Tabi wrote: > Scott McNutt wrote: >> lib/libgeneric.a(display_options.o): In function `print_size': >> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:66: undefined >> reference to `__udivdi3' >> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:69: undefined >> reference to `__umoddi3' >> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:70: undefined >> reference to `__udivdi3' > > Man, I knew ARM sucked, but I didn't know it was this bad :-) > > I was going to suggestion replacing the division operations with calls to > lldiv(), but we're actually doing a 64-by-64 bit division here: > > n = size / d; > > which means that in order to support support printing 64-bit numbers on ARM, > we might need to completely rewrite print_size() to avoid division on 64-bit > numbers. > > Wolfgang, do you have any suggestions? > I'm not sure if it is the correct way to "fix" this issue, But I have submitted a patch in "[U-Boot] [PATCH] Avoid use of divides in print_size." It allows ARM to rebuild again (here at least), but really it modifies the function to use bit shifts as an optimisation over calling lengthy div library functions. This side steps the linker issue. It you have chance to test or review it I would be grateful. I tested the code on x86 Linux PC, not by running it in U-Boot. Nick.