├── patch ├── libelf.patch ├── binutils.patch └── gcc.patch └── README.md /patch/libelf.patch: -------------------------------------------------------------------------------- 1 | diff -ru libelf-0.8.13-orig/configure libelf-0.8.13/configure 2 | --- libelf-0.8.13-orig/configure 2015-08-19 18:51:37.000000000 +0400 3 | +++ libelf-0.8.13/configure 2015-09-22 20:37:30.000000000 +0400 4 | @@ -1595,7 +1595,7 @@ 5 | echo $ac_n "(cached) $ac_c" 1>&6 6 | else 7 | if test "$cross_compiling" = yes; then 8 | - ac_cv_sizeof_long_long=0 9 | + ac_cv_sizeof_long_long=8 10 | else 11 | cat > conftest.$ac_ext < binutils.patch 2 | --- orig.binutils/ld/scripttempl/elf.sc 2016-09-30 21:06:08.000000000 +0200 3 | +++ binutils/ld/scripttempl/elf.sc 2016-09-30 21:21:06.000000000 +0200 4 | @@ -553,7 +553,8 @@ 5 | ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}} 6 | ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} 7 | ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} 8 | - 9 | + /* Hacky hackity hack. Need this because otherwise data segment is not aligned enough. */ 10 | + . = ALIGN(0x10000); 11 | /* Exception handling */ 12 | .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} } 13 | .gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) } 14 | -------------------------------------------------------------------------------- /patch/gcc.patch: -------------------------------------------------------------------------------- 1 | diff -ur gcc-6.2.0-orig/gcc/config/arm/arm-c.c gcc-6.2.0/gcc/config/arm/arm-c.c 2 | --- gcc-6.2.0-orig/gcc/config/arm/arm-c.c 2016-02-24 16:19:12.000000000 +0800 3 | +++ gcc-6.2.0/gcc/config/arm/arm-c.c 2016-09-05 12:36:27.548356500 +0800 4 | @@ -62,6 +62,8 @@ 5 | static void 6 | arm_cpu_builtins (struct cpp_reader* pfile) 7 | { 8 | + builtin_define ("__vita__"); 9 | + 10 | def_or_undef_macro (pfile, "__ARM_FEATURE_DSP", TARGET_DSP_MULTIPLY); 11 | def_or_undef_macro (pfile, "__ARM_FEATURE_QBIT", TARGET_ARM_QBIT); 12 | def_or_undef_macro (pfile, "__ARM_FEATURE_SAT", TARGET_ARM_SAT); 13 | diff -ur gcc-6.2.0-orig/gcc/gcc.c gcc-6.2.0/gcc/gcc.c 14 | --- gcc-6.2.0-orig/gcc/gcc.c 2016-08-15 19:19:34.000000000 +0800 15 | +++ gcc-6.2.0/gcc/gcc.c 2016-09-05 12:33:17.920479300 +0800 16 | @@ -658,8 +658,9 @@ 17 | #endif 18 | 19 | /* config.h can define LIB_SPEC to override the default libraries. */ 20 | +#undef LIB_SPEC 21 | #ifndef LIB_SPEC 22 | -#define LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}" 23 | +#define LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} -lSceRtc_stub -lSceKernel_stub -lSceNet_stub" 24 | #endif 25 | 26 | /* When using -fsplit-stack we need to wrap pthread_create, in order -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vitasdk-macOS 2 | PlayStation Vita development under macOS Sierra 3 | =============================================== 4 | 5 | ============== 6 | Why use macOS? 7 | ============== 8 | 9 | I have been developing homebrew stuff for PlayStation platform since last 15 years and since my first Apple laptop with Osx Panther (2003) it has been my development platform. I don't like open a virtual machine with linux or windows to develop, i like more use all directily in my Mac, so for me it is the best option. 10 | 11 | 12 | ============== 13 | Steps 14 | ============== 15 | 16 | 1) Install macOS Sierra. 17 | 18 | I made a clean installation because i like more a fresh install instead of upgrade. I was in Os X Maverick so first i always make a copy of my system in external disk with carbon copy cloner and then check that i can boot from it before install new operating system. You can follow many guides on internet to do it. 19 | 20 | 2) Install Xcode 21 | 22 | Go to apple appstore download and install Xcode (Version 8) 23 | 24 | 3) Install Xcode command line tools 25 | 26 | Go to apple developer site and download and install Command Line Tools (macOS 10.12) for Xcode 8 package 27 | 28 | 4) Install some misc tools that i use often 29 | 30 | * XQuartz from https://www.xquartz.org/index.html 31 | * TextMate from https://macromates.com/ 32 | * iTerm from https://www.iterm2.com/ 33 | * Enable root account (Open Directory Utility in drop down "Edit Menu" enable root user and it will ask you to set a password for root user) 34 | 35 | 5) Install macports (other people use homebrew instead) 36 | 37 | Go to https://www.macports.org/install.php and follow steps described for macOS Sierra 38 | 39 | 40 | ``` 41 | sudo port -v selfupdate 42 | 43 | sudo port install autoconf automake bison flex texinfo ncurses wget libelf zlib libtool git gmp openssl mpfr libmpc unrar subversion bzip2 cmake pkgconfig go python34 44 | 45 | ``` 46 | 47 | 6) Create base directory for vitadev and clone repositories 48 | 49 | ``` 50 | cd /usr/local 51 | sudo mkdir -p vitadev/git 52 | sudo chown -R youruser:staff vitadev 53 | cd vitadev/git 54 | git clone http://github.com/xerpi/libvita2d 55 | git clone http://github.com/xerpi/libftpvita 56 | git clone http://github.com/xerpi/vita_portlibs 57 | git clone http://github.com/frangarcj/psplib4vita 58 | git clone http://github.com/psxdev/debugnet 59 | git clone http://github.com/psxdev/psp2link 60 | git clone http://github.com/psxdev/psp2client 61 | git clone http://github.com/psxdev/vitasdk-macOS 62 | ``` 63 | 64 | 7) Build toolchain and sdk 65 | 66 | ``` 67 | cd vitasdk-macOS 68 | ./build_macOS.sh 69 | ``` 70 | 71 | 8) Install toolchain and sdk 72 | 73 | ``` 74 | cd vitasdk 75 | cp -r bin /usr/local/vitadev 76 | cp -r arm-vita-eabi /usr/local/vitadev 77 | cp -r lib /usr/local/vitadev 78 | cp -r share /usr/local/vitadev 79 | ``` 80 | 81 | 9) Prepare profile with environment 82 | 83 | I use this script vitadev.sh in /usr/local/vitadev customize your own 84 | 85 | ``` 86 | cat /usr/local/vitadev.sh 87 | export VITADEV=/usr/local/vitadev 88 | export VITASDK=/usr/local/vitadev 89 | export PATH=$VITASDK/bin:$PATH 90 | export PSVITAIP=192.168.1.24 91 | ``` 92 | 93 | 10) Development session :) 94 | 95 | ``` 96 | cd /usr/local/vitadev 97 | . ./vitadev.sh 98 | cd git 99 | cd vita_portlibs 100 | make 101 | cd ../libvita2d/libvita2d 102 | make 103 | make install 104 | cd ../../libftpvita/libftpvita 105 | make 106 | make install 107 | cd ../../psplib4vita/psplib 108 | make 109 | make install 110 | cd ../../debugnet/libdebugnet 111 | make 112 | make install 113 | cd ../../psp2link/libpsp2link 114 | make 115 | make install 116 | ``` 117 | 118 | 11) Ready to have a lot of fun :) 119 | 120 | ============== 121 | Versions of software downloaded internally by build proccess 122 | ============== 123 | * http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz 124 | * http://ftp.gnu.org/gnu/gmp/gmp-6.1.1.tar.xz 125 | * http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.xz 126 | * http://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz 127 | * git://sourceware.org/git/binutils-gdb.git 128 | * http://ftp.gnu.org/gnu/gcc/gcc-6.2.0/gcc-6.2.0.tar.bz2 129 | * http://www.mr511.de/software/libelf-1.2.8.tar.gz 130 | * http://isl.gforge.inria.fr/isl-0.17.1.tar.xz 131 | * http://nih.at/libzip/libzip-1.1.3.tar.xz 132 | * http://zlib.net/zlib-1.2.8.tar.xz 133 | * http://github.com/akheron/jansson/archive/v2.8.tar.gz 134 | * http://github.com/vitasdk/vita-headers 135 | * http://github.com/vitasdk/newlib 136 | * http://github.com/vitasdk/pthread-embedded 137 | * http://github.com/vitasdk/vita-toolchain 138 | 139 | 140 | ============== 141 | Credits 142 | ============== 143 | 144 | * Based in soarqin good work at https://github.com/soarqin/vitasdk-msys2 145 | * Previous work for osx at https://github.com/psxdev/vitasdk-buildscripts 146 | 147 | --------------------------------------------------------------------------------