Skip to content

Commit

Permalink
gcc: update to 14
Browse files Browse the repository at this point in the history
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 shinchiro#395
  • Loading branch information
Andarwinux committed Jan 30, 2024
1 parent 18d7f87 commit 3b1bf5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion toolchain/gcc/gcc-compiler.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash
PROG=@CMAKE_INSTALL_PREFIX@/bin/cross-@compiler@
FLAGS="-march=@GCC_ARCH@ -mtune=@M_TUNE@"
FLAGS="$FLAGS @opt@"
FLAGS="$FLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00"

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"
Expand Down
21 changes: 13 additions & 8 deletions toolchain/gcc/gcc.cmake
Original file line number Diff line number Diff line change
@@ -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 <SOURCE_DIR>/configure
--target=${TARGET_ARCH}
--prefix=${CMAKE_INSTALL_PREFIX}
Expand All @@ -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
Expand Down

0 comments on commit 3b1bf5a

Please sign in to comment.