Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 627586 - sys-devel/crossdev crossdev -S -t arm-none-eabi -s4 fails building stage 2.
Summary: sys-devel/crossdev crossdev -S -t arm-none-eabi -s4 fails building stage 2.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-12 03:46 UTC by R030t1
Modified: 2018-01-20 14:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross-arm-none-eabi-info.log (cross-arm-none-eabi-info.log,16.57 KB, text/x-log)
2017-08-12 03:46 UTC, R030t1
Details
cross-arm-none-eabi-gcc-stage2.log.xz (cross-arm-none-eabi-gcc-stage2.log.xz,126.05 KB, application/x-xz)
2017-08-12 03:47 UTC, R030t1
Details
gcc-config.logs.tar.xz (gcc-config.logs.tar.xz,83.48 KB, application/x-xz)
2017-08-12 03:48 UTC, R030t1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description R030t1 2017-08-12 03:46:47 UTC
Created attachment 488660 [details]
cross-arm-none-eabi-info.log

Hello,

`crossdev -S -t arm-none-eabi -s4` fails when building stage 2. This isn't a new problem and has persisted for nearly half a year from memory. I would very much appreciate any information. My apologies if the severity is too high.
Comment 1 R030t1 2017-08-12 03:47:21 UTC
Created attachment 488662 [details]
cross-arm-none-eabi-gcc-stage2.log.xz
Comment 2 R030t1 2017-08-12 03:48:56 UTC
Created attachment 488664 [details]
gcc-config.logs.tar.xz
Comment 3 R030t1 2017-08-12 03:57:36 UTC
I hit submit by accident. I meant to add that the unstable branch fails in a similar spot. The error seems to be related to the target platform not supporting Linux (which is to be expected) but I am unable to gather any more useful information from it.
Comment 4 R030t1 2017-08-15 01:26:20 UTC
Compilation produces a stage 1 that is not usable for unknown reasons.
Comment 5 R030t1 2017-08-15 17:00:19 UTC
Anyone who can help should look at https://forums.gentoo.org/viewtopic-p-8105268.html#8105268 and the following posts.
Comment 6 Steve Arnold archtester gentoo-dev 2017-10-04 21:24:22 UTC
You might need to be a little more specific about your bare metal target; the last one I built for Cortex-M4 worked for me with crossdev-99999999:

USE="hardened multitarget lzma -multilib -openmp -fortran -jit" EXTRA_ECONF="--disable-multilib --disable-libsanitizer --with-arch=armv7e-m --with-tune=cortex-m4 --with-float-abi=hard --with-fpu=fpv4-sp-d16 --with-mode=thumb" crossdev armv7m-hardfloat-eabi --ex-gdb  --show-fail-log  --ov-output /usr/local/cortex-m4
Comment 7 R030t1 2017-10-07 04:20:10 UTC
(In reply to Steve Arnold from comment #6)
> You might need to be a little more specific about your bare metal target;
> the last one I built for Cortex-M4 worked for me with crossdev-99999999:
> 

arm-none-eabi is a valid tuple that represents a toolchain that supports all Cortex-M, Cortex-R, and some Cortex-A parts, albeit with explicit hardware settings passed in during compilation. I am not sure that the flags passed in EXTRA_ECONF actually mean anything when the compiler is not building for the target architecture.

I've progressed a bit farther and now gcc stage 2 fails in the configure phase due to a test not being compatible with cross compilation. I will attach logs shortly. I am confused, because other toolchains do not encounter this problem.
Comment 8 Steve Arnold archtester gentoo-dev 2017-10-25 02:27:03 UTC
All I can say is "yes, it should work" but currently crossdev doesn't quite handle all of the extra USE flags (mainly gcc) specific to arm-*-eabi for you.  You can get as specific as you need for extra flags, using either "global" USE= or EXTRA_ECONF= or the env args for each package individually (or all of the above).

For some examples, see this file in arm overlay:

https://github.com/sarnold/arm/blob/master/configs/armv7m-crossdev.txt

I think the last one has some important options for what you need:

PORTDIR_OVERLAY="/usr/local/cortex-m4" USE="hardened multitarget lzma -multilib -nls -openmp -fortran -jit -sanitize -vtv" EXTRA_ECONF="--with-newlib --disable-libada --disable-multilib --with-arch=armv7e-m --with-tune=cortex-m4 --with-float-abi=hard --with-fpu=fpv4-sp-d16 --with-mode=thumb --with-abi=aapcs-linux  --enable-libstdcxx-time=no" crossdev --g 6.4.0 -s4 -t armv7m-hardfloat-eabi --genv 'EXTRA_ECONF="--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"' --lenv 'USE="newlib-nano"' --ex-gdb  --show-fail-log  -v

Note that USE="newlib-nano" is an ebuild hack from bugzilla that ended up in my overlay.  You can replace it with this for a quick test:

 --enable-newlib-nano-formatted-io --enable-newlib-nano-malloc
Comment 9 Jean-Marc Beaune 2018-01-08 21:14:00 UTC
Hi,

I have the same issue hen running 'crossdev -S -s4 -t avr'.

It fails on stage 2.

`checking for C compiler default output file name... 
configure: error: in `/var/tmp/portage/cross-avr/gcc-6.4.0/work/build/avr/libvtv':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [Makefile:10274: configure-target-libvtv] Error 1
make[1]: Leaving directory '/var/tmp/portage/cross-avr/gcc-6.4.0/work/build'
make: *** [Makefile:858: all] Error 2
 * ERROR: cross-avr/gcc-6.4.0::crossdev failed (compile phase):
 *   emake failed
`

Same error if I issue 'USE=-libvtv crossdev -S -s4 -t avr'

Let me know if I should post the log files.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2018-01-08 23:09:46 UTC
(In reply to Jean-Marc Beaune from comment #9)
> Hi,
> 
> I have the same issue hen running 'crossdev -S -s4 -t avr'.
> 
> It fails on stage 2.
> 
> `checking for C compiler default output file name... 
> configure: error: in
> `/var/tmp/portage/cross-avr/gcc-6.4.0/work/build/avr/libvtv':
> configure: error: C compiler cannot create executables
> See `config.log' for more details.
> make[1]: *** [Makefile:10274: configure-target-libvtv] Error 1
> make[1]: Leaving directory '/var/tmp/portage/cross-avr/gcc-6.4.0/work/build'
> make: *** [Makefile:858: all] Error 2
>  * ERROR: cross-avr/gcc-6.4.0::crossdev failed (compile phase):
>  *   emake failed
> `
> 
> Same error if I issue 'USE=-libvtv crossdev -S -s4 -t avr'
> 
> Let me know if I should post the log files.

The correct USE is vtv (not libvtv). Which crossdev version you are using?
Comment 11 Jean-Marc Beaune 2018-01-09 20:24:44 UTC
Compilation went OK for me after issuing "USE=-vtv crossdev -S -s4 -t avr"
Thank you!
I use sys-devel/crossdev-20151026-r1
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2018-01-09 20:43:26 UTC
(In reply to Jean-Marc Beaune from comment #11)
> Compilation went OK for me after issuing "USE=-vtv crossdev -S -s4 -t avr"

Woohoo! Thanks for confirmation!

> I use sys-devel/crossdev-20151026-r1

The default should have been fixed by https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=6027263a03cbfaa177399c466d48aa04f2e93f1d 

Now crossdev defaults to USE=-vtv for most targets (you can still force it on with USE=vtv crossdev ... if you really want to fix it upstream)

=sys-devel/crossdev-20171230 (stable) should also contain the fix.