From: adam hussein(!) <kryme76@yahoo.com>
To: buildroot@busybox.net
Subject: [Buildroot] libgcc erroneously built as armv5 for arm920t(armv4t)
Date: Fri, 27 Sep 2013 04:23:04 -0700 (PDT) [thread overview]
Message-ID: <1380280984.22189.YahooMailNeo@web162203.mail.bf1.yahoo.com> (raw)
In-Reply-To: <20130926175221.GC3418@free.fr>
>In crosstool-Ng, we have this:
>? ? http://crosstool-ng.org/hg/crosstool-ng/annotate/98b7806295cc/patches/gcc/4.4.5/210-arm-unbreak-armv4t.patch#l1
>
>For gcc, if --with-cpu is not specified, then it defaults to
>TARGET_CPU_arm10tdmi which is an armv5 (as far as I understand it).
>
>The patch above downgrades the default CPU to an armv4t. Maybe worth a
>try. That, or passing --with-cpu=... as suggested by Adam.
Hi,
I have got a similar patch in:
??? package/gcc/4.7.3/830-arm_unbreak_armv4t.patch
...to edit SUBTARGET_CPU_DEFAULT to use arm9tdmi instead of the arm5t arm10tdmi
core.
The file affected, gcc/config/arm/linux-eabi.h, has no equivalent to set the architecture to arm4t as default.
I wonder if libgcc has no translation from the cpu/core to the architecture.
Following back from the __udivsi3 libgcc function...
My exception was at:
??? 20127a2c:??? e16f3f10 ??? clz??? r3, r0
which is in:
??? 20127a10 <__udivsi3>:
u-boot.map states:
???? .text????????? 0x20127a10????? 0x20c /opt/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_udivsi3.o)
then in ../buildroot-2013.08.1/output/build/host-gcc-final-4.7.3/build/arm-buildroot-linux-uclibcgnueabi/libgcc/_udivsi3.dep
??? _udivsi3.o: ../../../libgcc/config/arm/lib1funcs.S _udivsi3.vis \
???????????????????? ../../../libgcc/config/arm/ieee754-df.S \
???????????????????? ../../../libgcc/config/arm/ieee754-sf.S \
???????????????????? ../../../libgcc/config/arm/bpabi.S
The assembler code at the start:
??? 20127a10 <__udivsi3>:
??? 20127a10:??? e2512001 ??? subs??? r2, r1, #1??? ; 0x1
??? 20127a14:??? 012fff1e ??? bxeq??? lr
??? 20127a18:??? 3a000074 ??? bcc??? 20127bf0 <__udivsi3+0x1e0>
??? 20127a1c:??? e1500001 ??? cmp??? r0, r1
??? 20127a20:??? 9a00006b ??? bls??? 20127bd4 <__udivsi3+0x1c4>
??? 20127a24:??? e1110002 ??? tst??? r1, r2
????20127a28:??? 0a00006c ??? beq??? 20127be0 <__udivsi3+0x1d0>
matches an available version(within "#else /* ARM version/Thumb-2.? */")
This then uses the macro ARM_DIV_BODY, which sure enough gives the CLZ containing options.
??? .macro ARM_DIV_BODY dividend, divisor, result, curbit
???
??? #if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
???
??? #if defined (__thumb2__)
??????????? clz???? \curbit, \dividend
??????????? clz???? \result, \divisor
??? ...
??? #else
??????????? clz???? \curbit, \dividend
??????????? clz???? \result, \divisor
??? ...
??? #endif
???
??? #else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
??? #if __ARM_ARCH__ >= 5
???
??????????? clz???? \curbit, \divisor
??????????? clz???? \result, \dividend
??? ...
??? #else /* __ARM_ARCH__ < 5 */
??? ...
So, we clearly have __ARM_ARCH__ >= 5.
The value of this is defined at the beginning of the same file, in the absense of any of:
??? __ARM_ARCH_2__,
??? __ARM_ARCH_3__,
??? __ARM_ARCH_3M__,
??? __ARM_ARCH_4__ or
??? __ARM_ARCH_4T__
..being defined.
I notice with a 'grep -r "__ARM_ARCH_" *" that 'libffi' does something similar.
But, I can't find where this is set.
Or rather, I don't think it is set in one piece.
The file:
??? gcc/config/arm/arm-cores.def
..seems to be a bridge from 'arm9tdmi', specifying '4T', presumably to append make up __ARM_ARCH_4T__
But the construction of this I unfortunately cannot find.
Any of this jog a memory?
Cheers,
Adam
next prev parent reply other threads:[~2013-09-27 11:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-26 15:34 [Buildroot] libgcc erroneously built as armv5 for arm920t(armv4t) adam hussein
2013-09-26 15:54 ` Thomas Petazzoni
2013-09-26 17:52 ` Yann E. MORIN
2013-09-27 7:31 ` Thomas Petazzoni
2013-09-27 11:23 ` adam hussein [this message]
2013-09-26 19:00 ` Peter Korsgaard
2013-11-02 15:39 ` Thomas Petazzoni
2013-11-07 19:31 ` Thomas Petazzoni
2013-11-21 14:56 ` adam hussein
2013-11-21 15:22 ` Thomas Petazzoni
2013-11-21 16:07 ` adam hussein
2013-11-21 16:12 ` Thomas Petazzoni
2013-12-26 21:57 ` Yann E. MORIN
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=1380280984.22189.YahooMailNeo@web162203.mail.bf1.yahoo.com \
--to=kryme76@yahoo.com \
--cc=buildroot@busybox.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox