use nproc in gcc port; update change_sysroot

This commit is contained in:
nakst 2021-12-15 10:52:37 +00:00
parent e95c9fb15f
commit a28bdd4da0
2 changed files with 15 additions and 9 deletions

View File

@ -157,7 +157,7 @@ export gl_cv_func_working_strerror="yes"
mkdir bin/build-gmp
cd bin/build-gmp
../gmp-src/configure --host=x86_64-essence --prefix=/Applications/POSIX --without-readline CC=x86_64-essence-gcc CXX=x86_64-essence-g++
make
make -j`nproc`
make DESTDIR=$SYSROOT install
cd ../..
rm -rf bin/build-gmp
@ -165,7 +165,7 @@ rm -rf bin/build-gmp
mkdir bin/build-mpfr
cd bin/build-mpfr
../mpfr-src/configure --host=x86_64-essence --prefix=/Applications/POSIX CC=x86_64-essence-gcc CXX=x86_64-essence-g++
make
make -j`nproc`
make DESTDIR=$SYSROOT install
cd ../..
rm -rf bin/build-mpfr
@ -173,7 +173,7 @@ rm -rf bin/build-mpfr
mkdir bin/build-mpc
cd bin/build-mpc
../mpc-src/configure --host=x86_64-essence --prefix=/Applications/POSIX CC=x86_64-essence-gcc CXX=x86_64-essence-g++
make
make -j`nproc`
make DESTDIR=$SYSROOT install
cd ../..
rm -rf bin/build-mpc
@ -181,7 +181,7 @@ rm -rf bin/build-mpc
mkdir bin/build-binutils
cd bin/build-binutils
../binutils-src/configure --host=x86_64-essence --target=x86_64-essence --prefix=/Applications/POSIX --with-local-prefix=/Applications/POSIX/local --with-build-sysroot=$SYSROOT --without-isl --disable-nls --disable-werror --without-target-bdw-gc CC=x86_64-essence-gcc CXX=x86_64-essence-g++
make -j4
make -j`nproc`
make DESTDIR=$SYSROOT install
cd ../..
rm -rf bin/build-binutils
@ -189,8 +189,8 @@ rm -rf bin/build-binutils
mkdir bin/build-gcc
cd bin/build-gcc
../gcc-src/configure --host=x86_64-essence --target=x86_64-essence --prefix=/Applications/POSIX --with-local-prefix=/Applications/POSIX/local --with-build-sysroot=$SYSROOT --without-isl --disable-nls --disable-werror --without-target-bdw-gc --enable-languages=c,c++ CC=x86_64-essence-gcc CXX=x86_64-essence-g++ LD=x86_64-essence-ld
make all-gcc -j4
make all-target-libgcc
make all-gcc -j`nproc`
make all-target-libgcc -j`nproc`
make DESTDIR=$SYSROOT install-strip-gcc
make DESTDIR=$SYSROOT install-target-libgcc
cd ../..

View File

@ -102,9 +102,16 @@ int main(int argc, char **argv) {
while (true) {
struct user_regs_struct registers = { 0 };
int status;
pid_t pid = waitpid(-1, &status, 0);
pid_t pid = waitpid(-1, 0, 0);
ptrace(PTRACE_GETREGS, pid, 0, &registers);
if (ptrace(PTRACE_GETREGS, pid, 0, &registers) == -1) {
if (pid == basePID) {
return WEXITSTATUS(status);
} else {
continue;
}
}
if (registers.orig_rax == SYS_access
|| registers.orig_rax == SYS_chown
@ -161,7 +168,6 @@ int main(int argc, char **argv) {
printf("unhandled syscall %llu\n", registers.orig_rax);
}
int status;
ptrace(PTRACE_SYSCALL, pid, 0, 0);
waitpid(pid, &status, 0);