On a mips64 system, sys-devel/crossdev-20200125 can't be merged using sys-devel/make-4.3: >>> Emerging (1 of 1) sys-devel/crossdev-20200125::gentoo * crossdev-20200125.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking crossdev-20200125.tar.xz to /usr/obj/portage/sys-devel/crossdev-20200125/work >>> Source unpacked in /usr/obj/portage/sys-devel/crossdev-20200125/work >>> Preparing source in /usr/obj/portage/sys-devel/crossdev-20200125/work/crossdev-20200125 ... >>> Source prepared. >>> Configuring source in /usr/obj/portage/sys-devel/crossdev-20200125/work/crossdev-20200125 ... >>> Source configured. >>> Compiling source in /usr/obj/portage/sys-devel/crossdev-20200125/work/crossdev-20200125 ... make -j4 make: Nothing to be done for 'all'. >>> Source compiled. >>> Test phase [not enabled]: sys-devel/crossdev-20200125 >>> Install sys-devel/crossdev-20200125 into /usr/obj/portage/sys-devel/crossdev-20200125/image make -j4 DESTDIR=/usr/obj/portage/sys-devel/crossdev-20200125/image install install -m 755 -d /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/ install -m 755 crossdev /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/ sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev sed: couldn't open temporary file /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/sed5gJc2R: Permission denied make: *** [Makefile:11: install] Error 4 * ERROR: sys-devel/crossdev-20200125::gentoo failed (install phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/crossdev-20200125::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/crossdev-20200125::gentoo'`. * The complete build log is located at '/usr/obj/portage/sys-devel/crossdev-20200125/temp/build.log'. * The ebuild environment file is located at '/usr/obj/portage/sys-devel/crossdev-20200125/temp/environment'. * Working directory: '/usr/obj/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' * S: '/usr/obj/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' Downgrading back to sys-devel/make-4.2.1-r4 allows crossdev to merge. Unable to reproduce on my x86_64 platform, so this might be MIPS-specific somehow. Not terribly sure how. Nothing appears in dmesg indicating a failure, and perms on my PORTAGE_TMPDIR are all correct. Having similar issues with other packages, such as nano and shadow. Either getting a "permission denied" error or "operation not permitted".
Created attachment 612884 [details] emerge --info
> sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev > sed: couldn't open temporary file /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/sed5gJc2R: Permission denied If sed is called with precisely these arguments then make version should not affect it's execution. You can try to run in manually in a loop to see if it's reproducible. If it does reproduce 'strace' might provide a clue.
(In reply to Sergei Trofimovich from comment #2) > > sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev > > sed: couldn't open temporary file /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/sed5gJc2R: Permission denied > > If sed is called with precisely these arguments then make version should not > affect it's execution. You can try to run in manually in a loop to see if > it's reproducible. > > If it does reproduce 'strace' might provide a clue. It's definitely tied to make-4.3 somehow. Running the sed command by itself returns no errors. IT might be related to ABI. I have an O32
(In reply to Joshua Kinard from comment #3) > (In reply to Sergei Trofimovich from comment #2) > > > sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev > > > sed: couldn't open temporary file /usr/obj/portage/sys-devel/crossdev-20200125/image/usr/bin/sed5gJc2R: Permission denied > > > > If sed is called with precisely these arguments then make version should not > > affect it's execution. You can try to run in manually in a loop to see if > > it's reproducible. > > > > If it does reproduce 'strace' might provide a clue. > > It's definitely tied to make-4.3 somehow. Running the sed command by itself > returns no errors. IT might be related to ABI. I have an O32 ** I have an O32 chroot I can test in shortly after I sync my portage tree up. My main root filesystem runs N32, and sometimes, albeit rarely, weird bugs can crop up on N32 because it's a hybrid 32bit/64bit model.
Okay, I also have the same failure in my O32 chroot when using make-4.3. However, I had 'sandbox' enabled on the first attempt, and that coughed up a different set of error messages: >>> Install sys-devel/crossdev-20200125 into /var/tmp/portage/sys-devel/crossdev-20200125/image make -j3 DESTDIR=/var/tmp/portage/sys-devel/crossdev-20200125/image install install -m 755 -d /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. install -m 755 crossdev /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. make -C wrappers install ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. make[1]: Entering directory '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125/wrappers' make[1]: portageq: Operation not permitted install -m 755 -d /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/share/crossdev/include/site /var/tmp/portage/sys-devel/crossdev-20200125/image/etc/crossdev/include/site make[1]: install: Operation not permitted make[1]: *** [Makefile:14: install] Error 127 make[1]: Leaving directory '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125/wrappers' make: *** [Makefile:12: install] Error 2 * ERROR: sys-devel/crossdev-20200125::gentoo failed (install phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/crossdev-20200125::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/crossdev-20200125::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/crossdev-20200125/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/crossdev-20200125/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' * S: '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' After adding "-sandbox -usersandbox" to FEATURES, I get the same error as my N32 chroot: >>> Install sys-devel/crossdev-20200125 into /var/tmp/portage/sys-devel/crossdev-20200125/image make -j3 DESTDIR=/var/tmp/portage/sys-devel/crossdev-20200125/image install install -m 755 -d /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ install -m 755 crossdev /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ sed -i -e "s:@GENTOO_PORTAGE_EPREFIX@::g" /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/crossdev make -C wrappers install make[1]: Entering directory '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125/wrappers' make[1]: portageq: Operation not permitted install -m 755 -d /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/bin/ /var/tmp/portage/sys-devel/crossdev-20200125/image/usr/share/crossdev/include/site /var/tmp/portage/sys-devel/crossdev-20200125/image/etc/crossdev/include/site make[1]: install: Operation not permitted make[1]: *** [Makefile:14: install] Error 127 make[1]: Leaving directory '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125/wrappers' make: *** [Makefile:12: install] Error 2 * ERROR: sys-devel/crossdev-20200125::gentoo failed (install phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/crossdev-20200125::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/crossdev-20200125::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/crossdev-20200125/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/crossdev-20200125/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' * S: '/var/tmp/portage/sys-devel/crossdev-20200125/work/crossdev-20200125' So this is probably a MIPS-specific problem with make-4.3 at the moment. Is there anything major that changed in make between 4.2.1 and 4.3 that might have anything to do with file system access? It seems the issue is there somehow.
Okay, I found the problem: * GNU make will now use posix_spawn() on systems where it is available. If you prefer to use fork/exec even on systems where posix_spawn() is present, you can use the --disable-posix-spawn option to configure. Implementation contributed by Aron Barath <baratharon@caesar.elte.hu> There's some kind of issue with the use of posix_spawn() on MIPS I guess. Recompiling make-4.3 without support for this (using the older fork/exec), it works fine now in installing crossdev. I'll attach a patch shortly that adds a local USE flag to allow the enabling/disabling of posix_spawn, with it defaulting to enabled for all ARCHs, then if that is accepted, the MIPS profiles can mask that USE until something is fixed either in upstream GNU make, or possibly even in Glibc.
Created attachment 613128 [details, diff] Add local USE to control posix_spawn() functionality in make-4.3 Patch adds a new local USE flag, posix-spawn, to enable or disable the use of the posix_spawn() function call that make-4.3 can use over the older fork()/exec() calls. Enabled by default, this local USE will be disabled on MIPS until upstream can look into why posix_spawn does not work on MIPS correctly.
Will you will handle reporting this upstream? I doubt anyone on base-system will be able to reproduce it.
(In reply to Mike Gilbert from comment #8) > Will you will handle reporting this upstream? I doubt anyone on base-system > will be able to reproduce it. Yup, just waiting for the machine to finish some updates.
Great. Please feel free to push your workaround.
Upstream bug created. I'll add the ebuild changes tomorrow.
From upstream, this looks more like a glibc bug. See the new bug reference for details.
Looking at the related glibc bug, I am wondering if this issue explains why I very very randomly get odd errors in my chroots. I recently updated an O32/MIPS2 chroot with little problem, other than with make-4.3. But an N32/MIPS3 chroot kept having weird errors, like illegal instructions, which might be explained by screwed up arg passing in glibc's syscall templates. I'll have to run some local tests to see. The proposed fix might need to be backported to glibc-2.30 and added to 2.31 in our tree. I'll update when I know more.
Sounds good. Thanks for the detailed follow-up!
https://sourceware.org/PR25523
(In reply to Sergei Trofimovich from comment #15) > https://sourceware.org/PR25523 Upstream has this fixed for MIPS, Sparc, Microblaze, and RISC-V. @toolchain, can the patches at the below URLs be pulled into glibc's patchball for 2.30 as well as 2.31? At a minimum, MIPS, Sparc, and RISC-V. I'm not sure if Gentoo supports Microblaze yet. I've CC'ed the relevant arch teams. I am guessing that glibc-2.32 will fix this, so they can be dropped from the patchball when that is released. I've verified in a MIPS3/N32 chroot that make-4.3 works fine using posix_spawn() after glibc is built with the MIPS-specific patch applied. MIPS: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=aa638b86b222fcc9f9cdf1d2cb49a36ea681b469 Sparc: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=c261718b3fda4b629ee120f48e3ee50db9c793a1 RISC-V: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=be74b42ee2a97009a6cd4fc90126add4a41c583b
Comment on attachment 613128 [details, diff] Add local USE to control posix_spawn() functionality in make-4.3 Unless anyone objects, I think the real fix is to fix glibc's bug on MIPS, Sparc, and RISC-V. No need to add a new local USE flag to make as a workaround.
Yeah, totally. We'll pull in all linked here patches into 2.30/2.31.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9097e0e8399937b751ac38153f44a12f9f1c2b54 commit 9097e0e8399937b751ac38153f44a12f9f1c2b54 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-02-16 19:23:13 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-02-16 19:25:25 +0000 sys-libs/glibc: pull 2.30 and 2.31 upstream patches, bug #708758 Among other things patches to fix posix_spawn syscall on mips and other targets.. Reported-by: Joshua Kinard Closes: https://bugs.gentoo.org/708758 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-libs/glibc/Manifest | 2 + sys-libs/glibc/glibc-2.30-r4.ebuild | 1490 ++++++++++++++++++++++++++++++++++ sys-libs/glibc/glibc-2.31-r1.ebuild | 1493 +++++++++++++++++++++++++++++++++++ 3 files changed, 2985 insertions(+)
*** Bug 711646 has been marked as a duplicate of this bug. ***