Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700532 - dev-embedded/avr-libc-2.0.0 - configure: error: Wrong C compiler found; check the PATH!
Summary: dev-embedded/avr-libc-2.0.0 - configure: error: Wrong C compiler found; check...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-19 00:25 UTC by D. Wilson
Modified: 2020-08-20 19:22 UTC (History)
2 users (show)

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


Attachments
bash command history to demonstrate the chain of events (commandlog.txt,2.54 KB, text/plain)
2019-11-19 01:17 UTC, D. Wilson
Details
cross-avr-info.log (cross-avr-info.log,20.16 KB, text/plain)
2019-11-19 01:17 UTC, D. Wilson
Details
cross-avr-avr-libc.log (cross-avr-avr-libc.log,5.51 KB, text/plain)
2019-11-19 01:18 UTC, D. Wilson
Details
avr-libc-config.log (config.log,25.13 KB, text/plain)
2019-11-19 01:20 UTC, D. Wilson
Details
output of: avr-gcc -v (avr-gcc-v.txt,1.45 KB, text/plain)
2020-08-16 12:44 UTC, D. Wilson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description D. Wilson 2019-11-19 00:25:16 UTC
While following the instructions at https://wiki.gentoo.org/wiki/Arduino to set up an Arduino build environment, the crossdev toolchain build process failed while building avr-libc, with the configure step finding the wrong gcc version. Adding "CC=avr-gcc" to the top of the ebuild, right under the CHOST and CTARGET lines, allows the build to proceed as expected. The pkg_configure() check for avr-gcc's existence passed, but the wrong CC variable is being used for the build itself.

Crossdev appears to be using dev-embedded/avr-libc as it's source while populating the /usr/local/portage-crossdev/cross-avr/ local repo, so I'm filing the bug against it.

This could very well be a bug in crossdev rather than avr-libc, but the quick and simple fix was adding one line to this ebuild, so here I am to report it.

Reproducible: Always

Steps to Reproduce:
1.Set up local cross-avr repo, as per https://wiki.gentoo.org/wiki/Arduino#Creating_local_overlay
2.Build toolchain with crossdev by running (as root): crossdev -s4 --stable --portage --verbose --target avr



I don't believe my emerge --info or other configuration information will be relevant. Crossdev appears to set up it's own portage build environment (make.conf, etc) and changes it on the fly as it builds each stage.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-19 00:40:03 UTC
Please provide build logs collected by crossdev. avr target bootstrap works for me on amd64 and x86.
Comment 2 D. Wilson 2019-11-19 01:17:14 UTC
Created attachment 596752 [details]
bash command history to demonstrate the chain of events
Comment 3 D. Wilson 2019-11-19 01:17:55 UTC
Created attachment 596754 [details]
cross-avr-info.log
Comment 4 D. Wilson 2019-11-19 01:18:20 UTC
Created attachment 596756 [details]
cross-avr-avr-libc.log
Comment 5 D. Wilson 2019-11-19 01:20:35 UTC
Created attachment 596758 [details]
avr-libc-config.log

Three logfiles uploaded, and a bash command history to show what I did to generate them.

I see now that crossdev does specify these three files be attached to any bug that is filed, and I apologize for not doing that. I patched the ebuild and got things working many hours ago, and did not re-create the problem prior to filing the bug report.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-15 09:38:33 UTC
> AR='avr-ar'
> AS='avr-as'
> CC='gcc'
> CCAS='gcc'

'gcc' looks wrong. stage1-gcc was supposed to install avr-gcc.

What do you see when you run 'avr-gcc -v'?
Comment 7 D. Wilson 2020-08-16 12:44:10 UTC
Created attachment 654956 [details]
output of: avr-gcc -v
Comment 8 D. Wilson 2020-08-16 12:44:39 UTC
(In reply to Sergei Trofimovich from comment #6)
> 'gcc' looks wrong. stage1-gcc was supposed to install avr-gcc.
> 
> What do you see when you run 'avr-gcc -v'?

stage1 did install avr-gcc. As stated in the opening comment, hand-editing the ebuild to specify 'cc=avr-gcc' corrected the problem and everything proceeded as expected after that.

Output of 'avr-gcc -v' attached.
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-16 13:55:39 UTC
(In reply to D. Wilson from comment #8)
> (In reply to Sergei Trofimovich from comment #6)
> > 'gcc' looks wrong. stage1-gcc was supposed to install avr-gcc.
> > 
> > What do you see when you run 'avr-gcc -v'?
> 
> stage1 did install avr-gcc. As stated in the opening comment, hand-editing
> the ebuild to specify 'cc=avr-gcc' corrected the problem and everything
> proceeded as expected after that.

./configure is supposed to detect ${target}-gcc automatically if it exists. It is skipped only if it's overridden with CC variable or broken (examples of broken are: bad state after gcc-confg, missing shared libraries, etc.). Otherwise if does not need to be specified.

> Output of 'avr-gcc -v' attached.

'avr-gcc' looks working.

Here is the link from build log that we should investigate in more detail.

Bad:

> checking for avr-gcc... gcc

Good:

checking for avr-gcc... avr-gcc

Do you have CC=gcc set in make.conf by chance? Can you post your 'emerge --info'?
Comment 10 D. Wilson 2020-08-20 19:22:54 UTC
Yes, for reasons unknown I had CC=gcc set in /etc/portage/make.conf.

I removed it, removed my local change adding CC=avr-gcc to the ebuild, cleaned my avr install ('crossdev -C avr'), and rebuilt it with 'crossdev -s4 --stable --portage --verbose --target avr'. Everything works as expected.

Looks like the bug was me all along. Thanks for setting me straight.