From patchwork Mon Oct 28 02:22:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ruehl X-Patchwork-Id: 286394 X-Patchwork-Delegate: wd@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4650D2C00CE for ; Mon, 28 Oct 2013 13:21:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B7DC4A15C; Mon, 28 Oct 2013 03:21:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JNr54yIxER3a; Mon, 28 Oct 2013 03:21:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 965CF4A151; Mon, 28 Oct 2013 03:21:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F68A4A151 for ; Mon, 28 Oct 2013 03:21:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MsxO9U7uiRqE for ; Mon, 28 Oct 2013 03:21:11 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from fpa01n0.fpasia.hk (mail.fpasia.hk [202.130.89.98]) by theia.denx.de (Postfix) with ESMTP id 0B6B64A14A for ; Mon, 28 Oct 2013 03:21:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by fpa01n0.fpasia.hk (Postfix) with ESMTP id F20DFCC2ACF; Mon, 28 Oct 2013 10:20:58 +0800 (HKT) X-Virus-Scanned: FPASIA amavisd-new at fpasia.hk Received: from fpa01n0.fpasia.hk ([127.0.0.1]) by localhost (fpa01n0.office.fpa.com.hk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bt6+uCN3ZdOT; Mon, 28 Oct 2013 10:20:57 +0800 (HKT) Received: from s01.gtsys.com.hk (gtsnode.office.fpasia.hk [10.10.37.40]) by fpa01n0.fpasia.hk (Postfix) with ESMTP id 4C10BCFA1E8; Mon, 28 Oct 2013 10:20:57 +0800 (HKT) Received: from [192.168.10.46] (unknown [118.140.73.106]) by s01.gtsys.com.hk (Postfix) with ESMTPSA id 4795DC0274A; Mon, 28 Oct 2013 10:20:55 +0800 (HKT) Message-ID: <526DCA54.1050806@gtsys.com.hk> Date: Mon, 28 Oct 2013 10:22:12 +0800 From: Chris Ruehl User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: Wolfgang Denk References: <52671A0A.3020907@gtsys.com.hk> <1382865251-17302-1-git-send-email-wd@denx.de> <20131027200715.30C633811DD@gemini.denx.de> In-Reply-To: <20131027200715.30C633811DD@gemini.denx.de> Cc: Tom Rini , u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] JFFS2: Fix undefined reference to `__aeabi_uldivmod' error X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Wolfgang, good morning. On Monday, October 28, 2013 04:07 AM, Wolfgang Denk wrote: > In message <1382865251-17302-1-git-send-email-wd@denx.de> I wrote: >> Building boards that have JFFS2 support enabled will fail when using >> U-Boot's builtin GCC library, for example like this: >> >> USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm >> ... >> fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists': >> fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod' >> >> This is caused by a u64 / u32 division in jffs2_1pass.c; the problem >> can be avoided by using do_div() instead of plain division. >> >> Signed-off-by: Wolfgang Denk >> Reported-by: Chris Ruehl >> Cc: Chris Ruehl > I would like to withdraw this patch. > > It appears nobody has been running a MAKEALL with USE_PRIVATE_LIBGCC > enabled for a long, long time. There are a number of other places > that show similar problems. Instead of fixing these one by one, I > think we should rather bundle this. > > I'm working on a more complete patch (or patch series). > > Best regards, > > Wolfgang Denk > The test of your patch works with the linaro 2013.09 tool chain. I had to add the missing header only #include which is required for the build. cd /opt/cross_build/uboot.d/u-boot-git/spl/ && arm-linux-gnueabihf-ld.bfd -T /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl.lds --gc-sections --gc-sections -Bstatic -Ttext 0xa0000000 arch/arm/cpu/arm926ejs/start.o --start-group arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/mx27/libmx27.o arch/arm/imx-common/libimx-common.o arch/arm/lib/libarm.o board/gtsys/common/libgtsys.o board/gtsys/mx27gtsir/libmx27gtsir.o drivers/mtd/nand/libnand.o --end-group /opt/cross_build/uboot.d/u-boot-git/spl/arch/arm/lib/eabi_compat.o /opt/cross_build/uboot.d/u-boot-git/spl/arch/arm/lib/libgcc.o -Map u-boot-spl.map -o u-boot-spl arm-linux-gnueabihf-objcopy --gap-fill=0xff -O binary /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl.bin make[1]: Leaving directory `/opt/cross_build/uboot.d/u-boot-git/spl' arm-linux-gnueabihf-objcopy --gap-fill=0xff --pad-to=0x800 -I binary -O binary spl/u-boot-spl.bin spl/u-boot-spl-pad.bin; cat spl/u-boot-spl-pad.bin u-boot.bin > u-boot-with-spl.bin; rm spl/u-boot-spl-pad.bin Regards Chris Tested-by: Pekon Gupta diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index c856983..e6b50de 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -121,6 +121,7 @@ #include #include #include +#include #include "jffs2_private.h" @@ -1438,7 +1439,7 @@ jffs2_1pass_build_lists(struct part_info * part) { struct b_lists *pL; struct jffs2_unknown_node *node; - u32 nr_sectors = part->size/part->sector_size; + u32 nr_sectors = do_div(part->size,part->sector_size); u32 i; u32 counter4 = 0; u32 counterF = 0;