From f937121616866517e54f27e4e8d806c70f288ab8 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Jan 31 2017 23:56:52 +0000 Subject: vars/{build,gcc}.vars: fix build & cleanup. --- diff --git a/patches/gcc_native_x86_64_w64_mingw32.local.patch b/patches/gcc_native_x86_64_w64_mingw32.local.patch deleted file mode 100644 index ac886cf..0000000 --- a/patches/gcc_native_x86_64_w64_mingw32.local.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cbb-gcc-4.6.4/libiberty/configure.ac.orig 2016-12-19 18:27:51.909364800 +0100 -+++ cbb-gcc-4.6.4/libiberty/configure.ac 2017-01-30 03:55:45.271150700 +0100 -@@ -683,7 +683,7 @@ - - # Figure out which version of pexecute to use. - case "${host}" in -- *-*-mingw* | *-*-winnt*) pexecute=pex-win32 ;; -+ *-*-winnt*) pexecute=pex-win32 ;; - *-*-msdosdjgpp*) pexecute=pex-djgpp ;; - *-*-msdos*) pexecute=pex-msdos ;; - *) pexecute=pex-unix ;; diff --git a/patches/gcc_stage1_cross_x86_64_w64_mingw32.local.patch b/patches/gcc_stage1_cross_x86_64_w64_mingw32.local.patch new file mode 100644 index 0000000..ac886cf --- /dev/null +++ b/patches/gcc_stage1_cross_x86_64_w64_mingw32.local.patch @@ -0,0 +1,11 @@ +--- cbb-gcc-4.6.4/libiberty/configure.ac.orig 2016-12-19 18:27:51.909364800 +0100 ++++ cbb-gcc-4.6.4/libiberty/configure.ac 2017-01-30 03:55:45.271150700 +0100 +@@ -683,7 +683,7 @@ + + # Figure out which version of pexecute to use. + case "${host}" in +- *-*-mingw* | *-*-winnt*) pexecute=pex-win32 ;; ++ *-*-winnt*) pexecute=pex-win32 ;; + *-*-msdosdjgpp*) pexecute=pex-djgpp ;; + *-*-msdos*) pexecute=pex-msdos ;; + *) pexecute=pex-unix ;; diff --git a/patches/gcc_stage1_native_x86_64_w64_mingw32.local.patch b/patches/gcc_stage1_native_x86_64_w64_mingw32.local.patch new file mode 120000 index 0000000..2d07a41 --- /dev/null +++ b/patches/gcc_stage1_native_x86_64_w64_mingw32.local.patch @@ -0,0 +1 @@ +gcc_stage1_cross_x86_64_w64_mingw32.local.patch \ No newline at end of file diff --git a/vars/build.vars b/vars/build.vars index 63f3835..2b7b6f6 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -87,7 +87,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_x86_64_w64_mingw32 gcc_stage1 psxstub musl_no_complex gcc_runtime musl_full gcc_libstdcpp_v3 gcc_full file_host mdso_host pkgconf_host"; +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 mdso_host pkgconf_host"; HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_SLIBTOOL_HOST_URL:=${GITROOT}/slibtool}; : ${PKG_SLIBTOOL_HOST_URL_TYPE:=git}; @@ -110,6 +110,8 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_CONFIGURE_ARGS:=--disable-werror --prefix=${PREFIX} --target=x86_64-w64-mingw32 --with-sysroot=${PREFIX_CROSS}}; : ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_SLIBTOOL:=slibtool-static}; : ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; +: ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION:=4.6.4}; +: ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_GCC_STAGE1_VERSION:=4.6.4}; : ${PKG_PSXSTUB_URL:=${GITROOT}/psxstub}; : ${PKG_PSXSTUB_URL_TYPE:=git}; @@ -119,8 +121,6 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_MUSL_FULL_VERSION:=1.1.12}; : ${PKG_GCC_LIBSTDCPP_V3_VERSION:=4.6.4}; : ${PKG_GCC_FULL_VERSION:=4.6.4}; -: ${PKG_GCC_STAGE1_X86_64_W64_MINGW32_VERSION:=4.6.4}; -: ${PKG_GCC_STAGE1_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_FILE_HOST_SHA256SUM:=ea661277cd39bf8f063d3a83ee875432cc3680494169f952787e002bdd3884c0}; : ${PKG_FILE_HOST_VERSION:=5.29}; : ${PKG_FILE_HOST_URL:=ftp://ftp.astron.com/pub/file/file-${PKG_FILE_HOST_VERSION}.tar.gz}; @@ -143,7 +143,7 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; NATIVE_TOOLCHAIN_CFLAGS_CONFIGURE="${NATIVE_TOOLCHAIN_CFLAGS_CONFIGURE_DEFAULT}"; NATIVE_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix=/ --target=${TARGET}"; NATIVE_TOOLCHAIN_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; -NATIVE_TOOLCHAIN_PACKAGES="slibtool perk pkgconf gmp mpfr mpc libelf binutils binutils_x86_64_w64_mingw32 musl_native gcc_native mdso"; +NATIVE_TOOLCHAIN_PACKAGES="slibtool perk pkgconf gmp mpfr mpc libelf binutils binutils_x86_64_w64_mingw32 musl_native gcc_native gcc_stage1_native_x86_64_w64_mingw32 mdso"; NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; : ${PKG_SLIBTOOL_URL:=git://midipix.org/slibtool}; : ${PKG_SLIBTOOL_URL_TYPE:=git}; @@ -190,8 +190,8 @@ NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; : ${PKG_MUSL_NATIVE_VERSION:=1.1.12}; : ${PKG_MUSL_NATIVE_URL:=http://www.musl-libc.org/releases/musl-${PKG_MUSL_NATIVE_VERSION}.tar.gz}; : ${PKG_GCC_NATIVE_VERSION:=4.6.4}; -: ${PKG_GCC_NATIVE_X86_64_W64_MINGW32_VERSION:=4.6.4}; -: ${PKG_GCC_NATIVE_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; +: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION:=4.6.4}; +: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_MDSO_URL:=${GITROOT}/mdso}; : ${PKG_MDSO_URL_TYPE:=git}; : ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; diff --git a/vars/gcc.vars b/vars/gcc.vars index 9fba3fd..0301e31 100644 --- a/vars/gcc.vars +++ b/vars/gcc.vars @@ -8,11 +8,19 @@ pkgp_gcc_setup_env() { export MAKE="make LIBTOOL=slibtool"; export cbb_ldflags_for_target=--sysroot=${PKG_PREFIX} \ cbb_sysroot_for_libgcc=${PKG_PREFIX} \ - cbb_target=${PKG_TARGET} \ - cbb_neutral_libiberty=no \ - cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; + cbb_target=${PKG_TARGET}; + case ${1} in + stage1) export cbb_neutral_libiberty=no; + if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then + export cbb_xgcc_for_specs=${PKG_TARGET}-gcc; + else + export cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc; + fi; ;; + native) export cbb_xgcc_for_specs=${PKG_TARGET}-gcc \ + sysroot_headers_suffix=${PKG_PREFIX}; + esac; GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX}"; - GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${1}/libc/cbb-musl-pe.h)"; + GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${2}/libc/cbb-musl-pe.h)"; for __ in CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; do export "${__}=${GCCFLAGS}"; done; @@ -54,37 +62,52 @@ pkgp_gcc_configure() { set_build_script_done configure clean -build; }; -pkg_gcc_stage1_x86_64_w64_mingw32_all() { +pkg_gcc_stage1_cross_x86_64_w64_mingw32_all() { + pkg_gcc_stage1_all "${@}"; +}; + +pkg_gcc_stage1_native_x86_64_w64_mingw32_all() { pkg_gcc_stage1_all "${@}"; }; pkg_gcc_stage1_all() { - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - PKG_GCC_VERSION="${PKG_GCC_STAGE1_X86_64_W64_MINGW32_VERSION}"; - else + case ${PKG_NAME} in + gcc_stage1) PKG_GCC_VERSION="${PKG_GCC_STAGE1_VERSION}"; - fi; + set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; + ;; + gcc_stage1_cross_x86_64_w64_mingw32) + PKG_GCC_VERSION="${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION}"; + set_build_dir cbb-gcc-${PKG_GCC_VERSION}_cross_${PKG_TARGET} cross; + ;; + gcc_stage1_native_x86_64_w64_mingw32) + PKG_GCC_VERSION="${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION}"; + set_build_dir cbb-gcc-${PKG_GCC_VERSION}_native_${PKG_TARGET} native; + ;; + esac; # 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; - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - set_build_dir cbb-gcc-${PKG_GCC_VERSION}_${PKG_TARGET} cross; - else - set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross; - fi; - pkgp_gcc_setup_env "${PKG_GCC_VERSION}"; + pkgp_gcc_setup_env stage1 "${PKG_GCC_VERSION}"; if ! is_build_script_done configure; then insecure_mkdir ${PKG_PREFIX}/include; [ \! -d ${PKG_PREFIX}/usr ] && \ ln -s -- . ${PKG_PREFIX}/usr; if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then + patch -b -d cbb-gcc-4.6.4 -p1 < ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch; pkgp_gcc_configure \ + --build=x86_64-unknown-linux-gnu \ --enable-sjlj-exceptions \ - --prefix=${PREFIX} \ - --with-sysroot=${PREFIX}/${PKG_TARGET} \ + --host=x86_64-nt64-midipix \ + --prefix=/ \ + --with-elf=${PKG_PREFIX} \ + --with-gmp=${PKG_PREFIX} \ + --with-mpc=${PKG_PREFIX} \ + --with-mpfr=${PKG_PREFIX} \ + --with-sysroot= \ --without-headers; else pkgp_gcc_configure \ @@ -104,7 +127,11 @@ pkg_gcc_stage1_all() { set_build_script_done build -install; fi; if ! is_build_script_done install; then - make ${MAKEFLAGS} install-gcc; + if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then + make ${MAKEFLAGS} DESTDIR=${PKG_PREFIX} install-gcc; + else + make ${MAKEFLAGS} install-gcc; + fi; __="$(uname -s)"; if [ "${__#*CYGWIN*}" != "${__}" ]; then ln -s -- ${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a \ @@ -159,52 +186,31 @@ pkg_gcc_full_all() { fi; }; -pkg_gcc_native_x86_64_w64_mingw32_all() { - pkg_gcc_native_all "${@}"; -}; - pkg_gcc_native_all() { - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - PKG_GCC_VERSION="${PKG_GCC_NATIVE_X86_W64_MINGW32_VERSION}"; - else - PKG_GCC_VERSION="${PKG_GCC_NATIVE_VERSION}"; - fi; + PKG_GCC_VERSION="${PKG_GCC_NATIVE_VERSION}"; export MAKE="make LIBTOOL=slibtool"; # GCC, native. - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - set_build_dir cbb-gcc-${PKG_GCC_VERSION}_${PKG_TARGET} native; - else - set_build_dir cbb-gcc-${PKG_GCC_VERSION} native; - fi; - pkgp_gcc_setup_env "${PKG_GCC_VERSION}"; + set_build_dir cbb-gcc-${PKG_GCC_VERSION} native; + pkgp_gcc_setup_env native "${PKG_GCC_VERSION}"; if ! is_build_script_done configure; then insecure_mkdir ${PKG_PREFIX}/${PKG_TARGET}; if [ \! -d ${PKG_PREFIX}/${PKG_TARGET}/usr ]; then ln -s -- . ${PKG_PREFIX}/${PKG_TARGET}/usr; fi; - if [ "${PKG_TARGET}" = "x86_64-w64-mingw32" ]; then - patch -b -d ${PKG_SUBDIR} -p1 < ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch; - pkgp_gcc_configure \ - --build=x86_64-unknown-linux-gnu \ - --enable-sjlj-exceptions \ - --host=x86_64-nt64-midipix \ - --prefix=/ \ - --with-elf=${PKG_PREFIX} \ - --with-gmp=${PKG_PREFIX} \ - --with-mpc=${PKG_PREFIX} \ - --with-mpfr=${PKG_PREFIX} \ - --with-sysroot= \ - --without-headers; + if [ "${ARCH}" = nt32 ]; then + _pgna_host="i686-nt32-midipix"; else - pkgp_gcc_configure \ - --disable-sjlj-exceptions \ - --prefix=/ \ - --with-elf=${PKG_PREFIX} \ - --with-gmp=${PKG_PREFIX} \ - --with-mpc=${PKG_PREFIX} \ - --with-mpfr=${PKG_PREFIX} \ - --with-sysroot=; + _pgna_host="x86_64-nt64-midipix"; fi; + pkgp_gcc_configure \ + --disable-sjlj-exceptions \ + --host=${_pgna_host} \ + --prefix=/ \ + --with-elf=${PKG_PREFIX} \ + --with-gmp=${PKG_PREFIX} \ + --with-mpc=${PKG_PREFIX} \ + --with-mpfr=${PKG_PREFIX} \ + --with-sysroot=; else cd ${PKG_BUILD_DIR}; fi; diff --git a/vars/gcc_native_x86_64_w64_mingw32.vars b/vars/gcc_native_x86_64_w64_mingw32.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_native_x86_64_w64_mingw32.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars b/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_native_x86_64_w64_mingw32.vars b/vars/gcc_stage1_native_x86_64_w64_mingw32.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_stage1_native_x86_64_w64_mingw32.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_x86_64_w64_mingw32.vars b/vars/gcc_stage1_x86_64_w64_mingw32.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_stage1_x86_64_w64_mingw32.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file