From: ljsebald <ljs...@us...> - 2023-03-27 03:20:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 6ab415e46b610a38b3b46d06c450a8d024a9cd66 (commit) via 4d9d2116d52484b70177902618f3828e8660bb8b (commit) from 50501862f2535d496fed4fd00adbd3769af2adbe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6ab415e46b610a38b3b46d06c450a8d024a9cd66 Merge: 5050186 4d9d211 Author: Lawrence Sebald <ljs...@us...> Date: Sun Mar 26 23:18:24 2023 -0400 Merge pull request #137 from cepawiel/dcchain-disable-patching Add use_kos_patches option to dc-chain config commit 4d9d2116d52484b70177902618f3828e8660bb8b Author: Colton Pawielski <cep...@mt...> Date: Thu Mar 23 19:59:37 2023 -0500 Add use_kos_patches option to dc-chain config Adds the ability to build fully raw toolchains without applying any KOS patches. As it was the patchs would still be applied causing modifications to the sh-elf target's compile options. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/Makefile | 2 +- utils/dc-chain/README.md | 14 ++++++++++++-- utils/dc-chain/config.mk.legacy.sample | 10 +++++++--- utils/dc-chain/config.mk.stable.sample | 5 +++++ utils/dc-chain/config.mk.testing.sample | 5 +++++ utils/dc-chain/scripts/init.mk | 18 ++++++++++++++++-- utils/dc-chain/scripts/patch.mk | 13 +++++++++++++ 7 files changed, 59 insertions(+), 8 deletions(-) diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile index 75e8c0d..6b216b0 100644 --- a/utils/dc-chain/Makefile +++ b/utils/dc-chain/Makefile @@ -29,7 +29,7 @@ include scripts/init.mk # Makefile variables include scripts/variables.mk -all: patch build +all: build # ---- patch {{{ diff --git a/utils/dc-chain/README.md b/utils/dc-chain/README.md index c46e508..7327626 100644 --- a/utils/dc-chain/README.md +++ b/utils/dc-chain/README.md @@ -237,13 +237,23 @@ This flag is here mainly for producing [DreamSDK](https://dreamsdk.org). ### Automatic fixup SH-4 Newlib (use with care) Set `auto_fixup_sh4_newlib` to `0` if you want to disable the automatic fixup -SH-4 Newlib needed by KallistiOS. This will keep the generated toolchain -completely raw. +SH-4 Newlib needed by KallistiOS. Setting this option along with +`use_kos_patches=0` will keep the generated toolchain completely raw. **Note:** If you disable this flag, the KallistiOS threading model (`kos`) will be unavailable. Also, this may be a problem if you still apply the KallistiOS patches. **Use this flag with care**. +### Automatic KOS Patching (use with care) +Set `use_kos_patches` to `0` if you want to skip applying the KOS patches +to the downloaded sources before building. Setting this option along with +`auto_fixup_sh4_newlib=0` will keep the generated toolchain completely raw. + +**Note:** If you disable this flag, the KallistiOS threading model (`kos`) will +be unavailable. Also, this may be a problem if you still apply the KallistiOS +patches. **Use this flag with care**. + + ## Usage After installing all the prerequisites and tweaking the configuration with the diff --git a/utils/dc-chain/config.mk.legacy.sample b/utils/dc-chain/config.mk.legacy.sample index f3f3e43..42202b9 100644 --- a/utils/dc-chain/config.mk.legacy.sample +++ b/utils/dc-chain/config.mk.legacy.sample @@ -141,11 +141,15 @@ install_mode=install-strip # Automatic fixup SH-4 Newlib (1|0) # Uncomment this if you want to disable the automatic fixup sh4 newlib needed by -# KallistiOS. This will keep the generated toolchain completely raw. This will -# also disable the 'kos' thread model. Don't mess with that flag unless you know -# exactly what you are doing. +# KallistiOS. This will also disable the 'kos' thread model. Don't mess with that +# flag unless you know exactly what you are doing. #auto_fixup_sh4_newlib=0 +# Automatic patching for KOS (1|0) +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. +#use_kos_patches=0 + # Force installation of BFD for SH (1|0) # Uncomment this if you want to force the installation of 'libbfd' for the SH # toolchain. This is required for MinGW/MSYS and can't be disabled in this diff --git a/utils/dc-chain/config.mk.stable.sample b/utils/dc-chain/config.mk.stable.sample index c06b9b9..99533a1 100644 --- a/utils/dc-chain/config.mk.stable.sample +++ b/utils/dc-chain/config.mk.stable.sample @@ -146,6 +146,11 @@ install_mode=install-strip # exactly what you are doing. #auto_fixup_sh4_newlib=0 +# Automatic patching for KOS (1|0) +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. +#use_kos_patches=0 + # Force installation of BFD for SH (1|0) # Uncomment this if you want to force the installation of 'libbfd' for the SH # toolchain. This is required for MinGW/MSYS and can't be disabled in this diff --git a/utils/dc-chain/config.mk.testing.sample b/utils/dc-chain/config.mk.testing.sample index 1823548..a1f5db5 100644 --- a/utils/dc-chain/config.mk.testing.sample +++ b/utils/dc-chain/config.mk.testing.sample @@ -146,6 +146,11 @@ install_mode=install-strip # exactly what you are doing. #auto_fixup_sh4_newlib=0 +# Automatic patching for KOS (1|0) +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. +#use_kos_patches=0 + # Force installation of BFD for SH (1|0) # Uncomment this if you want to force the installation of 'libbfd' for the SH # toolchain. This is required for MinGW/MSYS and can't be disabled in this diff --git a/utils/dc-chain/scripts/init.mk b/utils/dc-chain/scripts/init.mk index 8063bf9..b90e61a 100644 --- a/utils/dc-chain/scripts/init.mk +++ b/utils/dc-chain/scripts/init.mk @@ -114,12 +114,26 @@ curl_cmd=curl -C - -O do_auto_fixup_sh4_newlib := 1 ifdef auto_fixup_sh4_newlib ifeq (0,$(auto_fixup_sh4_newlib)) + $(warning 'Disabling Newlib Auto Fixup) do_auto_fixup_sh4_newlib := 0 endif endif -ifeq (0,$(do_auto_fixup_sh4_newlib)) - ifeq (kos,$(thread_model)) +# Determine if we want to apply KOS patches to GCC/Newlib/Binutils +do_kos_patching := 1 +ifdef use_kos_patches + ifeq (0,$(use_kos_patches)) + $(warning 'Disabling KOS Patches) + do_kos_patching := 0 + endif +endif + +# Report an error if KOS threading is enabled when patching or fixup is disabled +ifeq (kos,$(thread_model)) + ifeq (0,$(do_auto_fixup_sh4_newlib)) $(error kos thread model is unsupported when Newlib fixup is disabled) endif + ifeq (0,$(do_kos_patching)) + $(error kos thread model is unsupported when KOS patches are disabled) + endif endif diff --git a/utils/dc-chain/scripts/patch.mk b/utils/dc-chain/scripts/patch.mk index bb64f16..6901a25 100644 --- a/utils/dc-chain/scripts/patch.mk +++ b/utils/dc-chain/scripts/patch.mk @@ -32,6 +32,19 @@ patch_gcc = patch-sh4-gcc patch-arm-gcc patch_newlib = patch-sh4-newlib patch_kos = patch-kos +# Patch +# Apply sh4 newlib fixups (default is yes and this should be always the case!) +ifeq (1,$(do_kos_patching)) +# Add Build Pre-Requisites for SH4 Steps + build-sh4-binutils: patch-sh4-binutils + build-sh4-gcc-pass1 build-sh4-gcc-pass2: patch-sh4-gcc + build-sh4-newlib-only: patch-sh4-newlib + +# Add Build Pre-Requisites for ARM Steps + build-arm-binutils: patch-arm-binutils + build-arm-gcc-pass1: patch-arm-gcc +endif + uname_p := $(shell uname -p) uname_s := $(shell uname -s) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |