From 95162014754fca037510884f5a3c0c73988cd902 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Jun 09 2016 18:58:37 +0000 Subject: Adds and integrates slibtool: - Adds ${PKG_SLIBTOOL}. - pkg.build: export ${MAKE} as `make LIBTOOL=${PKG_SLIBTOOL}'. - binutils{_host,}: use slibtool-static. - git: add NEEDS_SSL_WITH_CURL=1 to ${PKG_GIT_MAKEFLAGS_BUILD_EXTRA}. - pacman-5.0.1: add `LIBALPM_LIBS=-lssl -lbz2 -llzma -lz' to ${PKG_PACMAN_ENV_VARS_EXTRA}; Makefile.am patch. Introduces 32-bit (i686-nt32-midipix) support, selected by ARCH=nt32 and defaulting to 64-bit builds: - Create ${PREFIX_TARGET}/lib. - Remove ${PREFIX_TARGET} when cleaning the prefix if -c has been specified. - Set ${HOST_NATIVE}, ${TARGET}, and ${TARBALL_{SRC_,}FNAME_PREFIX} from ${ARCH}. - pkg.build: use ${TARGET}-dlltool instead of x86_64-nt64-midipix-dlltool. - glib-2.46.2: broken at present. - libffi-3.2.1/src/x86/win32.S: fix symbol prefix. - musl-1.1.12/arch/nt32/bits/syscall.h: copied from musl-1.1.12/arch/nt64/bits/syscall.h. - perl-5.22.1: Set --target from ${TARGET}. Bug fixes: - psxstub: make {_,__}so_entry_point weak symbols to express preference for the real psxscl shared object. - bash-4.3: fix lib/intl/libgnuintl.h issue. - libarchive-3.1.2: import FreeBSD-SA-16:23.libarchive and FreeBSD-SA-16:22.libarchive security fixes. Include all directories beneath ${WORKDIR} in the source tarball. Updated TODO list at the end of README. --- diff --git a/001.binutils_host.build b/001.binutils_host.build deleted file mode 120000 index 52bb82e..0000000 --- a/001.binutils_host.build +++ /dev/null @@ -1 +0,0 @@ -pkg.build \ No newline at end of file diff --git a/001.slibtool.build b/001.slibtool.build new file mode 120000 index 0000000..52bb82e --- /dev/null +++ b/001.slibtool.build @@ -0,0 +1 @@ +pkg.build \ No newline at end of file diff --git a/002.binutils_host.build b/002.binutils_host.build new file mode 120000 index 0000000..52bb82e --- /dev/null +++ b/002.binutils_host.build @@ -0,0 +1 @@ +pkg.build \ No newline at end of file diff --git a/002.gcc.stage1.build b/002.gcc.stage1.build deleted file mode 120000 index 27fad42..0000000 --- a/002.gcc.stage1.build +++ /dev/null @@ -1 +0,0 @@ -007.gcc.full.build \ No newline at end of file diff --git a/003.gcc.stage1.build b/003.gcc.stage1.build new file mode 120000 index 0000000..c3b435d --- /dev/null +++ b/003.gcc.stage1.build @@ -0,0 +1 @@ +008.gcc.full.build \ No newline at end of file diff --git a/003.psxstub.build b/003.psxstub.build deleted file mode 120000 index 52bb82e..0000000 --- a/003.psxstub.build +++ /dev/null @@ -1 +0,0 @@ -pkg.build \ No newline at end of file diff --git a/003.psxstub.vars b/003.psxstub.vars deleted file mode 100644 index 991f72a..0000000 --- a/003.psxstub.vars +++ /dev/null @@ -1,16 +0,0 @@ -# -# . ./build.vars and set -o errexit are assumed. -# - -pkg_psxstub_finish() { - if ! is_build_script_done install; then - if [ "${TARGET}" = i686-nt32-midipix ]\ - || [ "${TARGET}" = x86_64-nt64-midipix ]; then - cd psxstub; - make ${MAKEFLAGS} DESTDIR=${PREFIX_LVL} TARGET=${TARGET} install; - set_build_script_done install finish; - fi; - fi; -}; - -# vim:filetype=sh diff --git a/004.musl.no-complex.build b/004.musl.no-complex.build deleted file mode 120000 index 59c5eff..0000000 --- a/004.musl.no-complex.build +++ /dev/null @@ -1 +0,0 @@ -006.musl.full.build \ No newline at end of file diff --git a/004.psxstub.build b/004.psxstub.build new file mode 120000 index 0000000..52bb82e --- /dev/null +++ b/004.psxstub.build @@ -0,0 +1 @@ +pkg.build \ No newline at end of file diff --git a/004.psxstub.vars b/004.psxstub.vars new file mode 100644 index 0000000..77c41c5 --- /dev/null +++ b/004.psxstub.vars @@ -0,0 +1,21 @@ +# +# . ./build.vars and set -o errexit are assumed. +# + +pkg_psxstub_finish() { + if ! is_build_script_done patch; then + patch -b -d psxstub -p1 \ + < ${MIDIPIX_BUILD_PWD}/psxstub.local.patch; + set_build_script_done patch -install; + fi; + if ! is_build_script_done install; then + if [ "${TARGET}" = i686-nt32-midipix ] \ + || [ "${TARGET}" = x86_64-nt64-midipix ]; then + cd psxstub; + make ${MAKEFLAGS} DESTDIR=${PREFIX_LVL} TARGET=${TARGET} install; + set_build_script_done install finish; + fi; + fi; +}; + +# vim:filetype=sh diff --git a/005.gcc.runtime.build b/005.gcc.runtime.build deleted file mode 120000 index 27fad42..0000000 --- a/005.gcc.runtime.build +++ /dev/null @@ -1 +0,0 @@ -007.gcc.full.build \ No newline at end of file diff --git a/005.musl.no-complex.build b/005.musl.no-complex.build new file mode 120000 index 0000000..5455612 --- /dev/null +++ b/005.musl.no-complex.build @@ -0,0 +1 @@ +007.musl.full.build \ No newline at end of file diff --git a/006.gcc.runtime.build b/006.gcc.runtime.build new file mode 120000 index 0000000..c3b435d --- /dev/null +++ b/006.gcc.runtime.build @@ -0,0 +1 @@ +008.gcc.full.build \ No newline at end of file diff --git a/006.musl.full.build b/006.musl.full.build deleted file mode 100644 index ce5855c..0000000 --- a/006.musl.full.build +++ /dev/null @@ -1,63 +0,0 @@ -# -# . ./build.vars and set -o errexit are assumed. -# - -# Order: no-complex, native - -export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET}; - -if [ "${3}" = no-complex ]; then - # Musl: build (no-complex) - _install=install_no_complex; - set_build_dir musl-${PKG_MUSL_VERSION}-${3} cross; - if ! is_build_script_done fetch; then - fetch http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz \ - ${PKG_MUSL_SHA256SUM}; - [ ${ARG_NO_DOWNLOAD:-0} -eq 0 ] &&\ - rm_if_exists mmglue; - fetch_git mmglue ${GITROOT}/mmglue; - set_build_script_done fetch -extract; - fi; - if ! is_build_script_done extract; then - rm_if_exists musl-${PKG_MUSL_VERSION}; - tar -xf musl-${PKG_MUSL_VERSION}.tar.gz; - cp -R mmglue/* musl-${PKG_MUSL_VERSION}/; - set_build_script_done extract -configure; - fi; -elif [ "${3}" = native ]; then - # Musl: build (full) - _install=install; - set_build_dir musl-${PKG_MUSL_VERSION} "${3}"; -elif [ "${3}" = full ]; then - # Musl: build (full) - _install=install; - set_build_dir musl-${PKG_MUSL_VERSION} cross; -fi; -if ! is_build_script_done configure; then - rm_if_exists -m -c ${PKG_BUILD_DIR}; - env lz_cflags_cmdline="${PKG_MUSL_CFLAGS_CONFIGURE_EXTRA}"\ - ../lazy/lazy \ - -a ${ARCH} \ - -c gcc \ - -f ${PREFIX_LVL} \ - -n musl \ - -p ../musl-${PKG_MUSL_VERSION} \ - -t ${lz_target} \ - -x config; - set_build_script_done configure clean -build; -else - cd ${PKG_BUILD_DIR}; -fi; -if ! is_build_script_done clean; then - make ${MAKEFLAGS} clean; - set_build_script_done clean -build; -fi; -if ! is_build_script_done build; then - ./lazy -e ${_install} \ - -x build; - [ "${3}" = native ] && \ - ln -sf ../lib/libc.so ${PREFIX_LVL}/bin/ldd; - set_build_script_done build finish; -fi; - -# vim:filetype=sh diff --git a/007.gcc.full.build b/007.gcc.full.build deleted file mode 100644 index 066f6d3..0000000 --- a/007.gcc.full.build +++ /dev/null @@ -1,147 +0,0 @@ -# -# . ./build.vars and set -o errexit are assumed. -# - -# Order: stage1, runtime, full, native - -if [ "${3}" = runtime ]\ -|| [ "${3}" = full ]; then - set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; - cd ${PKG_BUILD_DIR}; - if [ "${3}" = runtime ]; then - # GCC, compiler runtime. - if ! is_build_script_done build; then - make ${MAKEFLAGS} all-target-libgcc; - set_build_script_done build -install; - fi; - if ! is_build_script_done install; then - make ${MAKEFLAGS} install-target-libgcc; - set_build_script_done install finish; - fi; - elif [ "${3}" = full ]; then - # GCC, everything else. - if ! is_build_script_done build1; then - make ${MAKEFLAGS} all-target-libstdc++-v3; - set_build_script_done build1 -install1; - fi; - if ! is_build_script_done install1; then - make ${MAKEFLAGS} install-target-libstdc++-v3; - set_build_script_done install1 -build2; - fi; - if ! is_build_script_done build2; then - make ${MAKEFLAGS}; - set_build_script_done build2 -install2; - fi; - if ! is_build_script_done install2; then - make ${MAKEFLAGS} install; - set_build_script_done install2 finish; - fi; - fi; -else - if [ "${3}" = stage1 ]; then - # GCC, stage1. - if ! is_build_script_done fetch; then - fetch_git cbb-gcc-${PKG_GCC_VERSION} \ - ${GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}; - set_build_script_done fetch -configure; - fi; - set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; - export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \ - cbb_sysroot_for_libgcc=${PREFIX_LVL} \ - cbb_target=${TARGET} \ - cbb_neutral_libiberty=no \ - cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; - GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}"; - elif [ "${3}" = native ]; then - # GCC, native. - set_build_dir cbb-gcc-${PKG_GCC_VERSION} native; - export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \ - cbb_sysroot_for_libgcc=${PREFIX_LVL} \ - cbb_target=${TARGET} \ - cbb_xgcc_for_specs=${TARGET}-gcc; - GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}"; - fi; - GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${PKG_GCC_VERSION}/libc/cbb-musl-pe.h)"; - set_env_vars "${GCCFLAGS}" CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; - set_env_vars "${GCCTARGET_FLAGS}" CFLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET; - set_env_vars "${CFLAGS_FOR_BUILD}" cbb_cflags_for_stage1 cbb_cflags_for_stage2 cbb_cflags_for_stage3 cbb_cflags_for_stage4; - export CFLAGS CXXFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET; - if ! is_build_script_done configure; then - if [ "${3}" = stage1 ]; then - mkdir -p ${PREFIX_LVL}/include; - [ \! -d ${PREFIX_LVL}/usr ] && \ - ln -s . ${PREFIX_LVL}/usr; - _configure_args="--prefix=${PREFIX} --with-sysroot=${PREFIX_LVL}"; - elif [ "${3}" = native ]; then - mkdir -p ${PREFIX_LVL}/${TARGET}; - if [ \! -d ${PREFIX_LVL}/${TARGET}/usr ]; then - ln -s . ${PREFIX_LVL}/${TARGET}/usr; - fi; - _configure_args=" \ - --host=x86_64-nt64-midipix \ - --prefix=/ \ - --with-elf=${PREFIX_LVL} \ - --with-gmp=${PREFIX_LVL} \ - --with-mpc=${PREFIX_LVL} \ - --with-mpfr=${PREFIX_LVL} \ - --with-sysroot="; - fi; - rm_if_exists -m -c ${PKG_BUILD_DIR}; - ../cbb-gcc-${PKG_GCC_VERSION}/configure \ - --disable-bootstrap \ - --disable-libmudflap \ - --disable-multilib \ - --disable-nls \ - --disable-obsolete \ - --disable-sjlj-exceptions \ - --disable-symvers \ - --enable-canonical-system-headers \ - --enable-__cxa_atexit \ - --enable-debug \ - --enable-gnu-indirect-function \ - --enable-gnu-unique-object \ - --enable-initfini-array \ - --enable-languages=c,c++,objc,lto \ - --enable-libstdcxx-debug \ - --enable-lto \ - --enable-multiarch \ - --enable-secureplt \ - --enable-shared \ - --enable-threads=posix \ - --target=${TARGET} \ - --with-fpmath=sse \ - ${_configure_args}; - set_build_script_done configure clean -build; - else - cd ${PKG_BUILD_DIR}; - fi; - if ! is_build_script_done clean; then - make ${MAKEFLAGS} clean; - set_build_script_done clean -build; - fi; - if ! is_build_script_done build; then - if [ "${3}" = stage1 ]; then - make ${MAKEFLAGS} all-gcc; - elif [ "${3}" = native ]; then - make ${MAKEFLAGS} all-gcc; - make ${MAKEFLAGS} all-target-libgcc; - make ${MAKEFLAGS} all-target-libstdc++-v3; - make ${MAKEFLAGS} all; - fi; - set_build_script_done build -install; - fi; - if ! is_build_script_done install; then - if [ "${3}" = stage1 ]; then - make ${MAKEFLAGS} install-gcc; - if match_uname_any CYGWIN\*; then - ln -s ${PREFIX}/libexec/gcc/${TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a \ - ln -s ${PREFIX}/libexec/gcc/${TARGET}/${PKG_GCC_VERSION}/liblto_plugin.so; - fi; - elif [ "${3}" = native ]; then - make ${MAKEFLAGS} DESTDIR=${PREFIX_LVL} install; - fi; - set_build_script_done install finish; - fi; -fi; - -# vim:filetype=sh diff --git a/007.musl.full.build b/007.musl.full.build new file mode 100644 index 0000000..6de1540 --- /dev/null +++ b/007.musl.full.build @@ -0,0 +1,68 @@ +# +# . ./build.vars and set -o errexit are assumed. +# + +# Order: no-complex, native + +export lz_arch=${ARCH} lz_cflags_debug=-O2 lz_target=${TARGET}; + +if [ "${3}" = no-complex ]; then + # Musl: build (no-complex) + _install=install_no_complex; + set_build_dir musl-${PKG_MUSL_VERSION}-${3} cross; + if ! is_build_script_done fetch; then + fetch http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz \ + ${PKG_MUSL_SHA256SUM}; + [ ${ARG_NO_DOWNLOAD:-0} -eq 0 ] &&\ + rm_if_exists mmglue; + fetch_git mmglue ${GITROOT}/mmglue; + set_build_script_done fetch -extract; + fi; + if ! is_build_script_done extract; then + rm_if_exists musl-${PKG_MUSL_VERSION}; + tar -xf musl-${PKG_MUSL_VERSION}.tar.gz; + cp -R mmglue/* musl-${PKG_MUSL_VERSION}/; + set_build_script_done extract -patch; + fi; + if ! is_build_script_done patch; then + patch -b -d musl-${PKG_MUSL_VERSION} -p1 \ + < ${MIDIPIX_BUILD_PWD}/musl-${PKG_MUSL_VERSION}.local.patch; + set_build_script_done patch -configure; + fi; +elif [ "${3}" = native ]; then + # Musl: build (full) + _install=install; + set_build_dir musl-${PKG_MUSL_VERSION} "${3}"; +elif [ "${3}" = full ]; then + # Musl: build (full) + _install=install; + set_build_dir musl-${PKG_MUSL_VERSION} cross; +fi; +if ! is_build_script_done configure; then + rm_if_exists -m -c ${PKG_BUILD_DIR}; + env lz_cflags_cmdline="${PKG_MUSL_CFLAGS_CONFIGURE_EXTRA}"\ + ../lazy/lazy \ + -a ${ARCH} \ + -c gcc \ + -f ${PREFIX_LVL} \ + -n musl \ + -p ../musl-${PKG_MUSL_VERSION} \ + -t ${lz_target} \ + -x config; + set_build_script_done configure clean -build; +else + cd ${PKG_BUILD_DIR}; +fi; +if ! is_build_script_done clean; then + make ${MAKEFLAGS} clean; + set_build_script_done clean -build; +fi; +if ! is_build_script_done build; then + ./lazy -e ${_install} \ + -x build; + [ "${3}" = native ] && \ + ln -sf ../lib/libc.so ${PREFIX_LVL}/bin/ldd; + set_build_script_done build finish; +fi; + +# vim:filetype=sh diff --git a/008.gcc.full.build b/008.gcc.full.build new file mode 100644 index 0000000..4c7f6f2 --- /dev/null +++ b/008.gcc.full.build @@ -0,0 +1,151 @@ +# +# . ./build.vars and set -o errexit are assumed. +# + +# Order: stage1, runtime, full, native + +if [ "${3}" = runtime ]\ +|| [ "${3}" = full ]; then + set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; + cd ${PKG_BUILD_DIR}; + if [ "${3}" = runtime ]; then + # GCC, compiler runtime. + if ! is_build_script_done build; then + make ${MAKEFLAGS} all-target-libgcc; + set_build_script_done build -install; + fi; + if ! is_build_script_done install; then + make ${MAKEFLAGS} install-target-libgcc; + set_build_script_done install finish; + fi; + elif [ "${3}" = full ]; then + # GCC, everything else. + if ! is_build_script_done build1; then + make ${MAKEFLAGS} all-target-libstdc++-v3; + set_build_script_done build1 -install1; + fi; + if ! is_build_script_done install1; then + make ${MAKEFLAGS} install-target-libstdc++-v3; + set_build_script_done install1 -build2; + fi; + if ! is_build_script_done build2; then + make ${MAKEFLAGS}; + set_build_script_done build2 -install2; + fi; + if ! is_build_script_done install2; then + make ${MAKEFLAGS} install; + set_build_script_done install2 finish; + fi; + fi; +else + if [ "${3}" = stage1 ]; then + # GCC, stage1. + if ! is_build_script_done fetch; then + fetch_git cbb-gcc-${PKG_GCC_VERSION} \ + ${GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}; + set_build_script_done fetch -configure; + fi; + set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; + export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \ + cbb_sysroot_for_libgcc=${PREFIX_LVL} \ + cbb_target=${TARGET} \ + cbb_neutral_libiberty=no \ + cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}"; + elif [ "${3}" = native ]; then + # GCC, native. + set_build_dir cbb-gcc-${PKG_GCC_VERSION} native; + export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \ + cbb_sysroot_for_libgcc=${PREFIX_LVL} \ + cbb_target=${TARGET} \ + cbb_xgcc_for_specs=${TARGET}-gcc; + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}"; + fi; + GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${PKG_GCC_VERSION}/libc/cbb-musl-pe.h)"; + set_env_vars "${GCCFLAGS}" CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; + set_env_vars "${GCCTARGET_FLAGS}" CFLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET; + set_env_vars "${CFLAGS_FOR_BUILD}" cbb_cflags_for_stage1 cbb_cflags_for_stage2 cbb_cflags_for_stage3 cbb_cflags_for_stage4; + export CFLAGS CXXFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET; + if ! is_build_script_done configure; then + if [ "${3}" = stage1 ]; then + mkdir -p ${PREFIX_LVL}/include; + [ \! -d ${PREFIX_LVL}/usr ] && \ + ln -s . ${PREFIX_LVL}/usr; + _configure_args="--prefix=${PREFIX} --with-sysroot=${PREFIX_LVL}"; + elif [ "${3}" = native ]; then + mkdir -p ${PREFIX_LVL}/${TARGET}; + if [ \! -d ${PREFIX_LVL}/${TARGET}/usr ]; then + ln -s . ${PREFIX_LVL}/${TARGET}/usr; + fi; + if [ "${ARCH}" = nt32 ]; then + _configure_args="--host=i686-nt32-midipix"; + else + _configure_args="--host=x86_64-nt64-midipix"; + fi; + _configure_args="${_configure_args} \ + --prefix=/ \ + --with-elf=${PREFIX_LVL} \ + --with-gmp=${PREFIX_LVL} \ + --with-mpc=${PREFIX_LVL} \ + --with-mpfr=${PREFIX_LVL} \ + --with-sysroot="; + fi; + rm_if_exists -m -c ${PKG_BUILD_DIR}; + ../cbb-gcc-${PKG_GCC_VERSION}/configure \ + --disable-bootstrap \ + --disable-libmudflap \ + --disable-multilib \ + --disable-nls \ + --disable-obsolete \ + --disable-sjlj-exceptions \ + --disable-symvers \ + --enable-canonical-system-headers \ + --enable-__cxa_atexit \ + --enable-debug \ + --enable-gnu-indirect-function \ + --enable-gnu-unique-object \ + --enable-initfini-array \ + --enable-languages=c,c++,objc,lto \ + --enable-libstdcxx-debug \ + --enable-lto \ + --enable-multiarch \ + --enable-secureplt \ + --enable-shared \ + --enable-threads=posix \ + --target=${TARGET} \ + --with-fpmath=sse \ + ${_configure_args}; + set_build_script_done configure clean -build; + else + cd ${PKG_BUILD_DIR}; + fi; + if ! is_build_script_done clean; then + make ${MAKEFLAGS} clean; + set_build_script_done clean -build; + fi; + if ! is_build_script_done build; then + if [ "${3}" = stage1 ]; then + make ${MAKEFLAGS} all-gcc; + elif [ "${3}" = native ]; then + make ${MAKEFLAGS} all-gcc; + make ${MAKEFLAGS} all-target-libgcc; + make ${MAKEFLAGS} all-target-libstdc++-v3; + make ${MAKEFLAGS} all; + fi; + set_build_script_done build -install; + fi; + if ! is_build_script_done install; then + if [ "${3}" = stage1 ]; then + make ${MAKEFLAGS} install-gcc; + if match_uname_any CYGWIN\*; then + ln -s ${PREFIX}/libexec/gcc/${TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a \ + ln -s ${PREFIX}/libexec/gcc/${TARGET}/${PKG_GCC_VERSION}/liblto_plugin.so; + fi; + elif [ "${3}" = native ]; then + make ${MAKEFLAGS} DESTDIR=${PREFIX_LVL} install; + fi; + set_build_script_done install finish; + fi; +fi; + +# vim:filetype=sh diff --git a/106.musl.native.build b/106.musl.native.build index 59c5eff..5455612 120000 --- a/106.musl.native.build +++ b/106.musl.native.build @@ -1 +1 @@ -006.musl.full.build \ No newline at end of file +007.musl.full.build \ No newline at end of file diff --git a/107.gcc.native.build b/107.gcc.native.build index 27fad42..c3b435d 120000 --- a/107.gcc.native.build +++ b/107.gcc.native.build @@ -1 +1 @@ -007.gcc.full.build \ No newline at end of file +008.gcc.full.build \ No newline at end of file diff --git a/README b/README index 16771bf..0301193 100644 --- a/README +++ b/README @@ -125,14 +125,39 @@ Runtime components psxtypes HEAD C-IE-- 3rd party packages zsh 5.2 C-I-P- Linked against ncursesw Midipix roadmap/TODO list - Last update: Tue, 26 Apr 2016 10:41:37 +0000 - -1) slibtool, -2) psxscl: clone(2) system call implementation. - This is required by all 3rd party packages that make use of threads such as Irssi. -3) psxscl: dlopen(3) system call implementation. - This is required by all 3rd party packages that have runtime modules such as Perl and Python. -4) gdb: native port, -5) [ ... ] + Last update: Fri, 03 Jun 2016 12:47:13 +0000 + +midipix alpha release: the final stretch +======================================== + +my.own.tasks@midipix.org +------------------------ + +* ofd tables: additional bucket allocation as needed. +* `ls -R //c`: check for the cause of individual failures. + (might be related to the above ofd bucket allocation). +* integrate clone and the initial ldso implementation. +* integrate the signal queue, check signal implementation for + semantic completion, especially in the context of multi-threaded + applications. +* implement /dev/random and /dev/urandom, as well as other virtual + folders needed by core applications. +* implement the scheduler functions. +* implement (possibly as stubs) missing system calls, fix existing + system calls as needed by the core applications. +* toolchain: provided the few interfaces missing for C++ support. +* porting of mintty. + + +porting and other release-related tasks +--------------------------------------- + +* testing of ncurses. +* testing of bash and dash when built with ncurses. +* testing of all of the coreutils, seeing which ones fail due to + a missing virtual file or folder, which ones fail due to a missing + system call (crash), and which ones fail due to an incomplete or + incorrect system call. +* porting of gdb. vim:expandtab sw=8 ts=8 tw=0 nowrap diff --git a/bash-4.3.local.patch b/bash-4.3.local.patch index 6f98f23..343285f 100644 --- a/bash-4.3.local.patch +++ b/bash-4.3.local.patch @@ -116,3 +116,14 @@ TERMCAP_DEP= elif test $bash_cv_termcap_lib = libc; then TERMCAP_LIB= +--- bash-4.3/lib/intl/libgnuintl.h.in.orig 2009-01-04 19:32:30.000000000 +0000 ++++ bash-4.3/lib/intl/libgnuintl.h.in 2016-05-30 22:03:02.589798655 +0000 +@@ -107,7 +107,7 @@ + #endif + /* Auxiliary macros. */ + #ifdef _INTL_REDIRECT_ASM +-# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) ++# define _INTL_ASM(cname) __asm__ (#cname) + # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring + # define _INTL_STRINGIFY(prefix) #prefix + #else diff --git a/binutils-2.24.51.local.patch b/binutils-2.24.51.local.patch new file mode 100644 index 0000000..85d45b8 --- /dev/null +++ b/binutils-2.24.51.local.patch @@ -0,0 +1,11 @@ +--- binutils-2.24.51/intl/libgnuintl.h.orig 2014-07-03 05:37:48.000000000 +0000 ++++ binutils-2.24.51/intl/libgnuintl.h 2016-05-30 19:56:21.701967351 +0000 +@@ -105,7 +105,7 @@ + #endif + /* Auxiliary macros. */ + #ifdef _INTL_REDIRECT_ASM +-# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) ++# define _INTL_ASM(cname) __asm__ (#cname) + # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring + # define _INTL_STRINGIFY(prefix) #prefix + #else diff --git a/build.sh b/build.sh index bc310c5..24aa20a 100755 --- a/build.sh +++ b/build.sh @@ -31,7 +31,7 @@ check_path_vars ${CHECK_PATH_VARS}; check_prereqs ${PREREQ_CMDS}; update_build_status build_start; build_times_init; trap "clean_build_status abort; exit 1" HUP INT TERM USR1 USR2; log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; log_env_vars "build (global)" ${LOG_ENV_VARS}; [ ${ARG_CLEAN:-0} -eq 1 ] && clean_prefix; -mkdir -p ${PREFIX} ${PREFIX_NATIVE} ${PREFIX_TARGET} ${WORKDIR}; +mkdir -p ${PREFIX} ${PREFIX_NATIVE} ${PREFIX_TARGET} ${PREFIX_TARGET}/lib ${WORKDIR}; if [ -d ${PREFIX}/usr -o -f ${PREFIX}/usr -o -L ${PREFIX}/usr ]; then rm -rf ${PREFIX}/usr; fi; @@ -132,8 +132,7 @@ if [ $(( ${BUILD_NFINI} + ${BUILD_NSKIP} )) -ge 0 ] \ log_msg info "Restored ${PREFIX_BASENAME}/lib."; log_msg info "Building source tarball..."; tar -cJpf ${TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.xz\ - $(find tmp -mindepth 1 -maxdepth 1 -type d \ - \( -name \*-native-\* -or -name \*-cross-\* \)); + $(find tmp -mindepth 1 -maxdepth 1 -type d); log_msg info "Finished building source tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] &&\ gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then diff --git a/build.subr b/build.subr index a6515fa..482ec3e 100644 --- a/build.subr +++ b/build.subr @@ -34,7 +34,7 @@ build_times_get() { clean_prefix() { log_msg info "-c specified, cleaning prefix..."; - set -- bin include lib lib64 libexec native share x86_64-nt64-midipix; + set -- bin i686-nt32-midipix include lib lib64 libexec native share x86_64-nt64-midipix; while [ ${#} -gt 0 ]; do rm -rf ${PREFIX}/${1}; shift; done; for _cp_pname in $(find ${PREFIX}/tmp -mindepth 1 -maxdepth 1 -not -iname \*.tar\*) \ $(find ${PREFIX}/tmp -mindepth 1 -maxdepth 1 -type f -iname .\*); do diff --git a/build.vars b/build.vars index 0426c84..0b65087 100644 --- a/build.vars +++ b/build.vars @@ -19,19 +19,26 @@ : ${CLEAR_ENV_VARS_EXCEPT:="HOME PATH SHELL TERM USER"}; : ${GITROOT:=git://midipix.org}; : ${GITROOT_HEAD:=git://midipix.org}; -: ${HOST_NATIVE:=x86_64-nt64-midipix}; +if [ "${ARCH}" = nt32 ]; then + : ${HOST_NATIVE:=i686-nt32-midipix}; + : ${TARGET:=i686-nt32-midipix}; +elif [ "${ARCH}" = nt64 ]; then + : ${HOST_NATIVE:=x86_64-nt64-midipix}; + : ${TARGET:=x86_64-nt64-midipix}; +else + log_msg failexit "Error: invalid ARCHitecture \`${ARCH}'."; +fi; : ${LOG_ENV_VARS:="HOME PATH SHELL USER GITROOT PKG_LVL0_CFLAGS_CONFIGURE PKG_LVL1_CFLAGS_CONFIGURE PKG_LVL2_CFLAGS_CONFIGURE PKG_LVL3_CFLAGS_CONFIGURE PREFIX PREFIX_NATIVE PREFIX_TARGET PREFIX_LVL0 PREFIX_LVL1 PREFIX_LVL2 PREFIX_LVL3 WORKDIR MAKEFLAGS"}; : ${LOG_MSG_FAIL_COLOUR:=91}; : ${LOG_MSG_INFO_COLOUR:=93}; : ${LOG_MSG_SUCC_COLOUR:=92}; : ${LOG_MSG_WARN_COLOUR:=96}; : ${MAKEFLAGS_DEFAULT:=-j8}; -: ${TARBALL_FNAME_PREFIX:=midipix.}; +: ${TARBALL_FNAME_PREFIX:=midipix-${ARCH}.}; : ${TARBALL_SIGN_GPG_KEY=}; -: ${TARBALL_SRC_FNAME_PREFIX:=midipix-src.}; +: ${TARBALL_SRC_FNAME_PREFIX:=midipix-${ARCH}.src.}; : ${TARBALL_EXCLUDE_PATHS:="src tmp"}; : ${TARBALL_SRC_SIGN_GPG_KEY=}; -: ${TARGET:=x86_64-nt64-midipix}; : ${PREFIX_NATIVE:=${PREFIX}/native}; : ${PREFIX_TARGET:=${PREFIX}/${TARGET}}; : ${PREFIX_LVL0:=${PREFIX_TARGET}}; @@ -44,8 +51,8 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${WGET_ARGS:="-N --no-check-certificate"}; : ${WORKDIR:=${PREFIX}/tmp}; -: ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils curl dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libarchive libelf libfetch libffi libnbcompat libressl libz make mksh mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh pacman patch pemagine perl popt psxscl psxstub psxtypes python3 rsync sed tar tcsh util_linux which xz zsh"}; -: ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE AUTOGEN BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBFILES_FIX LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SUBDIR URL URL_FNAME URL_TYPE VERSION"}; +: ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils curl dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libarchive libelf libfetch libffi libnbcompat libressl libz make mksh mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh pacman patch pemagine perl popt psxscl psxstub psxtypes python3 rsync sed slibtool tar tcsh util_linux which xz zsh"}; +: ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE AUTOGEN BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBFILES_FIX LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SLIBTOOL SUBDIR URL URL_FNAME URL_TYPE VERSION"}; : ${PKG_LVL0_CFLAGS_CONFIGURE:=-O0}; : ${PKG_LVL0_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; : ${PKG_LVL0_MAKEFLAGS_BUILD:=${MAKEFLAGS_DEFAULT}}; @@ -94,11 +101,13 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_BINUTILS_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; : ${PKG_BINUTILS_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2}; : ${PKG_BINUTILS_CONFIGURE_ARGS_EXTRA:=--with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/}; +: ${PKG_BINUTILS_SLIBTOOL:=slibtool-static}; : ${PKG_BINUTILS_HOST_VERSION:=2.24.51}; : ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; : ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2}; : ${PKG_BINUTILS_HOST_BUILD_TYPE:=cross}; : ${PKG_BINUTILS_HOST_CONFIGURE_ARGS:=--disable-werror --prefix=${PREFIX} --target=${TARGET} --with-sysroot=${PREFIX_LVL0}}; +: ${PKG_BINUTILS_HOST_SLIBTOOL:=slibtool-static}; : ${PKG_COREUTILS_VERSION:=8.23}; : ${PKG_COREUTILS_SHA256SUM:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d}; : ${PKG_COREUTILS_URL:=https://ftp.gnu.org/gnu/coreutils/coreutils-${PKG_COREUTILS_VERSION}.tar.xz}; @@ -135,7 +144,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_GIT_LDFLAGS_BUILD_EXTRA:=--sysroot=${PREFIX_LVL3}}; : ${PKG_GIT_LDFLAGS_INSTALL_EXTRA:=--sysroot=${PREFIX_LVL3}}; : ${PKG_GIT_LIBFILES_FIX:=1}; -: ${PKG_GIT_MAKEFLAGS_BUILD_EXTRA:=NO_EXPAT=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99}; +: ${PKG_GIT_MAKEFLAGS_BUILD_EXTRA:=NEEDS_SSL_WITH_CURL=1 NO_EXPAT=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99}; : ${PKG_GIT_MAKEFLAGS_INSTALL:=NO_PERL=1 prefix=${PREFIX_LVL3} V=99}; : ${PKG_GIT_RANLIB_INSTALL:=${HOST_NATIVE}-ranlib}; : ${PKG_GIT_SUBDIR:=git}; @@ -146,7 +155,8 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_GLIB_URL:=http://ftp.gnome.org/pub/GNOME/sources/glib/${PKG_GLIB_VERSION%.[0-9]}/glib-${PKG_GLIB_VERSION}.tar.xz}; : ${PKG_GLIB_CONFIGURE_ARGS_EXTRA:=--with-pcre=internal --disable-libelf}; : ${PKG_GLIB_ENV_VARS_EXTRA:=LIBFFI_CFLAGS=-I${PREFIX_LVL3}/lib/libffi-3.2.1/include:LIBFFI_LIBS=-L${PREFIX_LVL3}/lib -lffi}; -: ${PKG_GLIB_MAKEFLAGS_BUILD_EXTRA:=V=99}; +: ${PKG_GLIB_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib}; +: ${PKG_GLIB_MAKEFLAGS_BUILD_EXTRA:=V=99 -j1}; : ${PKG_GMP_VERSION:=5.1.3}; : ${PKG_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; : ${PKG_GMP_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_VERSION}.tar.bz2}; @@ -279,7 +289,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_PACMAN_URL:=https://projects.archlinux.org/pacman.git/snapshot/pacman-${PKG_PACMAN_VERSION}.tar.gz}; : ${PKG_PACMAN_AUTOGEN:=1}; : ${PKG_PACMAN_CONFIGURE_ARGS_EXTRA:=--disable-doc}; -: ${PKG_PACMAN_ENV_VARS_EXTRA:="LIBARCHIVE_CFLAGS=:LIBARCHIVE_LIBS=:LIBSSL_CFLAGS=:LIBSSL_LIBS=:LIBCURL_CFLAGS=:LIBCURL_LIBS=:PKG_CONFIG_PATH=${PREFIX_LVL3}/lib/pkgconfig"}; +: ${PKG_PACMAN_ENV_VARS_EXTRA:="LIBALPM_LIBS=-lssl -lbz2 -llzma -lz:LIBARCHIVE_CFLAGS=:LIBARCHIVE_LIBS=:LIBSSL_CFLAGS=:LIBSSL_LIBS=:LIBCURL_CFLAGS=:LIBCURL_LIBS=:PKG_CONFIG_PATH=${PREFIX_LVL3}/lib/pkgconfig"}; : ${PKG_PACMAN_MAKEFLAGS_BUILD_EXTRA:=V=99}; : ${PKG_PATCH_VERSION:=2.7}; : ${PKG_PATCH_SHA256SUM:=59c29f56faa0a924827e6a60c6accd6e2900eae5c6aaa922268c717f06a62048}; @@ -287,7 +297,8 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_PERL_VERSION:=5.22.1}; : ${PKG_PERL_SHA256SUM:=2b475d0849d54c4250e9cba4241b7b7291cffb45dfd083b677ca7b5d38118f27}; : ${PKG_PERL_URL:=http://www.cpan.org/src/5.0/perl-${PKG_PERL_VERSION}.tar.gz}; -: ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_LVL3}/include --sysroot=${PREFIX_LVL3} --target=x86_64-nt64-midipix"}; +: ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_LVL3}/include --sysroot=${PREFIX_LVL3} --target=${TARGET}"}; +: ${PKG_PERL_ENV_VARS_EXTRA:="TARGET=${TARGET}"}; : ${PKG_PERL_MAKEFLAGS_BUILD:=-j1}; : ${PKG_PYTHON3_VERSION:=3.5.1}; : ${PKG_PYTHON3_SHA256SUM:=687e067d9f391da645423c7eda8205bae9d35edc0c76ef5218dcbe4cc770d0d7}; @@ -299,6 +310,9 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_RSYNC_SHA256SUM:=ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2}; : ${PKG_RSYNC_URL:=https://download.samba.org/pub/rsync/src/rsync-${PKG_RSYNC_VERSION}.tar.gz}; : ${PKG_RSYNC_CONFIGURE_ARGS_EXTRA:=--with-included-popt --with-included-zlib}; +: ${PKG_SLIBTOOL_URL:=git://midipix.org/slibtool}; +: ${PKG_SLIBTOOL_URL_TYPE:=git}; +: ${PKG_SLIBTOOL_CONFIGURE_ARGS:=--host= --prefix=${PREFIX}}; : ${PKG_TAR_VERSION:=1.28}; : ${PKG_TAR_SHA256SUM:=6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de}; : ${PKG_TAR_URL:=https://ftp.gnu.org/gnu/tar/tar-${PKG_TAR_VERSION}.tar.gz}; diff --git a/libarchive-3.1.2.local.patch b/libarchive-3.1.2.local.patch index 1de46e2..1c5aa84 100644 --- a/libarchive-3.1.2.local.patch +++ b/libarchive-3.1.2.local.patch @@ -38,3 +38,142 @@ + ;; +esac + +--- libarchive-3.1.2/cpio/bsdcpio.1.orig ++++ libarchive-3.1.2/cpio/bsdcpio.1 +@@ -156,7 +156,8 @@ + .It Fl Fl insecure + (i and p mode only) + Disable security checks during extraction or copying. +-This allows extraction via symbolic links and path names containing ++This allows extraction via symbolic links, absolute paths, ++and path names containing + .Sq .. + in the name. + .It Fl J , Fl Fl xz +--- libarchive-3.1.2/cpio/cpio.c.orig ++++ libarchive-3.1.2/cpio/cpio.c +@@ -179,6 +179,7 @@ + cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; ++ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; + cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; + cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; + cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; +@@ -264,6 +265,7 @@ + case OPTION_INSECURE: + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; ++ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; + break; + case 'L': /* GNU cpio */ + cpio->option_follow_links = 1; +@@ -300,6 +302,7 @@ + "Cannot use both -p and -%c", cpio->mode); + cpio->mode = opt; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; ++ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; + break; + case OPTION_PRESERVE_OWNER: + cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; +--- libarchive-3.1.2/libarchive/archive.h.orig ++++ libarchive-3.1.2/libarchive/archive.h +@@ -562,6 +562,8 @@ + /* Default: Do not use HFS+ compression if it was not compressed. */ + /* This has no effect except on Mac OS v10.6 or later. */ + #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000) ++/* Default: Do not reject entries with absolute paths */ ++#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000) + + __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, + int flags); +--- libarchive-3.1.2/libarchive/archive_write_disk.3.orig ++++ libarchive-3.1.2/libarchive/archive_write_disk.3 +@@ -177,6 +177,9 @@ + Note that paths ending in + .Pa .. + always cause an error, regardless of this flag. ++.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS ++Refuse to extract an absolute path. ++The default is to not refuse such paths. + .It Cm ARCHIVE_EXTRACT_SPARSE + Scan data for blocks of NUL bytes and try to recreate them with holes. + This results in sparse files, independent of whether the archive format +--- libarchive-3.1.2/libarchive/archive_write_disk_posix.c.orig ++++ libarchive-3.1.2/libarchive/archive_write_disk_posix.c +@@ -2504,8 +2504,9 @@ + /* + * Canonicalize the pathname. In particular, this strips duplicate + * '/' characters, '.' elements, and trailing '/'. It also raises an +- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is +- * set) any '..' in the path. ++ * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is ++ * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS ++ * is set) if the path is absolute. + */ + static int + cleanup_pathname(struct archive_write_disk *a) +@@ -2524,8 +2525,15 @@ + cleanup_pathname_win(a); + #endif + /* Skip leading '/'. */ +- if (*src == '/') ++ if (*src == '/') { ++ if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { ++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, ++ "Path is absolute"); ++ return (ARCHIVE_FAILED); ++ } ++ + separator = *src++; ++ } + + /* Scan the pathname one element at a time. */ + for (;;) { +--- libarchive-3.1.2/libarchive/test/test_write_disk_secure.c.orig ++++ libarchive-3.1.2/libarchive/test/test_write_disk_secure.c +@@ -178,6 +178,29 @@ + assert(S_ISDIR(st.st_mode)); + archive_entry_free(ae); + ++ /* ++ * Without security checks, we should be able to ++ * extract an absolute path. ++ */ ++ assert((ae = archive_entry_new()) != NULL); ++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); ++ archive_entry_set_mode(ae, S_IFREG | 0777); ++ assert(0 == archive_write_header(a, ae)); ++ assert(0 == archive_write_finish_entry(a)); ++ assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); ++ assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp")); ++ ++ /* But with security checks enabled, this should fail. */ ++ assert(archive_entry_clear(ae) != NULL); ++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); ++ archive_entry_set_mode(ae, S_IFREG | 0777); ++ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); ++ failure("Extracting an absolute path should fail here."); ++ assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); ++ archive_entry_free(ae); ++ assert(0 == archive_write_finish_entry(a)); ++ assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); ++ + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Test the entries on disk. */ +--- libarchive-3.1.2/libarchive/archive_write.c.orig 2016-06-03 13:15:42.862830537 +0000 ++++ libarchive-3.1.2/libarchive/archive_write.c 2016-06-03 13:19:01.590826126 +0000 +@@ -671,8 +671,12 @@ + _archive_write_data(struct archive *_a, const void *buff, size_t s) + { + struct archive_write *a = (struct archive_write *)_a; ++ const size_t max_write = INT_MAX; + archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_DATA, "archive_write_data"); ++ /* In particular, this catches attempts to pass negative values. */ ++ if (s > max_write) ++ s = max_write; + archive_clear_error(&a->archive); + return ((a->format_write_data)(a, buff, s)); + } diff --git a/libffi-3.2.1.local.patch b/libffi-3.2.1.local.patch new file mode 100644 index 0000000..0fb74e2 --- /dev/null +++ b/libffi-3.2.1.local.patch @@ -0,0 +1,90 @@ +--- libffi-3.2.1/src/x86/win32.S.orig2 2016-05-31 09:21:19.120895425 +0000 ++++ libffi-3.2.1/src/x86/win32.S 2016-05-31 09:22:19.252894091 +0000 +@@ -529,7 +529,9 @@ + + # This assumes we are using gas. + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_call_win32) ++#endif + .globl USCORE_SYMBOL(ffi_call_win32) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_call_win32; .scl 2; .type 32; .endef +@@ -712,7 +714,9 @@ + ret + .ffi_call_win32_end: + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_THISCALL) ++#endif + .globl USCORE_SYMBOL(ffi_closure_THISCALL) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef +@@ -725,7 +729,9 @@ + jmp .ffi_closure_STDCALL_internal + + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_FASTCALL) ++#endif + .globl USCORE_SYMBOL(ffi_closure_FASTCALL) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_FASTCALL; .scl 2; .type 32; .endef +@@ -737,7 +743,9 @@ + push %edx + push %ecx + jmp .ffi_closure_STDCALL_internal ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_REGISTER) ++#endif + .globl USCORE_SYMBOL(ffi_closure_REGISTER) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_REGISTER; .scl 2; .type 32; .endef +@@ -754,7 +762,9 @@ + .LFE1: + # This assumes we are using gas. + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_SYSV) ++#endif + #if defined(X86_WIN32) + .globl USCORE_SYMBOL(ffi_closure_SYSV) + #if defined(X86_WIN32) && !defined(__OS2__) +@@ -898,7 +908,9 @@ + + #ifdef X86_WIN32 + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_raw_THISCALL) ++#endif + .globl USCORE_SYMBOL(ffi_closure_raw_THISCALL) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef +@@ -1040,7 +1052,9 @@ + + # This assumes we are using gas. + .balign 16 ++#ifndef __midipix__ + FFI_HIDDEN(ffi_closure_STDCALL) ++#endif + .globl USCORE_SYMBOL(ffi_closure_STDCALL) + #if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef +@@ -1345,10 +1359,17 @@ + .LEFDE5: + + #ifdef __midipix__ ++#if defined(SYMBOL_UNDERSCORE) ++ .section .got$ffi__call_win32,"r" ++ .global __imp__ffi_call_win32 ++__imp__ffi_call_win32: ++ .long _ffi_call_win32 ++#else + .section .got$ffi_call_win32,"r" + .global __imp_ffi_call_win32 + __imp_ffi_call_win32: + .long ffi_call_win32 ++#endif + .linkonce discard + #endif + diff --git a/musl-1.1.12.local.patch b/musl-1.1.12.local.patch new file mode 100644 index 0000000..09933b5 --- /dev/null +++ b/musl-1.1.12.local.patch @@ -0,0 +1,675 @@ +--- musl-1.1.12/src/signal/nt32/sigsetjmp.s.orig 1970-01-01 00:00:00.000000000 +0000 ++++ musl-1.1.12/src/signal/nt32/sigsetjmp.s 2016-05-30 20:27:49.741925447 +0000 +@@ -0,0 +1,17 @@ ++.text ++.globl ___sigsetjmp ++.globl _sigsetjmp ++ ++.def ___sigsetjmp; .scl 2; .type 32; .endef ++.def _sigsetjmp; .scl 2; .type 32; .endef ++ ++___sigsetjmp: ++_sigsetjmp: ++ jmp ___sigsetjmp_tail # defer to ___sigsetjmp_tail ++ ++ ++ .section .got$_sigsetjmp,"r" ++ .global __imp__sigsetjmp ++__imp__sigsetjmp: ++ .long _sigsetjmp ++ .linkonce discard +--- musl-1.1.12/arch/nt32/bits/syscall.h.orig 2016-05-30 21:14:49.993862854 +0000 ++++ musl-1.1.12/arch/nt32/bits/syscall.h 2016-05-30 21:14:49.993862854 +0000 +@@ -1 +1,651 @@ +-#include "../../nt64/bits/syscall.h" ++#define __NR_read 0 ++#define __NR_write 1 ++#define __NR_open 2 ++#define __NR_close 3 ++#define __NR_stat 4 ++#define __NR_fstat 5 ++#define __NR_lstat 6 ++#define __NR_poll 7 ++#define __NR_lseek 8 ++#define __NR_mmap 9 ++#define __NR_mprotect 10 ++#define __NR_munmap 11 ++#define __NR_brk 12 ++#define __NR_rt_sigaction 13 ++#define __NR_rt_sigprocmask 14 ++#define __NR_rt_sigreturn 15 ++#define __NR_ioctl 16 ++#define __NR_pread64 17 ++#define __NR_pwrite64 18 ++#define __NR_readv 19 ++#define __NR_writev 20 ++#define __NR_access 21 ++#define __NR_pipe 22 ++#define __NR_select 23 ++#define __NR_sched_yield 24 ++#define __NR_mremap 25 ++#define __NR_msync 26 ++#define __NR_mincore 27 ++#define __NR_madvise 28 ++#define __NR_shmget 29 ++#define __NR_shmat 30 ++#define __NR_shmctl 31 ++#define __NR_dup 32 ++#define __NR_dup2 33 ++#define __NR_pause 34 ++#define __NR_nanosleep 35 ++#define __NR_getitimer 36 ++#define __NR_alarm 37 ++#define __NR_setitimer 38 ++#define __NR_getpid 39 ++#define __NR_sendfile 40 ++#define __NR_socket 41 ++#define __NR_connect 42 ++#define __NR_accept 43 ++#define __NR_sendto 44 ++#define __NR_recvfrom 45 ++#define __NR_sendmsg 46 ++#define __NR_recvmsg 47 ++#define __NR_shutdown 48 ++#define __NR_bind 49 ++#define __NR_listen 50 ++#define __NR_getsockname 51 ++#define __NR_getpeername 52 ++#define __NR_socketpair 53 ++#define __NR_setsockopt 54 ++#define __NR_getsockopt 55 ++#define __NR_clone 56 ++#define __NR_fork 57 ++#define __NR_vfork 58 ++#define __NR_execve 59 ++#define __NR_exit 60 ++#define __NR_wait4 61 ++#define __NR_kill 62 ++#define __NR_uname 63 ++#define __NR_semget 64 ++#define __NR_semop 65 ++#define __NR_semctl 66 ++#define __NR_shmdt 67 ++#define __NR_msgget 68 ++#define __NR_msgsnd 69 ++#define __NR_msgrcv 70 ++#define __NR_msgctl 71 ++#define __NR_fcntl 72 ++#define __NR_flock 73 ++#define __NR_fsync 74 ++#define __NR_fdatasync 75 ++#define __NR_truncate 76 ++#define __NR_ftruncate 77 ++#define __NR_getdents 78 ++#define __NR_getcwd 79 ++#define __NR_chdir 80 ++#define __NR_fchdir 81 ++#define __NR_rename 82 ++#define __NR_mkdir 83 ++#define __NR_rmdir 84 ++#define __NR_creat 85 ++#define __NR_link 86 ++#define __NR_unlink 87 ++#define __NR_symlink 88 ++#define __NR_readlink 89 ++#define __NR_chmod 90 ++#define __NR_fchmod 91 ++#define __NR_chown 92 ++#define __NR_fchown 93 ++#define __NR_lchown 94 ++#define __NR_umask 95 ++#define __NR_gettimeofday 96 ++#define __NR_getrlimit 97 ++#define __NR_getrusage 98 ++#define __NR_sysinfo 99 ++#define __NR_times 100 ++#define __NR_ptrace 101 ++#define __NR_getuid 102 ++#define __NR_syslog 103 ++#define __NR_getgid 104 ++#define __NR_setuid 105 ++#define __NR_setgid 106 ++#define __NR_geteuid 107 ++#define __NR_getegid 108 ++#define __NR_setpgid 109 ++#define __NR_getppid 110 ++#define __NR_getpgrp 111 ++#define __NR_setsid 112 ++#define __NR_setreuid 113 ++#define __NR_setregid 114 ++#define __NR_getgroups 115 ++#define __NR_setgroups 116 ++#define __NR_setresuid 117 ++#define __NR_getresuid 118 ++#define __NR_setresgid 119 ++#define __NR_getresgid 120 ++#define __NR_getpgid 121 ++#define __NR_setfsuid 122 ++#define __NR_setfsgid 123 ++#define __NR_getsid 124 ++#define __NR_capget 125 ++#define __NR_capset 126 ++#define __NR_rt_sigpending 127 ++#define __NR_rt_sigtimedwait 128 ++#define __NR_rt_sigqueueinfo 129 ++#define __NR_rt_sigsuspend 130 ++#define __NR_sigaltstack 131 ++#define __NR_utime 132 ++#define __NR_mknod 133 ++#define __NR_uselib 134 ++#define __NR_personality 135 ++#define __NR_ustat 136 ++#define __NR_statfs 137 ++#define __NR_fstatfs 138 ++#define __NR_sysfs 139 ++#define __NR_getpriority 140 ++#define __NR_setpriority 141 ++#define __NR_sched_setparam 142 ++#define __NR_sched_getparam 143 ++#define __NR_sched_setscheduler 144 ++#define __NR_sched_getscheduler 145 ++#define __NR_sched_get_priority_max 146 ++#define __NR_sched_get_priority_min 147 ++#define __NR_sched_rr_get_interval 148 ++#define __NR_mlock 149 ++#define __NR_munlock 150 ++#define __NR_mlockall 151 ++#define __NR_munlockall 152 ++#define __NR_vhangup 153 ++#define __NR_modify_ldt 154 ++#define __NR_pivot_root 155 ++#define __NR__sysctl 156 ++#define __NR_prctl 157 ++#define __NR_arch_prctl 158 ++#define __NR_adjtimex 159 ++#define __NR_setrlimit 160 ++#define __NR_chroot 161 ++#define __NR_sync 162 ++#define __NR_acct 163 ++#define __NR_settimeofday 164 ++#define __NR_mount 165 ++#define __NR_umount2 166 ++#define __NR_swapon 167 ++#define __NR_swapoff 168 ++#define __NR_reboot 169 ++#define __NR_sethostname 170 ++#define __NR_setdomainname 171 ++#define __NR_iopl 172 ++#define __NR_ioperm 173 ++#define __NR_create_module 174 ++#define __NR_init_module 175 ++#define __NR_delete_module 176 ++#define __NR_get_kernel_syms 177 ++#define __NR_query_module 178 ++#define __NR_quotactl 179 ++#define __NR_nfsservctl 180 ++#define __NR_getpmsg 181 ++#define __NR_putpmsg 182 ++#define __NR_afs_syscall 183 ++#define __NR_tuxcall 184 ++#define __NR_security 185 ++#define __NR_gettid 186 ++#define __NR_readahead 187 ++#define __NR_setxattr 188 ++#define __NR_lsetxattr 189 ++#define __NR_fsetxattr 190 ++#define __NR_getxattr 191 ++#define __NR_lgetxattr 192 ++#define __NR_fgetxattr 193 ++#define __NR_listxattr 194 ++#define __NR_llistxattr 195 ++#define __NR_flistxattr 196 ++#define __NR_removexattr 197 ++#define __NR_lremovexattr 198 ++#define __NR_fremovexattr 199 ++#define __NR_tkill 200 ++#define __NR_time 201 ++#define __NR_futex 202 ++#define __NR_sched_setaffinity 203 ++#define __NR_sched_getaffinity 204 ++#define __NR_set_thread_area 205 ++#define __NR_io_setup 206 ++#define __NR_io_destroy 207 ++#define __NR_io_getevents 208 ++#define __NR_io_submit 209 ++#define __NR_io_cancel 210 ++#define __NR_get_thread_area 211 ++#define __NR_lookup_dcookie 212 ++#define __NR_epoll_create 213 ++#define __NR_epoll_ctl_old 214 ++#define __NR_epoll_wait_old 215 ++#define __NR_remap_file_pages 216 ++#define __NR_getdents64 217 ++#define __NR_set_tid_address 218 ++#define __NR_restart_syscall 219 ++#define __NR_semtimedop 220 ++#define __NR_fadvise64 221 ++#define __NR_timer_create 222 ++#define __NR_timer_settime 223 ++#define __NR_timer_gettime 224 ++#define __NR_timer_getoverrun 225 ++#define __NR_timer_delete 226 ++#define __NR_clock_settime 227 ++#define __NR_clock_gettime 228 ++#define __NR_clock_getres 229 ++#define __NR_clock_nanosleep 230 ++#define __NR_exit_group 231 ++#define __NR_epoll_wait 232 ++#define __NR_epoll_ctl 233 ++#define __NR_tgkill 234 ++#define __NR_utimes 235 ++#define __NR_vserver 236 ++#define __NR_mbind 237 ++#define __NR_set_mempolicy 238 ++#define __NR_get_mempolicy 239 ++#define __NR_mq_open 240 ++#define __NR_mq_unlink 241 ++#define __NR_mq_timedsend 242 ++#define __NR_mq_timedreceive 243 ++#define __NR_mq_notify 244 ++#define __NR_mq_getsetattr 245 ++#define __NR_kexec_load 246 ++#define __NR_waitid 247 ++#define __NR_add_key 248 ++#define __NR_request_key 249 ++#define __NR_keyctl 250 ++#define __NR_ioprio_set 251 ++#define __NR_ioprio_get 252 ++#define __NR_inotify_init 253 ++#define __NR_inotify_add_watch 254 ++#define __NR_inotify_rm_watch 255 ++#define __NR_migrate_pages 256 ++#define __NR_openat 257 ++#define __NR_mkdirat 258 ++#define __NR_mknodat 259 ++#define __NR_fchownat 260 ++#define __NR_futimesat 261 ++#define __NR_newfstatat 262 ++#define __NR_unlinkat 263 ++#define __NR_renameat 264 ++#define __NR_linkat 265 ++#define __NR_symlinkat 266 ++#define __NR_readlinkat 267 ++#define __NR_fchmodat 268 ++#define __NR_faccessat 269 ++#define __NR_pselect6 270 ++#define __NR_ppoll 271 ++#define __NR_unshare 272 ++#define __NR_set_robust_list 273 ++#define __NR_get_robust_list 274 ++#define __NR_splice 275 ++#define __NR_tee 276 ++#define __NR_sync_file_range 277 ++#define __NR_vmsplice 278 ++#define __NR_move_pages 279 ++#define __NR_utimensat 280 ++#define __NR_epoll_pwait 281 ++#define __NR_signalfd 282 ++#define __NR_timerfd_create 283 ++#define __NR_eventfd 284 ++#define __NR_fallocate 285 ++#define __NR_timerfd_settime 286 ++#define __NR_timerfd_gettime 287 ++#define __NR_accept4 288 ++#define __NR_signalfd4 289 ++#define __NR_eventfd2 290 ++#define __NR_epoll_create1 291 ++#define __NR_dup3 292 ++#define __NR_pipe2 293 ++#define __NR_inotify_init1 294 ++#define __NR_preadv 295 ++#define __NR_pwritev 296 ++#define __NR_rt_tgsigqueueinfo 297 ++#define __NR_perf_event_open 298 ++#define __NR_recvmmsg 299 ++#define __NR_fanotify_init 300 ++#define __NR_fanotify_mark 301 ++#define __NR_prlimit64 302 ++#define __NR_name_to_handle_at 303 ++#define __NR_open_by_handle_at 304 ++#define __NR_clock_adjtime 305 ++#define __NR_syncfs 306 ++#define __NR_sendmmsg 307 ++#define __NR_setns 308 ++#define __NR_getcpu 309 ++#define __NR_process_vm_readv 310 ++#define __NR_process_vm_writev 311 ++#define __NR_kcmp 312 ++#define __NR_finit_module 313 ++#define __NR_sched_setattr 314 ++#define __NR_sched_getattr 315 ++#define __NR_renameat2 316 ++#define __NR_seccomp 317 ++#define __NR_getrandom 318 ++#define __NR_memfd_create 319 ++#define __NR_kexec_file_load 320 ++#define __NR_bpf 321 ++#define __NR_execveat 322 ++ ++ ++ ++/* Repeat with SYS_ prefix */ ++ ++#define SYS_read 0 ++#define SYS_write 1 ++#define SYS_open 2 ++#define SYS_close 3 ++#define SYS_stat 4 ++#define SYS_fstat 5 ++#define SYS_lstat 6 ++#define SYS_poll 7 ++#define SYS_lseek 8 ++#define SYS_mmap 9 ++#define SYS_mprotect 10 ++#define SYS_munmap 11 ++#define SYS_brk 12 ++#define SYS_rt_sigaction 13 ++#define SYS_rt_sigprocmask 14 ++#define SYS_rt_sigreturn 15 ++#define SYS_ioctl 16 ++#define SYS_pread64 17 ++#define SYS_pwrite64 18 ++#define SYS_readv 19 ++#define SYS_writev 20 ++#define SYS_access 21 ++#define SYS_pipe 22 ++#define SYS_select 23 ++#define SYS_sched_yield 24 ++#define SYS_mremap 25 ++#define SYS_msync 26 ++#define SYS_mincore 27 ++#define SYS_madvise 28 ++#define SYS_shmget 29 ++#define SYS_shmat 30 ++#define SYS_shmctl 31 ++#define SYS_dup 32 ++#define SYS_dup2 33 ++#define SYS_pause 34 ++#define SYS_nanosleep 35 ++#define SYS_getitimer 36 ++#define SYS_alarm 37 ++#define SYS_setitimer 38 ++#define SYS_getpid 39 ++#define SYS_sendfile 40 ++#define SYS_socket 41 ++#define SYS_connect 42 ++#define SYS_accept 43 ++#define SYS_sendto 44 ++#define SYS_recvfrom 45 ++#define SYS_sendmsg 46 ++#define SYS_recvmsg 47 ++#define SYS_shutdown 48 ++#define SYS_bind 49 ++#define SYS_listen 50 ++#define SYS_getsockname 51 ++#define SYS_getpeername 52 ++#define SYS_socketpair 53 ++#define SYS_setsockopt 54 ++#define SYS_getsockopt 55 ++#define SYS_clone 56 ++#define SYS_fork 57 ++#define SYS_vfork 58 ++#define SYS_execve 59 ++#define SYS_exit 60 ++#define SYS_wait4 61 ++#define SYS_kill 62 ++#define SYS_uname 63 ++#define SYS_semget 64 ++#define SYS_semop 65 ++#define SYS_semctl 66 ++#define SYS_shmdt 67 ++#define SYS_msgget 68 ++#define SYS_msgsnd 69 ++#define SYS_msgrcv 70 ++#define SYS_msgctl 71 ++#define SYS_fcntl 72 ++#define SYS_flock 73 ++#define SYS_fsync 74 ++#define SYS_fdatasync 75 ++#define SYS_truncate 76 ++#define SYS_ftruncate 77 ++#define SYS_getdents 78 ++#define SYS_getcwd 79 ++#define SYS_chdir 80 ++#define SYS_fchdir 81 ++#define SYS_rename 82 ++#define SYS_mkdir 83 ++#define SYS_rmdir 84 ++#define SYS_creat 85 ++#define SYS_link 86 ++#define SYS_unlink 87 ++#define SYS_symlink 88 ++#define SYS_readlink 89 ++#define SYS_chmod 90 ++#define SYS_fchmod 91 ++#define SYS_chown 92 ++#define SYS_fchown 93 ++#define SYS_lchown 94 ++#define SYS_umask 95 ++#define SYS_gettimeofday 96 ++#define SYS_getrlimit 97 ++#define SYS_getrusage 98 ++#define SYS_sysinfo 99 ++#define SYS_times 100 ++#define SYS_ptrace 101 ++#define SYS_getuid 102 ++#define SYS_syslog 103 ++#define SYS_getgid 104 ++#define SYS_setuid 105 ++#define SYS_setgid 106 ++#define SYS_geteuid 107 ++#define SYS_getegid 108 ++#define SYS_setpgid 109 ++#define SYS_getppid 110 ++#define SYS_getpgrp 111 ++#define SYS_setsid 112 ++#define SYS_setreuid 113 ++#define SYS_setregid 114 ++#define SYS_getgroups 115 ++#define SYS_setgroups 116 ++#define SYS_setresuid 117 ++#define SYS_getresuid 118 ++#define SYS_setresgid 119 ++#define SYS_getresgid 120 ++#define SYS_getpgid 121 ++#define SYS_setfsuid 122 ++#define SYS_setfsgid 123 ++#define SYS_getsid 124 ++#define SYS_capget 125 ++#define SYS_capset 126 ++#define SYS_rt_sigpending 127 ++#define SYS_rt_sigtimedwait 128 ++#define SYS_rt_sigqueueinfo 129 ++#define SYS_rt_sigsuspend 130 ++#define SYS_sigaltstack 131 ++#define SYS_utime 132 ++#define SYS_mknod 133 ++#define SYS_uselib 134 ++#define SYS_personality 135 ++#define SYS_ustat 136 ++#define SYS_statfs 137 ++#define SYS_fstatfs 138 ++#define SYS_sysfs 139 ++#define SYS_getpriority 140 ++#define SYS_setpriority 141 ++#define SYS_sched_setparam 142 ++#define SYS_sched_getparam 143 ++#define SYS_sched_setscheduler 144 ++#define SYS_sched_getscheduler 145 ++#define SYS_sched_get_priority_max 146 ++#define SYS_sched_get_priority_min 147 ++#define SYS_sched_rr_get_interval 148 ++#define SYS_mlock 149 ++#define SYS_munlock 150 ++#define SYS_mlockall 151 ++#define SYS_munlockall 152 ++#define SYS_vhangup 153 ++#define SYS_modify_ldt 154 ++#define SYS_pivot_root 155 ++#define SYS__sysctl 156 ++#define SYS_prctl 157 ++#define SYS_arch_prctl 158 ++#define SYS_adjtimex 159 ++#define SYS_setrlimit 160 ++#define SYS_chroot 161 ++#define SYS_sync 162 ++#define SYS_acct 163 ++#define SYS_settimeofday 164 ++#define SYS_mount 165 ++#define SYS_umount2 166 ++#define SYS_swapon 167 ++#define SYS_swapoff 168 ++#define SYS_reboot 169 ++#define SYS_sethostname 170 ++#define SYS_setdomainname 171 ++#define SYS_iopl 172 ++#define SYS_ioperm 173 ++#define SYS_create_module 174 ++#define SYS_init_module 175 ++#define SYS_delete_module 176 ++#define SYS_get_kernel_syms 177 ++#define SYS_query_module 178 ++#define SYS_quotactl 179 ++#define SYS_nfsservctl 180 ++#define SYS_getpmsg 181 ++#define SYS_putpmsg 182 ++#define SYS_afs_syscall 183 ++#define SYS_tuxcall 184 ++#define SYS_security 185 ++#define SYS_gettid 186 ++#define SYS_readahead 187 ++#define SYS_setxattr 188 ++#define SYS_lsetxattr 189 ++#define SYS_fsetxattr 190 ++#define SYS_getxattr 191 ++#define SYS_lgetxattr 192 ++#define SYS_fgetxattr 193 ++#define SYS_listxattr 194 ++#define SYS_llistxattr 195 ++#define SYS_flistxattr 196 ++#define SYS_removexattr 197 ++#define SYS_lremovexattr 198 ++#define SYS_fremovexattr 199 ++#define SYS_tkill 200 ++#define SYS_time 201 ++#define SYS_futex 202 ++#define SYS_sched_setaffinity 203 ++#define SYS_sched_getaffinity 204 ++#define SYS_set_thread_area 205 ++#define SYS_io_setup 206 ++#define SYS_io_destroy 207 ++#define SYS_io_getevents 208 ++#define SYS_io_submit 209 ++#define SYS_io_cancel 210 ++#define SYS_get_thread_area 211 ++#define SYS_lookup_dcookie 212 ++#define SYS_epoll_create 213 ++#define SYS_epoll_ctl_old 214 ++#define SYS_epoll_wait_old 215 ++#define SYS_remap_file_pages 216 ++#define SYS_getdents64 217 ++#define SYS_set_tid_address 218 ++#define SYS_restart_syscall 219 ++#define SYS_semtimedop 220 ++#define SYS_fadvise64 221 ++#define SYS_timer_create 222 ++#define SYS_timer_settime 223 ++#define SYS_timer_gettime 224 ++#define SYS_timer_getoverrun 225 ++#define SYS_timer_delete 226 ++#define SYS_clock_settime 227 ++#define SYS_clock_gettime 228 ++#define SYS_clock_getres 229 ++#define SYS_clock_nanosleep 230 ++#define SYS_exit_group 231 ++#define SYS_epoll_wait 232 ++#define SYS_epoll_ctl 233 ++#define SYS_tgkill 234 ++#define SYS_utimes 235 ++#define SYS_vserver 236 ++#define SYS_mbind 237 ++#define SYS_set_mempolicy 238 ++#define SYS_get_mempolicy 239 ++#define SYS_mq_open 240 ++#define SYS_mq_unlink 241 ++#define SYS_mq_timedsend 242 ++#define SYS_mq_timedreceive 243 ++#define SYS_mq_notify 244 ++#define SYS_mq_getsetattr 245 ++#define SYS_kexec_load 246 ++#define SYS_waitid 247 ++#define SYS_add_key 248 ++#define SYS_request_key 249 ++#define SYS_keyctl 250 ++#define SYS_ioprio_set 251 ++#define SYS_ioprio_get 252 ++#define SYS_inotify_init 253 ++#define SYS_inotify_add_watch 254 ++#define SYS_inotify_rm_watch 255 ++#define SYS_migrate_pages 256 ++#define SYS_openat 257 ++#define SYS_mkdirat 258 ++#define SYS_mknodat 259 ++#define SYS_fchownat 260 ++#define SYS_futimesat 261 ++#define SYS_newfstatat 262 ++#define SYS_unlinkat 263 ++#define SYS_renameat 264 ++#define SYS_linkat 265 ++#define SYS_symlinkat 266 ++#define SYS_readlinkat 267 ++#define SYS_fchmodat 268 ++#define SYS_faccessat 269 ++#define SYS_pselect6 270 ++#define SYS_ppoll 271 ++#define SYS_unshare 272 ++#define SYS_set_robust_list 273 ++#define SYS_get_robust_list 274 ++#define SYS_splice 275 ++#define SYS_tee 276 ++#define SYS_sync_file_range 277 ++#define SYS_vmsplice 278 ++#define SYS_move_pages 279 ++#define SYS_utimensat 280 ++#define SYS_epoll_pwait 281 ++#define SYS_signalfd 282 ++#define SYS_timerfd_create 283 ++#define SYS_eventfd 284 ++#define SYS_fallocate 285 ++#define SYS_timerfd_settime 286 ++#define SYS_timerfd_gettime 287 ++#define SYS_accept4 288 ++#define SYS_signalfd4 289 ++#define SYS_eventfd2 290 ++#define SYS_epoll_create1 291 ++#define SYS_dup3 292 ++#define SYS_pipe2 293 ++#define SYS_inotify_init1 294 ++#define SYS_preadv 295 ++#define SYS_pwritev 296 ++#define SYS_rt_tgsigqueueinfo 297 ++#define SYS_perf_event_open 298 ++#define SYS_recvmmsg 299 ++#define SYS_fanotify_init 300 ++#define SYS_fanotify_mark 301 ++#define SYS_prlimit64 302 ++#define SYS_name_to_handle_at 303 ++#define SYS_open_by_handle_at 304 ++#define SYS_clock_adjtime 305 ++#define SYS_syncfs 306 ++#define SYS_sendmmsg 307 ++#define SYS_setns 308 ++#define SYS_getcpu 309 ++#define SYS_process_vm_readv 310 ++#define SYS_process_vm_writev 311 ++#define SYS_kcmp 312 ++#define SYS_finit_module 313 ++#define SYS_sched_setattr 314 ++#define SYS_sched_getattr 315 ++#define SYS_renameat2 316 ++#define SYS_seccomp 317 ++#define SYS_getrandom 318 ++#define SYS_memfd_create 319 ++#define SYS_kexec_file_load 320 ++#define SYS_bpf 321 ++#define SYS_execveat 322 diff --git a/pacman-5.0.1.local.patch b/pacman-5.0.1.local.patch new file mode 100644 index 0000000..7df4cd2 --- /dev/null +++ b/pacman-5.0.1.local.patch @@ -0,0 +1,44 @@ +--- pacman-5.0.1/lib/libalpm/Makefile.am.orig 2016-02-23 03:46:25.000000000 +0000 ++++ pacman-5.0.1/lib/libalpm/Makefile.am 2016-05-31 06:39:23.693111052 +0000 +@@ -78,6 +78,7 @@ + $(GPGME_LIBS) \ + $(LIBARCHIVE_LIBS) \ + $(LIBCURL_LIBS) \ +- $(LIBSSL_LIBS) ++ $(LIBSSL_LIBS) \ ++ $(LIBALPM_LIBS) + + # vim:set noet: +--- pacman-5.0.1/src/pacman/Makefile.am.orig 2016-02-23 03:46:25.000000000 +0000 ++++ pacman-5.0.1/src/pacman/Makefile.am 2016-05-31 08:33:33.452959027 +0000 +@@ -47,6 +47,6 @@ + util.h util.c \ + util-common.h util-common.c + +-LDADD = $(LTLIBINTL) $(top_builddir)/lib/libalpm/.libs/libalpm.la ++LDADD = $(LTLIBINTL) $(top_builddir)/lib/libalpm/libalpm.la + + # vim:set noet: +--- pacman-5.0.1/src/util/Makefile.am.orig 2016-02-23 03:46:25.000000000 +0000 ++++ pacman-5.0.1/src/util/Makefile.am 2016-05-31 08:33:48.912958683 +0000 +@@ -19,16 +19,16 @@ + $(LIBARCHIVE_CFLAGS) + + cleanupdelta_SOURCES = cleanupdelta.c +-cleanupdelta_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la ++cleanupdelta_LDADD = $(top_builddir)/lib/libalpm/libalpm.la + + pacsort_SOURCES = pacsort.c util-common.c +-pacsort_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la ++pacsort_LDADD = $(top_builddir)/lib/libalpm/libalpm.la + + pactree_SOURCES = pactree.c util-common.c +-pactree_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la ++pactree_LDADD = $(top_builddir)/lib/libalpm/libalpm.la + + testpkg_SOURCES = testpkg.c +-testpkg_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la ++testpkg_LDADD = $(top_builddir)/lib/libalpm/libalpm.la + + vercmp_SOURCES = vercmp.c + vercmp_LDADD = $(top_builddir)/lib/libalpm/libalpm_la-version.lo diff --git a/pkg.build b/pkg.build index dffcff7..c0051c4 100644 --- a/pkg.build +++ b/pkg.build @@ -90,6 +90,7 @@ if ! is_build_script_done build; then if test_cmd pkg_${PKG_NAME}_build; then pkg_${PKG_NAME}_build; else + export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; run_cmd_unsplit make \ ${PKG_MAKEFLAGS_BUILD} \ ${PKG_MAKEFLAGS_BUILD_EXTRA} \ @@ -139,6 +140,7 @@ if ! is_build_script_done install; then fi; find ${PKG_PREFIX}/lib -type f -name \*.la -exec rm -f {} \; if [ ${PKG_LIBFILES_FIX:-0} -eq 1 ]; then + env TARGET="${TARGET}" \ find . \( -name '*.so' -or -name '*.so.[0-9]' \ -or -name '*.so.[0-9].[0-9]' -or \ -name '*.so.[0-9].[0-9].[0-9]' \) \ @@ -149,8 +151,8 @@ if ! is_build_script_done install; then else SO_NAME=${SO_PNAME}; fi; \ echo perk -epdlltool ${SO_PNAME} \> ${SO_NAME}.def; \ perk -epdlltool ${SO_PNAME} > ${SO_NAME}.def; \ - echo x86_64-nt64-midipix-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ - x86_64-nt64-midipix-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ + echo ${TARGET}-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ + ${TARGET}-dlltool -l ${SO_NAME}.lib.a -D ${SO_PNAME} -d ${SO_NAME}.def; \ echo cp ${SO_NAME}.lib.a '"${PKG_PREFIX}/lib"'; \ cp ${SO_NAME}.lib.a '"${PKG_PREFIX}/lib" \;; diff --git a/psxstub.local.patch b/psxstub.local.patch new file mode 100644 index 0000000..a19da09 --- /dev/null +++ b/psxstub.local.patch @@ -0,0 +1,16 @@ +diff --git a/stub.S b/stub.S +index 1d6e11a..6874c51 100644 +--- a/stub.S ++++ b/stub.S +@@ -1,8 +1,8 @@ + .text + .globl __psx_init + .globl ___psx_init +-.globl _so_entry_point +-.globl __so_entry_point ++.weak _so_entry_point ++.weak __so_entry_point + + .def __psx_init; .scl 2; .type 32; .endef + .def ___psx_init; .scl 2; .type 32; .endef +