From 72b8e456ae9fd8cc0b56e61cf7f3cbd1970d73e6 Mon Sep 17 00:00:00 2001 From: Andarwinux Date: Tue, 30 Jan 2024 00:00:00 +0000 Subject: [PATCH] gcc: update to 14 GCC14 libstdc++ has implemented C++11 thread support for win32 thread model, so switch to the win32 thread model do not hardcode march and mtune as they have been switched to wrapper close #395 --- toolchain/gcc/gcc-compiler.in | 3 ++- toolchain/gcc/gcc.cmake | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/toolchain/gcc/gcc-compiler.in b/toolchain/gcc/gcc-compiler.in index d4bc4d874..997672004 100644 --- a/toolchain/gcc/gcc-compiler.in +++ b/toolchain/gcc/gcc-compiler.in @@ -1,9 +1,10 @@ #!/bin/bash PROG=@CMAKE_INSTALL_PREFIX@/bin/cross-@compiler@ +FLAGS="-march=@GCC_ARCH@ -mtune=@M_TUNE@" FLAGS="$FLAGS @opt@" if [ "$CONF" == "1" ]; then - SKIP_OPT="-g0 -O0 -fno-lto -fno-data-sections -fno-function-sections" + SKIP_OPT="-g0 -O1 -fno-lto -fno-data-sections -fno-function-sections" else if [ "@ENABLE_CCACHE@" == "ON" ]; then CCACHE="ccache" diff --git a/toolchain/gcc/gcc.cmake b/toolchain/gcc/gcc.cmake index 95748d7a0..1b2db9403 100644 --- a/toolchain/gcc/gcc.cmake +++ b/toolchain/gcc/gcc.cmake @@ -1,10 +1,12 @@ ExternalProject_Add(gcc DEPENDS mingw-w64-headers - URL https://mirrorservice.org/sites/sourceware.org/pub/gcc/snapshots/13-20231111/gcc-13-20231111.tar.xz - # https://mirrorservice.org/sites/sourceware.org/pub/gcc/snapshots/12-20221217/sha512.sum - URL_HASH SHA512=6f62981040894fdc98fff57295608092b917fe909cd67477c9ffc81197e5780ebabe1fbb4113e792ea441e0adb79fec5f802cda807632945c36ea295d623f19f - DOWNLOAD_DIR ${SOURCE_LOCATION} + GIT_REPOSITORY https://github.com/gcc-mirror/gcc.git + SOURCE_DIR ${SOURCE_LOCATION} + GIT_CLONE_FLAGS "--filter=tree:0" + GIT_TAG master + GIT_REMOTE_NAME origin + UPDATE_COMMAND "" CONFIGURE_COMMAND /configure --target=${TARGET_ARCH} --prefix=${CMAKE_INSTALL_PREFIX} @@ -16,13 +18,16 @@ ExternalProject_Add(gcc --disable-nls --disable-shared --disable-win32-registry - --with-arch=${GCC_ARCH} - --with-tune=generic - --enable-threads=posix + --enable-threads=win32 + --enable-libstdcxx-threads=yes --without-included-gettext --enable-lto - --enable-checking=release + --disable-checking + --disable-libgomp --disable-sjlj-exceptions + --enable-default-pie + --enable-host-pie + --enable-host-bind-now BUILD_COMMAND make -j${MAKEJOBS} all-gcc INSTALL_COMMAND make install-strip-gcc STEP_TARGETS download install