Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 630046 - cross-avr/gcc-6.4.0 stage1 install-phase failure in old toolchain.eclass hack
Summary: cross-avr/gcc-6.4.0 stage1 install-phase failure in old toolchain.eclass hack
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 21:14 UTC by Malcolm Lashley
Modified: 2018-04-07 17:40 UTC (History)
0 users

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


Attachments
emerge --info (emerge.info,7.79 KB, text/plain)
2017-09-05 21:14 UTC, Malcolm Lashley
Details
Build Log (cross-avr:gcc-6.4.0:20170919-210816.log.gz,566.62 KB, application/gzip)
2017-09-20 20:48 UTC, Malcolm Lashley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Lashley 2017-09-05 21:14:00 UTC
Created attachment 492710 [details]
emerge --info

cross-avr/gcc-6.4.0 stage1 fails with:

make[1]: Leaving directory '/var/tmp/portage/cross-avr/gcc-6.4.0/work/build'
mv: cannot stat '/var/tmp/portage/cross-avr/gcc-6.4.0/image/usr/lib/libcc1*': No such file or directory
 * ERROR: cross-avr/gcc-6.4.0::mlashley failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_install
 *   environment, line 3470:  Called toolchain_src_install
 *   environment, line 4671:  Called gcc_movelibs
 *   environment, line 1605:  Called die
 * The specific snippet of code:
 *           mv "${ED}"usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die;
 * 


i.e. this bit of code in toolchain.eclass:

# For non-target libs which are for CHOST and not CTARGET, we want to
# move them to the compiler-specific CHOST internal dir.  This is stuff
# that you want to link against when building tools rather than building
# code to run on the target.
if tc_version_is_at_least 5 && is_crosscompile ; then
    dodir "${HOSTLIBPATH#${EPREFIX}}"
    mv "${ED}"usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
fi

It looks like the files are in 'lib64' and not 'lib' that get_libdir is producing here

# pwd 
/var/tmp/portage/cross-avr/gcc-6.4.0/image
# find ./ -name libcc* -print
./usr/lib64/libcc1.la
./usr/lib64/libcc1.so
./usr/lib64/libcc1.so.0
./usr/lib64/libcc1.so.0.0.0
./usr/lib/gcc/avr/6.4.0/plugin/libcc1plugin.la
./usr/lib/gcc/avr/6.4.0/plugin/libcc1plugin.so
./usr/lib/gcc/avr/6.4.0/plugin/libcc1plugin.so.0
./usr/lib/gcc/avr/6.4.0/plugin/libcc1plugin.so.0.0.0

I hacked around it in toolchain.eclass with:

if tc_version_is_between 5 6 && is_crosscompile ; then
    dodir "${HOSTLIBPATH#${EPREFIX}}"
    mv "${ED}"usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
fi
if tc_version_is_at_least 6 && is_crosscompile ; then
    dodir "${HOSTLIBPATH#${EPREFIX}}"
    mv "${ED}"usr/lib64/libcc1* "${D}${HOSTLIBPATH}" || die
fi

But it's not clear what the _proper_ fix should be - original code introduced by Vapier in
https://github.com/gentoo/gentoo/commit/9511906a1b16034f98c9f9adee91ed4cb875c620
Bug #547754

I presume this 'host' lib-vs-lib64 has to do with building a non-multilib targetted cross-gcc, on a multilib-gcc host - and that somehow screws up multilib.eclass.

FWIW - then hit a problem in gcc-stage2 where running configure complains about the linker not supporting pie. (which makes sense on avr)

 /var/tmp/portage/cross-avr/gcc-6.4.0/work/build/./gcc/collect2 -plugin /var/tmp/portage/cross-avr/gcc-6.4.0/work/build/./gcc/liblto_plugin.so -plugin-opt=/var/tmp/portage/cross-avr/gcc-6.4.0/work/build/./gcc/lto-wrapper -plugin-opt=-fresolution=/tmp/ccuqTjz0.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -pie -L/var/tmp/portage/cross-avr/gcc-6.4.0/work/build/./gcc -L/usr/avr/lib /tmp/ccgfBsF4.o --start-group -lgcc -lm -lc --end-group

Got that working with the following args to crossdev to force use-flags (which should probably be default for the package.use that crossdev writes for AVR)

 --genv 'USE="nopie -pie -sanitize -vtv"'
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-09-19 10:22:26 UTC
Please attach the entire build log to this bug report.
Comment 2 Malcolm Lashley 2017-09-20 20:48:12 UTC
Created attachment 495694 [details]
Build Log

Build log as requested (gzip'd as over the bugzie limit)
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-07 17:40:37 UTC
Please reopen if the issue persists.