Hello. I can cross compile =sys-apps/file-5.37-r1, but =sys-apps/file-5.38 fails. mips-unknown-linux-gnu-emerge -v1 =sys-apps/file-5.37-r1 /bin/sh ../libtool --tag=CC --mode=compile mips-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/usr/mips-unknown-linux-gnu/tmp/portage/sys-apps/file-5.37-r1/work/file-5.37/src ... mips-unknown-linux-gnu-emerge -v1 =sys-apps/file-5.38 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/usr/mips-unknown-linux-gnu/tmp/portage/sys-apps/file-5.38/work/file-5.38/src ... It uses wrong compiler somehow.
We can see that workaround for #362941 failed. # when cross-compiling, we need to build up our own file # because people often don't keep matching host/target # file versions #362941 if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then My container (with mips toolchain installed) has =sys-apps/file-5.37-r1 installed so "has_version ~${CATEGORY}/${P}" is false and workaround is not active. This workaround doesn't looks healthy. I think that "SpanKY" developer is the author of this code. Please assign this bug to him. Thank you.
(In reply to Andrew Aladjev from comment #1) > > I think that "SpanKY" developer is the author of this code. Please assign > this bug to him. Thank you. Mike (a.k.a. SpanKY) is in base-system team, so this bug is already assigned to the correct target.
Please attach the build log.
Hello Mike, I've fixed workaround by replacing econf --disable-shared --disable-libseccomp with econf --disable-shared --disable-libseccomp --disable-fsect-man5 --disable-bzlib --disable-xzlib --disable-zlib Please update it, maybe it can be removed? Thank you.
I will attach build log in 2 minutes, sorry.
Created attachment 602550 [details] build log
(In reply to Andrew Aladjev from comment #4) Ah, that's helpful; so it's failing because the package has grown some additional optional dependencies that we need to disable for the minimal CBUILD configuration.
Yes, file v5.38 received new bzip2 and lzma deps. Maybe we need to disable it in cross compile workaround.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30b0ca3905ccd1bff0a5f1641adf2226d57f23b1 commit 30b0ca3905ccd1bff0a5f1641adf2226d57f23b1 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2020-01-04 18:07:12 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-01-04 18:08:29 +0000 sys-apps/file: refactor cross-compile logic Add build_src_configure and need_build_file helper functions. Pass --disable-{bzlib,xzlib,zlib} to configure in build_src_configure. Use tc-env_build helper in build_src_configure. Convert "ROOT=/ has_version" to PMS-compliant "has_version -b". Make ECONF_SOURCE and PATH local variables. Closes: https://bugs.gentoo.org/704776 Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/file/file-5.38.ebuild | 42 ++++++++++++++++++++++++------------------ sys-apps/file/file-9999.ebuild | 42 ++++++++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 36 deletions(-)
This is partially untested as I don't have a working cross-compiler at the moment. Please re-open the bug if it you encounter problems.
I've tested new ebuild now - work perfect for my current mips toolchain. Thank you.