Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548782 - toolchain.eclass: clearing libdir in internal *.la files fails when there are no internal .la files
Summary: toolchain.eclass: clearing libdir in internal *.la files fails when there are...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 548704 548820 549058 549284 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-06 15:46 UTC by Alon Bar-Lev (RETIRED)
Modified: 2015-05-13 11:55 UTC (History)
10 users (show)

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


Attachments
Log of failed build. (cross-arm-none-eabi-gcc-stage1.log.xz,44.06 KB, application/x-xz)
2015-05-11 09:05 UTC, dtoch
Details
patch for 1.668 to get file/dir not found out of the way (548782_1.668.patch,610 bytes, patch)
2015-05-13 08:03 UTC, Carsten Steckel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alon Bar-Lev (RETIRED) gentoo-dev 2015-05-06 15:46:54 UTC
Hi,

This[1] comment, broke at least mingw64 build.
---
sed: can't read .//usr/lib/gcc/x86_64-w64-mingw32/4.9.2/*.la: No such file or directory

 *   environment, line 1753:  Called die
 * The specific snippet of code:
 *       sed -i -e "/^libdir=/s:=.*:='${dir}':" ./${dir}/*.la || die;
---

There are no la files to sed at this location.

Reproduce:

# crossdev -t x86_64-w64-mingw32

Maybe this should be applied to libexec in the mingw case, or just avoid if no la files.

Thanks,

[1] https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.665&r2=1.666
Comment 1 SpanKY gentoo-dev 2015-05-07 10:01:41 UTC
*** Bug 548820 has been marked as a duplicate of this bug. ***
Comment 2 Felix Janda 2015-05-08 10:29:54 UTC
https://bugs.gentoo.org/show_bug.cgi?id=548704 also seems to be a duplicate.
Comment 3 SpanKY gentoo-dev 2015-05-08 10:46:20 UTC
*** Bug 548704 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2015-05-08 11:21:05 UTC
this should fix it:
http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.666&r2=1.667
Comment 5 David Flogeras 2015-05-08 14:02:47 UTC
Mine (armv7m-softfloat-eabi), now fails on the next sed line:

 * Call stack:
 *     ebuild.sh, line   93:  Called src_install
 *   environment, line 3765:  Called toolchain_src_install
 *   environment, line 4865:  Called gcc_movelibs
 *   environment, line 1993:  Called fix_libtool_libdir_paths '/usr/lib/gcc/armv7m-softfloat-eabi/4.8.4/thumb'
 *   environment, line 1758:  Called die
 * The specific snippet of code:
 *       sed -i -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') ./${dir}/*.la || die




Similar error message:
sed: can't read .//usr/lib/gcc/armv7m-softfloat-eabi/4.8.4/thumb/*.la: No such file or directory
Comment 6 Alexander Tsoy 2015-05-09 14:24:27 UTC
Yes, fix is incomplete.
Comment 7 Richard Connon 2015-05-10 22:53:42 UTC
Can this be reopened since it is not fixed?
Comment 8 Richard Connon 2015-05-10 22:54:44 UTC
*** Bug 549058 has been marked as a duplicate of this bug. ***
Comment 9 gemi 2015-05-11 01:21:44 UTC
same here. avr toolchain does not build after this fix. It hangs here

sed: can't read .//usr/lib/gcc/avr/3.4.6/*.la: No such file or directory
 * ERROR: cross-avr/gcc-3.4.6-r2::crossdev failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_install
 *   environment, line 3753:  Called toolchain_src_install
 *   environment, line 4866:  Called gcc_movelibs
 *   environment, line 1989:  Called fix_libtool_libdir_paths '/usr/lib/gcc/avr/3.4.6/.'
 *   environment, line 1754:  Called die
 * The specific snippet of code:
 *       sed -i -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') ./${dir}/*.la || die;


Thanks
Comment 10 gemi 2015-05-11 01:35:25 UTC
(In reply to gemi from comment #9)
> same here. avr toolchain does not build after this fix. It hangs here
> 
> sed: can't read .//usr/lib/gcc/avr/3.4.6/*.la: No such file or directory
>  * ERROR: cross-avr/gcc-3.4.6-r2::crossdev failed (install phase):
>  *   (no error message)
>  * 
>  * Call stack:
>  *     ebuild.sh, line   93:  Called src_install
>  *   environment, line 3753:  Called toolchain_src_install
>  *   environment, line 4866:  Called gcc_movelibs
>  *   environment, line 1989:  Called fix_libtool_libdir_paths
> '/usr/lib/gcc/avr/3.4.6/.'
>  *   environment, line 1754:  Called die
>  * The specific snippet of code:
>  *       sed -i -e "/^dependency_libs=/s:/[^
> ]*/${allarchives}:${LIBPATH}/\1:g" $(find ./${PREFIX}/lib* -maxdepth 3 -name
> '*.la') ./${dir}/*.la || die;
> 
> 
> Thanks

If I delete the other SED command out of the fix_libtool_libdir_paths() function in /usr/portage/eclass/toolchain.eclass everything seems to compile and install well
Comment 11 SpanKY gentoo-dev 2015-05-11 03:05:37 UTC
this should fix it:
http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.667&r2=1.668
Comment 12 dtoch 2015-05-11 09:05:35 UTC
Created attachment 403032 [details]
Log of failed build.
Comment 13 dtoch 2015-05-11 09:06:23 UTC
Sad but true. It doesnt built again.
Comment 14 Stefan Beier 2015-05-12 11:08:57 UTC
(In reply to dtoch from comment #13)
> Sad but true. It doesnt built again.

I can confirm this issue on crossdev for cross-armv6j-hardfloat-linux-gnueabi/gcc on armv7a-hardfloat-linux-gnueabi.
Comment 15 gemi 2015-05-12 11:20:25 UTC
same for the AVR toolchain. It does not install and dies here:

make[1]: Leaving directory '/var/tmp/portage/cross-avr/gcc-3.4.6-r2/work/build/libiberty'
sed: no input files
 * ERROR: cross-avr/gcc-3.4.6-r2::crossdev failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_install
 *   environment, line 3757:  Called toolchain_src_install
 *   environment, line 4862:  Called gcc_movelibs
 *   environment, line 1989:  Called fix_libtool_libdir_paths '/usr/lib/gcc/avr/3.4.6/.'
 *   environment, line 1754:  Called die
 * The specific snippet of code:
 *       sed -i -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') $(find ./${dir}/ -maxdepth 1 -name '*.la') || die;

Again, if I just delete the sed command, it works fine for me, as there are not *.la files I am not sure about all the other toolchains though.
Comment 16 Carsten Steckel 2015-05-13 08:03:36 UTC
Created attachment 403182 [details, diff]
patch for 1.668 to get file/dir not found out of the way
Comment 17 Carsten Steckel 2015-05-13 08:06:01 UTC
I am looking at the toolchain.eclass 1.668 with the suggested patches. In line 1825 is a "find" looking for "*.sa" and executing a "sed" on every found instance of *.sa. If none are found. Nothing will be executed.

On line 1827 is a call to sed that replaces fancy things on the results of two $(find...). Well if those finds are empty, sed has no input...

I have reworked the line 1827 to be a find executing a sed similar to line 1825. I have attached a patch. It works for my use case. I guess it should work for everyone.

maybe Alon or SpanKY may run test cases against my proposed patch. I have no clue as I am completely new to gentoo, LoL
Comment 18 Carsten Steckel 2015-05-13 08:08:49 UTC
*** Bug 549284 has been marked as a duplicate of this bug. ***
Comment 19 gemi 2015-05-13 08:58:58 UTC
The patch https://bugs.gentoo.org/attachment.cgi?id=403182 from Carsten works fine for avr toolchain. Thanks for that.
Comment 20 SpanKY gentoo-dev 2015-05-13 09:04:50 UTC
Comment on attachment 403182 [details, diff]
patch for 1.668 to get file/dir not found out of the way

no one reads context diffs ;)
Comment 21 SpanKY gentoo-dev 2015-05-13 09:13:15 UTC
this should fix it:
http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.668&r2=1.669
Comment 22 gemi 2015-05-13 11:06:45 UTC
all good for avr toolchain, I think this can be closed now
Comment 23 David Flogeras 2015-05-13 11:32:46 UTC
Also confirmed fixed on armv7m-softfloat-eabi
Comment 24 dtoch 2015-05-13 11:55:03 UTC
crossdev -S -t arm-none-eabi
done!