cosmopolitan: binfmt_misc tuning can break ape

Hello,

I’m just trying this on Ubuntu 20.04 and get the following error:

$ make -j8 -O o//examples/hello.com

MKDEPS         o//depend
ZIPOBJ         o//libc/stubs/errno.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
make: *** [build/rules.mk:76: o//libc/stubs/errno.S.zip.o] Error 2
ZIPOBJ         o//libc/stubs/triplf.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/asanjmp.greg.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/subvsi3.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/mulvdi3.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/errnolocation.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/mcount.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
ZIPOBJ         o//libc/stubs/panic.S.zip.o
run-detectors: unable to find an interpreter for o/build/bootstrap/zipobj.com
make: *** [build/rules.mk:76: o//libc/stubs/panic.S.zip.o] Error 2

If I try to run zipobj.com directly, it returns the following:

$build/bootstrap/zipobj.com

error:tool/build/zipobj.c:93:zipobj.com: check failed
        CHECK_NE(NULL, outpath_);
                 → 0 (outpath_)
                != 0 (NULL)
        E?/err=0/errno:0/GetLastError:0
        build/bootstrap/zipobj.com

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 25 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Users who don’t want to modify their /proc/sys/fs/binfmt_misc/ long-term (eg. because they don’t need APE) can select a mode that doesn’t produce them at build time, eg. MODE=optlinux make -j8 o/optlinux/third_party/make/make.com.

This still requires the binfmt workaround at build time (as the bootstrap executables cocmd, compile, fixupobj, package, unbundle and zipobj as well as the custom ar are necessary to build it and not generally available otherwise), but it moves the problem to one of bootstrapping / building from one of running.

Could you try running the following command and let me know if it fixes the issue?

sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"