From e9e7412fdf98292459bdd09bfc2f6107cb604ea1 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Oct 25 2017 18:27:43 +0000 Subject: vars/build.vars: build mdso_host prior to toolchain and {psxtypes,ldso}_host prior to the runtime components. vars/build.vars:mdso{,_host}: additionally install mdso to ${TARGET}/bin/mdso. vars/build.vars:ldso_host: additionally install libldso.a to ${PREFIX}/lib/libldso.a. vars/build.vars:ldso: additionally install libldso.a to ${TARGET}/lib/libldso.a. vars/build.vars:python3: pass -mout-dsolib vs. -mout-implib in ${BLDSHARED} (via midipix.) subr/build.subr:install_files(): fix -v flag & only prepend ${_prefix} w/ relative pathnames during {ln,mkdir,cp}. subr/pre_subdirs.subr:pre_subdirs(): mkdir ${PREFIX_TARGET}/bin. vars/gcc.vars:pkgp_gcc_setup_env(): pass -midata in ${GCCTARGET_FLAGS} (via midipix.) --- diff --git a/subr/build.subr b/subr/build.subr index 1ce52c3..0e5bea4 100644 --- a/subr/build.subr +++ b/subr/build.subr @@ -48,7 +48,7 @@ install_files() { local _verbose _prefix _ln_target _ln_fname _mkdir_fname \ _file_fname_src _file_fname_dst; if [ "${1}" = "-v" ]; then - _verbose="${1}"; shift; + _verbose=1; shift; fi; _prefix="${1}"; shift; while [ ${#} -gt 0 ]; do case "${1}" in @@ -56,22 +56,31 @@ install_files() { _ln_target="${1%=*}"; _ln_target="${_ln_target#@}"; _ln_fname="${1#*=}"; + if [ "${_ln_fname#/}" = "${_ln_fname}" ]; then + _ln_fname="${_prefix:+${_prefix}/}${_ln_fname}"; + fi; if [ -e "${_ln_fname}" ]; then if [ ${_verbose:-0} -eq 1 ]; then echo build_fileop rm "${_ln_fname}"; fi; build_fileop rm "${_ln_fname}"; fi; - build_fileop ln_symbolic "${_ln_target}" "${_prefix:+${_prefix}/}${_ln_fname}"; + build_fileop ln_symbolic "${_ln_target}" "${_ln_fname}"; ;; /=*) _mkdir_fname="${1#/=}"; - build_fileop mkdir "${_prefix:+${_prefix}/}${_mkdir_fname}"; + if [ "${_mkdir_fname#/}" = "${_mkdir_fname}" ]; then + _mkdir_fname="${_prefix:+${_prefix}/}${_mkdir_fname}"; + fi; + build_fileop mkdir "${_mkdir_fname}"; ;; *) _file_fname_src="${1%=*}"; _file_fname_dst="${1#*=}"; - build_fileop cp "${_file_fname_src}" "${_prefix:+${_prefix}/}${_file_fname_dst}"; + if [ "${_file_fname_dst#/}" = "${_file_fname_dst}" ]; then + _file_fname_dst="${_prefix:+${_prefix}/}${_file_fname_dst}"; + fi; + build_fileop cp "${_file_fname_src}" "${_file_fname_dst}"; ;; esac; shift; done; diff --git a/subr/pre_subdirs.subr b/subr/pre_subdirs.subr index 92980b8..bf997b7 100644 --- a/subr/pre_subdirs.subr +++ b/subr/pre_subdirs.subr @@ -20,6 +20,7 @@ pre_subdirs() { /=${PREFIX_CROSS} \ /=${PREFIX_MINIPIX}/bin \ /=${PREFIX_NATIVE} \ + /=${PREFIX_TARGET}/bin \ /=${PREFIX_TARGET}/lib \ @.=${PREFIX}/usr \ @.=${PREFIX}/x86_64-w64-mingw32/mingw \ diff --git a/vars/build.vars b/vars/build.vars index 9d57846..fc42352 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -90,7 +90,7 @@ INVARIANTS_PACKAGES="chainport"; HOST_TOOLCHAIN_BUILD_TYPE="host"; HOST_TOOLCHAIN_CFLAGS_CONFIGURE="${HOST_TOOLCHAIN_CFLAGS_CONFIGURE_DEFAULT}"; HOST_TOOLCHAIN_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; -HOST_TOOLCHAIN_PACKAGES="slibtool_host perk_host binutils_host binutils_host_x86_64_w64_mingw32 gcc_stage1_cross_x86_64_w64_mingw32 gcc_stage1 psxstub musl_no_complex gcc_runtime musl_full gcc_libstdcpp_v3 gcc_full file_host install_strip_host mdso_host pkgconf_host"; +HOST_TOOLCHAIN_PACKAGES="slibtool_host perk_host mdso_host binutils_host binutils_host_x86_64_w64_mingw32 gcc_stage1_cross_x86_64_w64_mingw32 gcc_stage1 psxstub musl_no_complex gcc_runtime musl_full gcc_libstdcpp_v3 gcc_full file_host install_strip_host psxtypes_host ldso_host pkgconf_host"; HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_SLIBTOOL_HOST_URLS_GIT:="slibtool=${GITROOT}/slibtool"}; : ${PKG_SLIBTOOL_HOST_CONFIGURE_ARGS:=--host= --prefix=}; @@ -102,6 +102,12 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_PERK_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX}"}; : ${PKG_PERK_HOST_PREFIX:=${PREFIX}}; : ${PKG_PERK_HOST_SUBDIR:=perk}; +: ${PKG_MDSO_HOST_URLS_GIT:="mdso=${GITROOT}/mdso"}; +: ${PKG_MDSO_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; +: ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso bin/mdso=${TARGET}/bin/mdso"}; +: ${PKG_MDSO_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX}"}; +: ${PKG_MDSO_HOST_PREFIX:=${PREFIX}}; +: ${PKG_MDSO_HOST_SUBDIR:=mdso}; : ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; : ${PKG_BINUTILS_HOST_VERSION:=2.24.51}; : ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_VERSION}.tar.bz2}; @@ -130,12 +136,18 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_FILE_HOST_CONFIGURE_ARGS:="-C --prefix=${PREFIX}"}; : ${PKG_INSTALL_STRIP_HOST_BUILD_STEPS:="setup_env:always install:main"}; : ${PKG_INSTALL_STRIP_HOST_URL:=none}; -: ${PKG_MDSO_HOST_URLS_GIT:="mdso=${GITROOT}/mdso"}; -: ${PKG_MDSO_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; -: ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso"}; -: ${PKG_MDSO_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX}"}; -: ${PKG_MDSO_HOST_PREFIX:=${PREFIX}}; -: ${PKG_MDSO_HOST_SUBDIR:=mdso}; +: ${PKG_PSXTYPES_HOST_URLS_GIT:=psxtypes=${GITROOT}/psxtypes}; +: ${PKG_PSXTYPES_HOST_BUILD_DIR:=psxtypes}; +: ${PKG_PSXTYPES_HOST_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_CROSS}"}; +: ${PKG_PSXTYPES_HOST_MAKEFLAGS_INSTALL:="DESTDIR=${PREFIX_CROSS}"}; +: ${PKG_PSXTYPES_HOST_SUBDIR:=psxtypes}; +: ${PKG_LDSO_HOST_URLS_GIT:=pemagine=${GITROOT}/pemagine}; +: ${PKG_LDSO_HOST_CFLAGS_CONFIGURE_EXTRA:="-O0 -DPE_LDSO -I${PREFIX_CROSS}/include"}; +: ${PKG_LDSO_HOST_CONFIGURE_ARGS:="--host=${TARGET} --prefix= --target=${TARGET} --disable-shared"}; +: ${PKG_LDSO_HOST_INSTALL_FILES:="@../${TARGET}/lib/libldso.a=${PREFIX}/lib/libldso.a"}; +: ${PKG_LDSO_HOST_MAKEFLAGS_BUILD_EXTRA:=STATIC_LIB_NAME=libldso.a}; +: ${PKG_LDSO_HOST_MAKEFLAGS_INSTALL_EXTRA:="DESTDIR=${PREFIX_CROSS} STATIC_LIB_NAME=libldso.a"}; +: ${PKG_LDSO_HOST_SUBDIR:=pemagine}; : ${PKG_PKGCONF_HOST_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; : ${PKG_PKGCONF_HOST_VERSION:=0.9.12}; : ${PKG_PKGCONF_HOST_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_HOST_VERSION}/pkgconf-${PKG_PKGCONF_HOST_VERSION}.tar.bz2}; @@ -200,7 +212,7 @@ NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_MDSO_URLS_GIT:="mdso=${GITROOT}/mdso"}; : ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; -: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso"}; +: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso @../../bin/mdso=${TARGET}/bin/mdso"}; : ${PKG_MDSO_SUBDIR:=mdso}; # @@ -227,6 +239,7 @@ RUNTIME_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LDSO_URLS_GIT:=pemagine=${GITROOT}/pemagine}; : ${PKG_LDSO_CFLAGS_CONFIGURE_EXTRA:="-O0 -DPE_LDSO"}; : ${PKG_LDSO_CONFIGURE_ARGS_EXTRA:=--disable-shared}; +: ${PKG_LDSO_INSTALL_FILES:="@libldso.a=${TARGET}/lib/libldso.a"}; : ${PKG_LDSO_MAKEFLAGS_BUILD_EXTRA:=STATIC_LIB_NAME=libldso.a}; : ${PKG_LDSO_MAKEFLAGS_INSTALL_EXTRA:=STATIC_LIB_NAME=libldso.a}; : ${PKG_LDSO_SUBDIR:=pemagine}; @@ -923,7 +936,7 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PYTHON3_VERSION:=3.5.1}; : ${PKG_PYTHON3_URL:=https://www.python.org/ftp/python/${PKG_PYTHON3_VERSION}/Python-${PKG_PYTHON3_VERSION}.tgz}; : ${PKG_PYTHON3_CONFIGURE_ARGS:="--build=x86_64 -C --enable-ipv6 --enable-shared --host=${TARGET} --prefix=${PREFIX_NATIVE} --without-ensurepip"}; -: ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${TARGET}-gcc -shared -mout-implib --sysroot=${PREFIX_NATIVE}:CC=${TARGET}-gcc:CFLAGS=--sysroot=${PREFIX_NATIVE}:CPPFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=-L${PREFIX_NATIVE}/lib"}: +: ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${TARGET}-gcc -shared -mout-dsolib --sysroot=${PREFIX_NATIVE}:CC=${TARGET}-gcc:CFLAGS=--sysroot=${PREFIX_NATIVE}:CPPFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=-L${PREFIX_NATIVE}/lib"}: : ${PKG_PYTHON3_MAKEFLAGS_INSTALL_EXTRA:=prefix=}; : ${PKG_PYTHON3_SUBDIR:=Python-${PKG_PYTHON3_VERSION}}; : ${PKG_QPDF_SHA256SUM:=a9fdc7e94d38fcd3831f37b6e0fe36492bf79aa6d54f8f66062cf7f9c4155233}; diff --git a/vars/gcc.vars b/vars/gcc.vars index 684a64d..18d27fd 100644 --- a/vars/gcc.vars +++ b/vars/gcc.vars @@ -24,7 +24,7 @@ pkgp_gcc_setup_env() { export cbb_xgcc_for_specs="${PKG_TARGET}-gcc" \ sysroot_headers_suffix="${PKG_PREFIX}"; ;; esac; - GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX}"; + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX} -midata"; GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f "${WORKDIR}/cbb-gcc-${1}/libc/cbb-musl-pe.h")"; for __ in CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; do export "${__}=${GCCFLAGS}";