unicorn-engine / unicorn

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)
http://www.unicorn-engine.org
GNU General Public License v2.0
7.33k stars 1.31k forks source link

Building unicorn from source on Alpine fails with `/home/venom/mtkclient/unicorn/qemu/util/oslib-posix.c:33:10: fatal error: linux/mman.h: No such file or directory` #1965

Open VenomousSteam81 opened 1 week ago

VenomousSteam81 commented 1 week ago

I'm trying to build unicorn from source for mtkclient on Alpine because I get an error from it and multiple other packages. The error I'm getting from building from source is:

/home/venom/mtkclient/unicorn/qemu/util/oslib-posix.c:33:10: fatal error: linux/mman.h: No such file or directory
   33 | #include <linux/mman.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/unicorn-common.dir/build.make:440: CMakeFiles/unicorn-common.dir/qemu/util/oslib-posix.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:591: CMakeFiles/unicorn-common.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Output of /etc/os-release:

PRETTY_NAME="postmarketOS v24.06"
NAME="postmarketOS"
VERSION_ID="v24.06"
VERSION="v24.06"
ID="postmarketos"
ID_LIKE="alpine"
HOME_URL="https://www.postmarketos.org/"
SUPPORT_URL="https://gitlab.com/postmarketOS"
BUG_REPORT_URL="https://gitlab.com/postmarketOS/pmaports/issues"
LOGO="postmarketos-logo"

If you want the errors I get from using pip3 install unicorn, I will be glad to give them.

VenomousSteam81 commented 1 week ago

Ok, I just ran pip3 install unicorn again and realized that I get the same errors.

https://gist.github.com/VenomousSteam81/a777d17552e22554b5d139870023ab46

VenomousSteam81 commented 1 week ago

I guess apk add py3-(pip3 package that couldn't be installed) works. Might not be as stable, but I will try it. DOES NOT WORK! (I thought it was going to for a moment)