Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Set ucrt as default runtime library #206

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Set-PSDebug -Trace 2 # echo on

if ( -not $env:ARCH ) { $env:ARCH = "aarch64" }
if ( -not $env:PLATFORM ) { $env:PLATFORM = "w64-mingw32" }
if ( -not $env:CRT ) { $env:CRT = "msvcrt" }
if ( -not $env:CRT ) { $env:CRT = "ucrt" }
if ( -not $env:TARGET ) { $env:TARGET = "$env:ARCH-$env:PLATFORM" }
if ( -not $env:TOOLCHAIN_NAME ) { $env:TOOLCHAIN_NAME = "$env:ARCH-$env:PLATFORM-$env:CRT" }

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COCOM_BRANCH=${COCOM_BRANCH:-master}
ARCH=${ARCH:-aarch64}
PLATFORM=${PLATFORM:-w64-mingw32}
if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
CRT=${CRT:-msvcrt}
CRT=${CRT:-ucrt}
else
CRT=${CRT:-libc}
fi
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ env:

ARCH: aarch64
PLATFORM: w64-mingw32
CRT: msvcrt
CRT: ucrt
TOOLCHAIN_PATH: ${{ github.workspace }}/cross
TOOLCHAIN_NAME: aarch64-w64-mingw32-msvcrt
TOOLCHAIN_ARTIFACT_NAME: aarch64-w64-mingw32-msvcrt-toolchain
TOOLCHAIN_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-toolchain.tar.gz
RUNTIME_ARTIFACT_NAME: aarch64-w64-mingw32-msvcrt-toolchain
RUNTIME_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-runtime.tar.gz
TESTS_ARTIFACT_NAME: aarch64-w64-mingw32-msvcrt-tests
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-tests.tar.gz
TOOLCHAIN_NAME: aarch64-w64-mingw32-ucrt
TOOLCHAIN_ARTIFACT_NAME: aarch64-w64-mingw32-ucrt-toolchain
TOOLCHAIN_PACKAGE_NAME: aarch64-w64-mingw32-ucrt-toolchain.tar.gz
RUNTIME_ARTIFACT_NAME: aarch64-w64-mingw32-ucrt-toolchain
RUNTIME_PACKAGE_NAME: aarch64-w64-mingw32-ucrt-runtime.tar.gz
TESTS_ARTIFACT_NAME: aarch64-w64-mingw32-ucrt-tests
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-ucrt-tests.tar.gz

SOURCE_PATH: ${{ github.workspace }}/code
BUILD_PATH: ${{ github.workspace }}/build
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
CRT: ${{ matrix.crt }}
PACK_TOOLCHAIN: ${{ matrix.arch == 'aarch64' && matrix.platform == 'w64-mingw32' && matrix.crt == 'msvcrt' }}
PACK_TOOLCHAIN: ${{ matrix.arch == 'aarch64' && matrix.platform == 'w64-mingw32' && matrix.crt == 'ucrt' }}
TOOLCHAIN_NAME: ${{ matrix.arch }}-${{ matrix.platform }}-${{ matrix.crt }}
TOOLCHAIN_ARTIFACT_NAME: ${{ matrix.arch }}-${{ matrix.platform }}-${{ matrix.crt }}-toolchain
TOOLCHAIN_PACKAGE_NAME: ${{ matrix.arch }}-${{ matrix.platform }}-${{ matrix.crt }}-toolchain.tar.gz
Expand Down Expand Up @@ -386,7 +386,7 @@ jobs:
runs-on: ubuntu-latest

env:
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-tests.tar.gz
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-ucrt-tests.tar.gz

steps:
- name: Checkout repository
Expand Down Expand Up @@ -429,7 +429,7 @@ jobs:
runs-on: [Windows, GCC, ARM64]

env:
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-tests.tar.gz
TESTS_PACKAGE_NAME: aarch64-w64-mingw32-ucrt-tests.tar.gz

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
crt:
description: 'C runtime to build for'
required: false
default: 'msvcrt'
default: 'ucrt'
tag:
description: 'Tag to use for the artifact'
required: true
Expand Down Expand Up @@ -66,7 +66,7 @@ env:

ARCH: ${{ inputs.arch || 'x86_64' }}
PLATFORM: ${{ inputs.platform || 'w64-mingw32' }}
CRT: ${{ inputs.crt || 'msvcrt' }}
CRT: ${{ inputs.crt || 'ucrt' }}

TAG: ${{ inputs.tag || 'test' }}
MODULE: ${{ inputs.gcc_module || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
crt:
description: 'C runtime to build for'
required: false
default: 'msvcrt'
default: 'ucrt'
workflow_call:
inputs:
binutils_branch_baseline:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ which is the default. To see what will be installed refer to

# Building the Cross-Compiler

To build the cross-compiler and install it into a `~/cross-aarch64-w64-mingw32-msvcrt` folder,
To build the cross-compiler and install it into a `~/cross-aarch64-w64-mingw32-ucrt` folder,
follow these steps:

1. Clone the repository:
Expand Down Expand Up @@ -69,7 +69,7 @@ The build script does multiple things:

After building the toolchain, to build a simple C source code file run:
```bash
export PATH="~/cross-aarch64-w64-mingw32-msvcrt/bin:$PATH"
export PATH="~/cross-aarch64-w64-mingw32-ucrt/bin:$PATH"
aarch64-w64-mingw32-gcc hello.c -o hello.exe
```

Expand Down
6 changes: 5 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
if (NOT DEFINED ENV{TARGET})
set(ENV{TARGET} "aarch64-w64-mingw32")
endif()
if (NOT DEFINED ENV{CRT})
set(ENV{CRT} "ucrt")
endif()
if (NOT DEFINED ENV{TOOLCHAIN_NAME})
set(ENV{TOOLCHAIN_NAME} "$ENV{TARGET}-msvcrt")
set(ENV{TOOLCHAIN_NAME} "$ENV{TARGET}-$ENV{CRT}")
endif()
if (NOT DEFINED ENV{TOOLCHAIN_PATH})
set(ENV{TOOLCHAIN_PATH} "$ENV{HOME}/cross-$ENV{TOOLCHAIN_NAME}")
endif()

set(CMAKE_C_COMPILER "$ENV{TOOLCHAIN_PATH}/bin/$ENV{TARGET}-gcc")
set(CMAKE_CXX_COMPILER "$ENV{TOOLCHAIN_PATH}/bin/$ENV{TARGET}-g++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
set(CMAKE_RANLIB "$ENV{TOOLCHAIN_PATH}/bin/$ENV{TARGET}-ranlib")

Expand Down
Loading