Skip to content
Snippets Groups Projects
Commit 42c54eba authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Added win32 and win64 toolchains

parent 3501f0d0
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,8 @@
#@ load("/components/toolchain/arch/s390x.lib.yml", "s390x_toolchain_components")
#@ load("/components/toolchain/arch/mips.lib.yml", "mips_toolchain_components")
#@ load("/components/toolchain/arch/mipsel.lib.yml", "mipsel_toolchain_components")
#@ load("/components/toolchain/arch/win32.lib.yml", "win32_toolchain_components")
#@ load("/components/toolchain/arch/win64.lib.yml", "win64_toolchain_components")
#@ load("/global_options.lib.yml", "options")
......@@ -63,4 +65,7 @@ components:
_: #@ template.replace(mips_toolchain_components)
_: #@ template.replace(mipsel_toolchain_components)
_: #@ template.replace(win64_toolchain_components)
_: #@ template.replace(win32_toolchain_components)
options: #@ options
#@ load("/components/toolchain/lib/toolchain.lib.yml", "create_toolchain_components")
#@ def _params():
toolchain_name: win32
triple: i686-w64-mingw32
binutils_version: "2.25.1"
gdb_version: "8.2.1"
mingw64_version: "6.0.0"
gcc_version: "7.3.0"
extra_gcc_configure_options:
- --without-cloog
- --without-isl
- --disable-libsanitizer
- --disable-libssp
- --disable-shared
dynamic: "0"
#@ end
---
#@ win32_toolchain_components = create_toolchain_components(**_params())
#@ load("/components/toolchain/lib/toolchain.lib.yml", "create_toolchain_components")
#@ def _params():
toolchain_name: win64
triple: x86_64-w64-mingw32
binutils_version: "2.25.1"
gdb_version: "8.2.1"
mingw64_version: "6.0.0"
gcc_version: "7.3.0"
extra_gcc_configure_options:
- --without-cloog
- --without-isl
- --disable-libsanitizer
- --disable-libssp
- --disable-shared
dynamic: "0"
#@ end
---
#@ win64_toolchain_components = create_toolchain_components(**_params())
......@@ -99,7 +99,7 @@ dependencies: #@ dependencies
#@yaml/text-templated-strings
---
#@ def dependencies(stage, toolchain_name, musl_version, uclibc_version, linux_version):
#@ def dependencies(stage, toolchain_name, musl_version, uclibc_version, linux_version, mingw64_version):
#@ if stage == 1:
#@ build = "@headers"
#@ elif stage == 2:
......@@ -117,6 +117,8 @@ dependencies: #@ dependencies
- toolchain/(@= toolchain_name @)/musl(@= build @)
#@ if/end uclibc_version:
- toolchain/(@= toolchain_name @)/uclibc(@= build @)
#@ if/end mingw64_version:
- toolchain/(@= toolchain_name @)/mingw64(@= build @)
#@ if/end linux_version:
- toolchain/(@= toolchain_name @)/linux-headers
......@@ -132,10 +134,11 @@ dependencies: #@ dependencies
#@ musl_version=None,
#@ uclibc_version=None,
#@ linux_version=None,
#@ mingw64_version=None,
#@ **kwargs
#@ ):
#@ stage1_deps = dependencies(1, toolchain_name, musl_version, uclibc_version, linux_version)
#@ stage2_deps = dependencies(2, toolchain_name, musl_version, uclibc_version, linux_version)
#@ stage1_deps = dependencies(1, toolchain_name, musl_version, uclibc_version, linux_version, mingw64_version)
#@ stage2_deps = dependencies(2, toolchain_name, musl_version, uclibc_version, linux_version, mingw64_version)
default_build: stage2
builds:
stage1: #@ gcc_build(build_specific_configure_options="--enable-languages=c", dependencies=stage1_deps, **kwargs)
......
#@ load("@ytt:template", "template")
#@ load("/lib/make.lib.yml", "make")
#@ load("/lib/fn_args.lib.yml", "mandatory")
#@ load("/lib/assert.lib.yml", "assert")
#@ load("/components/toolchain/lib/common.lib.yml", "new_gcc_path")
#@yaml/text-templated-strings
---
#@ def mingw64_build(
#@ triple=mandatory,
#@ gcc_version=mandatory,
#@ mingw64_version=mandatory,
#@ build_type=mandatory,
#@ ):
#@ assert(build_type in ["headers", "default"])
#@ source_url = "https://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v" + mingw64_version + ".tar.bz2"
configure: |
extract.sh --into "$BUILD_DIR" "(@= source_url @)"
cd "$BUILD_DIR"
(@ if build_type == "default": @)
NEW_GCC_PATH="(@= new_gcc_path(triple=triple, gcc_version=gcc_version) @)"
NEW_GCC=${NEW_GCC_PATH}/(@= triple @)-gcc
export CC="${NEW_GCC}"
export CPPFLAGS="-I${ORCHESTRA_ROOT}/(@= triple @)/usr/include"
export CHOST="(@= triple @)"
(@ end -@)
"$BUILD_DIR/configure" \
--disable-silent-rules \
--target=(@= triple @) \
--with-sysroot=no \
--prefix="$ORCHESTRA_ROOT/(@= triple @)/usr" \
--with-headers \
--enable-sdk \
--without-libraries \
--without-tools \
(@- if build_type == "default": @)
--with-crt \
--host=(@= triple @) \
--disable-idl \
$($NEW_GCC -E -dM - < /dev/null | grep -q __MINGW64__ && echo --disable-lib32 --enable-lib64 || echo --enable-lib32 --disable-lib64)
(@- elif build_type == "headers": @)
--without-crt \
--without-idl
(@- end @)
install: |
cd "$BUILD_DIR"
(@= make @)
(@= make @) install
rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/mingw"
ln -s usr "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/mingw"
rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/(@= triple @)"
ln -s usr "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/(@= triple @)"
rm -f usr/include "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/sys-include"
ln -s usr/include "${TMP_ROOT}${ORCHESTRA_ROOT}/(@= triple @)/sys-include"
#@ if/end build_type == "default":
dependencies:
- toolchain/win64/gcc@stage1
- toolchain/win64/mingw64@headers
#@ end
#@yaml/text-templated-strings
---
#@ def create_mingw64_component(toolchain_name=mandatory, **kwargs):
default_build: default
builds:
headers: #@ mingw64_build(build_type="headers", **kwargs)
default: #@ mingw64_build(build_type="default", **kwargs)
#@ end
......@@ -7,6 +7,7 @@
#@ load("/components/toolchain/lib/musl.lib.yml", "create_musl_component")
#@ load("/components/toolchain/lib/uclibc.lib.yml", "create_uclibc_component")
#@ load("/components/toolchain/lib/coreutils.lib.yml", "create_coreutils_component")
#@ load("/components/toolchain/lib/mingw64.lib.yml", "create_mingw64_component")
#@yaml/text-templated-strings
---
......@@ -15,17 +16,18 @@
#@ triple=mandatory,
#@ linux_arch_name=None,
#@ linux_version=None,
#@ binutils_version=None, # x86_64, i386, aarch64, arm, mips, host
#@ coreutils_version=None, # x86_64, i386, aarch64, mips, arm,
#@ musl_version=None, # x86_64, i386, aarch64, mips,
#@ uclibc_arch_name=None, # arm,
#@ uclibc_version=None, # arm,
#@ gdb_version=None, # x86_64, i386, aarch64, arm, mips, host
#@ gcc_version=None, # x86_64, i386, aarch64, arm, host
#@ gcc_sysroot=None, # host
#@ extra_gcc_configure_options=None, # x86_64, i386, aarch64, mips, arm, host
#@ extra_gcc_make_variables="", # host
#@ dynamic=None # x86_64, i386, aarch64, mips, arm,
#@ binutils_version=None,
#@ coreutils_version=None,
#@ musl_version=None,
#@ uclibc_arch_name=None,
#@ uclibc_version=None,
#@ gdb_version=None,
#@ gcc_version=None,
#@ gcc_sysroot=None,
#@ mingw64_version=None,
#@ extra_gcc_configure_options=None,
#@ extra_gcc_make_variables="",
#@ dynamic=None
#@ ):
#@ if/end binutils_version:
......@@ -38,7 +40,10 @@
(@= "toolchain/" + toolchain_name + "/linux-headers" @): #@ create_linux_headers_component(triple=triple, linux_version=linux_version, arch_name=linux_arch_name)
#@ if/end gcc_version:
(@= "toolchain/" + toolchain_name + "/gcc" @): #@ create_gcc_component(toolchain_name=toolchain_name, triple=triple, gcc_sysroot=gcc_sysroot, gcc_version=gcc_version, extra_gcc_configure_options=extra_gcc_configure_options, extra_gcc_make_variables=extra_gcc_make_variables, musl_version=musl_version, uclibc_version=uclibc_version, linux_version=linux_version)
(@= "toolchain/" + toolchain_name + "/gcc" @): #@ create_gcc_component(toolchain_name=toolchain_name, triple=triple, gcc_sysroot=gcc_sysroot, gcc_version=gcc_version, extra_gcc_configure_options=extra_gcc_configure_options, extra_gcc_make_variables=extra_gcc_make_variables, musl_version=musl_version, uclibc_version=uclibc_version, linux_version=linux_version, mingw64_version=mingw64_version)
#@ if/end mingw64_version:
(@= "toolchain/" + toolchain_name + "/mingw64" @): #@ create_mingw64_component(toolchain_name=toolchain_name, triple=triple, mingw64_version=mingw64_version, gcc_version=gcc_version)
#@ if/end musl_version:
(@= "toolchain/" + toolchain_name + "/musl" @): #@ create_musl_component(triple=triple, musl_version=musl_version, toolchain_name=toolchain_name, gcc_version=gcc_version)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment