darwin-on-arm / xnu

Porting the Darwin kernel to the AArch64/ARMv7/ARMv6-A architectures.
Other
584 stars 146 forks source link

'mach-o/swap.h' file not found (On Linux [Ubuntu 13.04]) #6

Closed wargio closed 9 years ago

wargio commented 11 years ago

after patching the printf inside the MakeInc.def, it works till failing here: http://pastie.org/private/zg3pjzftx12urvufkfdbjw

b-man commented 11 years ago

Until this gets resolved, try appending "-I${path to xnu-deps-linux}/headers/include/foreign" to CFLAGS in /SETUP/setsegname/Makefile. This should fix your issue.

wargio commented 11 years ago

good :D my advice is to add it in the readme: make TARGET_CONFIGS="debug arm armpba8" MAKEJOBS= SDKVERSION=10.7 HOST_CC=clang HOST_YACC=yacc \ HOST_BISON=bison HOST_FLEX=flex HOST_CODESIGN=/bin/true BUILD_NO_DEBUG=1 DEPLOYMENT_TARGET_FLAGS= \ RC_CFLAGS="-Darm -DARM -I${path to xnu-deps-linux}/headers/include/foreign" MIG=/usr/bin/mig CC=clang CXX=clang++ RC_CFLAGS="-target arm-apple-darwin11" \ VERBOSE=YES RC_LDFLAGS="-target arm-apple-darwin11 /usr/lib/libclang_rt.cc_kext.a" \ STRIP="arm-apple-darwin11-strip" then add an extra "value" inside the makefile for LINUX builing. something like: $(LINUX_CFLAGS) in that way if the value is not set, it will simply not read it, then if the value is set, it will fix that problems under linux

wargio commented 11 years ago

Well, it fails again because there is no swap.h under mach-o folder

winocm commented 11 years ago

I don't think RC_CFLAGS is for host utilities.

Sent from my iPhone

On Sep 22, 2013, at 5:02 AM, Giovanni notifications@github.com wrote:

Well, it fails again because there is no swap.h under mach-o folder

— Reply to this email directly or view it on GitHub.

wargio commented 11 years ago

no. it's a wrong use for that, i've just added the correct path to that makefile and it worked, but it fails since there is no swap.h under mach-o then i have thousand of other problems like double definitions or similar

winocm commented 11 years ago

Usually, I just stick it into /usr/include.

Sent from my iPhone

On Sep 22, 2013, at 10:28 AM, Giovanni notifications@github.com wrote:

no. it's a wrong use for that, i've just added the correct path to that makefile and it worked, but it fails since there is no swap.h under mach-o then i have thousand of other problems like double definitions or similar

— Reply to this email directly or view it on GitHub.

wargio commented 11 years ago

well, i've created a $XNUDEV folder with the exports, then i have put all the XNU stuff (elfs and the includes) there to not messed up the os. but i have lots of multiple definitions -_-

b-man commented 11 years ago

To help avoid this issue, I've made xnu-deps-linux build setsegname as a separate tool instead. (setsegname was originally a part of kext_tools, but apple decided to include it as part of xnu's source tree for some reason)

Until xnu's build system is changed to be more linux-aware, you'll need to modify SEG_HACK in makedefs/MakeInc.cmd in xnu to reflect this change.

b-man commented 11 years ago

And also remove setsegname under SETUP_SUBDIRS in SETUP/Makefile to exclude it from xnu build.

wargio commented 11 years ago

ok, seems that in that way i can build it, but now its stops again xD seems that it fails to generate the DEBUG folders inside the BUILD dir. an example: there is no /BUILD/obj//DEBUG_ARM_ARMPBA8/iokit/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/osfmk/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/bsd/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/pexpert/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/libkern/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/libsa/DEBUG /BUILD/obj//DEBUG_ARM_ARMPBA8/security/DEBUG and doconf fails on these folders by saying: /bin/sh: 7: [xnu path]/SETUP/config/doconf: not found then it completely stops by saying: make[2]: *\ no rule to make target "/media/ps3dev/xnu-rms/BUILD/obj//DEBUG_ARM_ARMPBA8/./osfmk/DEBUG/osfmk.filelist", needed by "/media/ps3dev/xnu-rms/BUILD/obj//DEBUG_ARM_ARMPBA8/./mach_kernel". Stop.

am i the only one that is building xnu under linux? xD

winocm commented 11 years ago

Use this chroot tarball: http://winocmbox.cloudapp.net/linux_x86_64_ubuntu_1304_xnu_chroot.tar.bz2

It's x86_64 only, source is in /home/rms.

wargio commented 11 years ago

it works :D :D :D

winocm commented 11 years ago

ok

musisat commented 9 years ago

@winocm Could you possibly link that tarball again? Or is it not relevant anymore?