Summary: | cross-armv7m-none-eabi/gcc-4.5.3 stage1 cross-compiler fails | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jiri Pittner <jiri.pittner> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | no111u3, peter |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
log files
Patch for /usr/portage/eclass/toolchain.eclass patch patch for arm thumb mode patch for arm thumb mode |
Description
Jiri Pittner
2012-05-30 07:53:38 UTC
seems like using --with-arch=armv7-m doesn't work by default you can work around it by running crossdev with the flag: --genv EXTRA_ECONF=--with-arch= The suggested workaround option has to be enclosed in quotes: crossdev -t armv7m-none-eabi --ex-gdb --genv EXTRA_ECONF=--with-arch= ... * Emerging cross-gcc-stage1 ... * gcc failed :( /var/log/portage/cross-armv7m-none-eabi-gcc-stage1.log.xz: Calculating dependencies . ..... done! ParseError: Invalid token 'CFLAGS_default' (not '='): /etc/portage/env/cross-armv7m-none-eabi/gcc.conf: line 4 in /etc/portage/env/cross-armv7m-none-eabi/gcc.conf crossdev -t armv7m-none-eabi --ex-gdb --genv "EXTRA_ECONF='--with-arch='" works fine. Thanks for the help :-). Jiri Created attachment 328526 [details, diff]
Patch for /usr/portage/eclass/toolchain.eclass
I had the same problem. The error occurs because the compiler is asked to generate ARM code for a Thumb CPU. I solved it patching /usr/portage/eclass/toolchain.eclass and adding the --with-mode=thumb switch. Just posted proposed patch. Hello. Anything new about this issue? it's affect me too. crossdev -t armv7m-hardfloat-eabi Emerging cross-gcc-stage1 ... * gcc failed :( Gcc version 4.7.2/4.7.3 *** Bug 470232 has been marked as a duplicate of this bug. *** I imposed this patch and it worked to me. http://nis-embedded.blogspot.ru/2013/04/the-full-compatible-toolchain-for.html Comment on attachment 328526 [details, diff]
Patch for /usr/portage/eclass/toolchain.eclass
this should be generalized slightly. if ${arm_arch} matches *-m, then default to thumb mode.
(In reply to comment #9) > Comment on attachment 328526 [details, diff] [details, diff] > Patch for /usr/portage/eclass/toolchain.eclass > > this should be generalized slightly. if ${arm_arch} matches *-m, then > default to thumb mode. Is not truth. I'm installing cross armv7-hardfloat-eabi and gcc build failed. jane ~ # crossdev armv7m-hardfloat-eabi -------------------------------------------------------------------------------- * crossdev version: 20120721 * Host Portage ARCH: x86 * Target Portage ARCH: arm * Target System: armv7m-hardfloat-eabi * Stage: 3 (C compiler & libc) * ABIs: default * binutils: binutils-[latest] * gcc: gcc-[latest] * libc: newlib-[latest] * CROSSDEV_OVERLAY: /usr/local/portage * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: * Portage flags: _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - !!! WARNING - Cannot auto-configure CHOST armv7m-hardfloat-eabi !!! You should edit /usr/armv7m-hardfloat-eabi/etc/portage/make.conf !!! by hand to complete your configuration * Log: /var/log/portage/cross-armv7m-hardfloat-eabi-binutils.log * Emerging cross-binutils ... [ ok ] * Log: /var/log/portage/cross-armv7m-hardfloat-eabi-gcc-stage1.log * Emerging cross-gcc-stage1 ... * gcc failed :( * If you file a bug, please attach the following logfiles: * /var/log/portage/cross-armv7m-hardfloat-eabi-info.log * /var/log/portage/cross-armv7m-hardfloat-eabi-gcc-stage1.log.xz * /var/tmp/portage/cross-armv7m-hardfloat-eabi/gcc*/temp/gcc-config.logs.tar.xz (In reply to comment #10) i don't know what the point of this comment is (In reply to comment #11) > (In reply to comment #10) > > i don't know what the point of this comment is Without patch compile gcc failed (In reply to comment #12) that is already known, and why this bug is still open. so i don't know why you posted that comment when it doesn't add anything new. (In reply to comment #13) > (In reply to comment #12) > > that is already known, and why this bug is still open. so i don't know why > you posted that comment when it doesn't add anything new. Bug is known, but hasn't solution. (In reply to comment #9) > Comment on attachment 328526 [details, diff] [details, diff] > Patch for /usr/portage/eclass/toolchain.eclass > > this should be generalized slightly. if ${arm_arch} matches *-m, then > default to thumb mode. http://en.wikipedia.org/wiki/ARM_architecture -m mode(thumb) is matches for Cortex-m3+ as arch ARMv7m, but and Cortex-m0(1)(+) as arch ARMv6m. I can rewrite patch. But using gcc for ARMv7-M I can compile for Cortex-m0 because, -mcpu and -mtune has cortex-m0 cpu. Also thumb instructions in -m0 and m3 is equal jane linux # armv7m-hardfloat-eabi-gcc --help=target ... Known ARM CPUs (for use with the -mcpu= and -mtune= options): arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a15 cortex-a5 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale ... Created attachment 348987 [details, diff]
patch
Patch to add a thumb mode in compile tools
Comment on attachment 348987 [details, diff]
patch
please use the unified diff format. this format is not useful for review or for actually applying as files change over time.
you don't need to use a regex as a simple pattern match will do it.
[[ ${arm_arch} == *-m ]] && confgcc+=( --with-mode=thumb )
Created attachment 349038 [details]
patch for arm thumb mode
New version of patch for select thumb mode for cross compiller if selected armv7-m arch
Comment on attachment 349038 [details]
patch for arm thumb mode
--- toolchain.eclass.orig 2013-05-24 08:45:23.078823831 +0700
+++ toolchain.eclass 2013-05-24 09:02:37.760326529 +0700
@@ -968,6 +968,7 @@
break
fi
done
+
# Convert armv7{a,r,m} to armv7-{a,r,m}
[[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-}
# See if this is a valid --with-arch flag
@@ -977,6 +978,9 @@
confgcc+=( --with-arch=${arm_arch} )
fi
+ # If arch is arm*-m, use thumb mode only.
+ [[ ${arm_arch} == *-m ]] && confgcc+=( --with-mode=thumb )
+
# Enable hardvfp
if [[ $(tc-is-softfloat) == "no" ]] && \
[[ ${CTARGET} == armv[67]* ]] && \
Comment on attachment 349038 [details] patch for arm thumb mode >--- toolchain.eclass.orig 2013-05-24 08:45:23.078823831 +0700 >+++ toolchain.eclass 2013-05-24 08:50:19.295471444 +0700 >@@ -968,6 +968,7 @@ > break > fi > done >+ > # Convert armv7{a,r,m} to armv7-{a,r,m} > [[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-} > # See if this is a valid --with-arch flag >@@ -977,6 +978,9 @@ > confgcc+=( --with-arch=${arm_arch} ) > fi > >+ # If arch is arm*-m, use thumb mode only. >+ [[ ${arm_arch} == *-m ]] && confgcc+=( --with-mode=thumb ) >+ > # Enable hardvfp > if [[ $(tc-is-softfloat) == "no" ]] && \ > [[ ${CTARGET} == armv[67]* ]] && \ Created attachment 349040 [details, diff]
patch for arm thumb mode
New version of patch for select thumb mode for cross compiller if selected armv7-m arch. Previous is wrong by incorrect syntax.
Test patch passed: jane ~ # crossdev armv7m-hardfloat-eabi -------------------------------------------------------------------------------- * crossdev version: 20120721 * Host Portage ARCH: x86 * Target Portage ARCH: arm * Target System: armv7m-hardfloat-eabi * Stage: 3 (C compiler & libc) * ABIs: default * binutils: binutils-[latest] * gcc: gcc-[latest] * libc: newlib-[latest] * CROSSDEV_OVERLAY: /usr/local/portage * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: * Portage flags: _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - * leaving sys-devel/binutils in /usr/local/portage * leaving sys-devel/gcc in /usr/local/portage * leaving sys-libs/newlib in /usr/local/portage * leaving sys-devel/gdb in /usr/local/portage _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - * Log: /var/log/portage/cross-armv7m-hardfloat-eabi-binutils.log * Emerging cross-binutils ... [ ok ] * Log: /var/log/portage/cross-armv7m-hardfloat-eabi-gcc-stage1.log * Emerging cross-gcc-stage1 ... [ ok ] * Log: /var/log/portage/cross-armv7m-hardfloat-eabi-newlib.log * Emerging cross-newlib ... [ ok ] thanks for testing http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.592&r2=1.593 |