Skip to content

Commit

Permalink
Improve musl compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed Apr 1, 2021
1 parent 24db261 commit e2eccd2
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions stage1-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@ set -e
ROOT=${PWD}
PS4SDK=$ROOT/toolchain
PROC_NR=$(getconf _NPROCESSORS_ONLN)
GIT_REFERENCE=${1:-master}

rm -rf musl
mkdir musl
cd musl
## Download the source code.
REPO_URL="https://github.com/orbisdev/musl"
REPO_FOLDER="musl"
BRANCH_NAME="master"
if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || exit 1
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || exit 1
fi

git init
git remote add origin https://github.com/orbisdev/musl
git fetch --depth 1 origin ${GIT_REFERENCE}
git checkout FETCH_HEAD
# Print latest commits
git log

## Configure
CC=clang CFLAGS=--target=x86_64-scei-ps4 ./configure --disable-shared --prefix=$PS4SDK/usr --target=orbis
make -j $PROC_NR
make install

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR || { exit 1; }
make --quiet -j $PROC_NR install || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }

0 comments on commit e2eccd2

Please sign in to comment.