Skip to content

Commit

Permalink
Merge pull request #659 from starg2/mcf
Browse files Browse the repository at this point in the history
Add support for mcf thread model
  • Loading branch information
niXman authored Oct 1, 2023
2 parents 036f2f5 + 63d0980 commit b876df9
Show file tree
Hide file tree
Showing 14 changed files with 3,111 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
artifact: "x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0.7z",
build_cmd: "--mode=gcc-13.2.0 --buildroot=/c/buildroot --jobs=4 --rev=0 --rt-version=v11 --threads=win32 --exceptions=seh --arch=x86_64 --bin-compress --enable-languages=c,c++,fortran --with-default-msvcrt=ucrt --logviewer-command=cat"
}
- {
name: "x86_64 mcf seh ucrt",
artifact: "x86_64-13.2.0-release-mcf-seh-ucrt-rt_v11-rev0.7z",
build_cmd: "--mode=gcc-13.2.0 --buildroot=/c/buildroot --jobs=4 --rev=0 --rt-version=v11 --threads=mcf --exceptions=seh --arch=x86_64 --bin-compress --enable-languages=c,c++,fortran --with-default-msvcrt=ucrt --logviewer-command=cat"
}
- {
name: "i686 posix dwarf msvcrt",
artifact: "i686-13.2.0-release-posix-dwarf-msvcrt-rt_v11-rev0.7z",
Expand All @@ -50,6 +55,11 @@ jobs:
artifact: "i686-13.2.0-release-win32-dwarf-ucrt-rt_v11-rev0.7z",
build_cmd: "--mode=gcc-13.2.0 --buildroot=/c/buildroot --jobs=4 --rev=0 --rt-version=v11 --threads=win32 --exceptions=dwarf --arch=i686 --bin-compress --enable-languages=c,c++,fortran --with-default-msvcrt=ucrt --logviewer-command=cat"
}
- {
name: "i686 mcf dwarf ucrt",
artifact: "i686-13.2.0-release-mcf-dwarf-ucrt-rt_v11-rev0.7z",
build_cmd: "--mode=gcc-13.2.0 --buildroot=/c/buildroot --jobs=4 --rev=0 --rt-version=v11 --threads=mcf --exceptions=dwarf --arch=i686 --bin-compress --enable-languages=c,c++,fortran --with-default-msvcrt=ucrt --logviewer-command=cat"
}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -118,6 +128,10 @@ jobs:
name: "x86_64 win32 seh ucrt",
artifact: "x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0.7z"
}
- {
name: "x86_64 mcf seh ucrt",
artifact: "x86_64-13.2.0-release-mcf-seh-ucrt-rt_v11-rev0.7z"
}
- {
name: "i686 posix dwarf msvcrt",
artifact: "i686-13.2.0-release-posix-dwarf-msvcrt-rt_v11-rev0.7z"
Expand All @@ -134,6 +148,10 @@ jobs:
name: "i686 win32 dwarf ucrt",
artifact: "i686-13.2.0-release-win32-dwarf-ucrt-rt_v11-rev0.7z"
}
- {
name: "i686 mcf dwarf ucrt",
artifact: "i686-13.2.0-release-mcf-dwarf-ucrt-rt_v11-rev0.7z"
}

needs: release

Expand Down
14 changes: 11 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ readonly RUN_ARGS="$@"
echo " --bootstrapall - bootstraping GCC & all prerequisites"
echo " --no-multilib - build GCC without multilib support"
echo " --rev=N - specifies number of the build revision"
echo " --threads=<model> - specifies the threads model for GCC/libstdc++, available: win32, posix"
echo " --threads=<model> - specifies the threads model for GCC/libstdc++, available: win32, posix, mcf"
echo " --static-gcc - build static GCC"
echo " --with-default-msvcrt= - specifies msvc version the toolchain will target"
echo " <msvcrt|msvcr80|msvcr90|msvcr100|msvcr110|msvcr120|ucrt>"
Expand Down Expand Up @@ -375,10 +375,10 @@ while [[ $# > 0 ]]; do
--threads=*)
THREADS_MODEL=${1/--threads=/}
case $THREADS_MODEL in
win32|posix)
win32|posix|mcf)
;;
*)
die "\"$THREADS_MODEL\" is not valid threads model. available models: posix, win32. terminate"
die "\"$THREADS_MODEL\" is not valid threads model. available models: posix, win32, mcf. terminate"
;;
esac
;;
Expand Down Expand Up @@ -522,6 +522,10 @@ esac
die "\"$EXCEPTIONS_MODEL\" exceptions not allowed on multilib architecture. terminate."
}

[[ $BUILD_MODE == gcc && $THREADS_MODEL == mcf && `func_map_gcc_name_to_gcc_version $BUILD_MODE_VERSION | cut -d. -f1` -lt 13 ]] && {
die "\"$THREADS_MODEL\" thread model requires GCC 13 or later. terminate."
}

[[ $BUILD_MODE != gcc && $COMPRESSING_SRCS == yes ]] && {
die "compressing sources for \"$BUILD_MODE\" mode is currently unimplemented. terminate."
}
Expand Down Expand Up @@ -662,6 +666,10 @@ case $BUILD_ARCHITECTURE in
;;
esac

[[ $THREADS_MODEL == mcf ]] && {
export PATH=$PREREQ_DIR/$BUILD_ARCHITECTURE-mcfgthread/bin:$PATH
}

[[ $LINK_TYPE_SUFFIX == shared ]] && {
export PATH=$PREREQ_DIR/$HOST-$LINK_TYPE_SUFFIX/bin:$PREREQ_DIR/$BUILD_ARCHITECTURE-libiconv-$LINK_TYPE_SUFFIX/bin:$PREREQ_DIR/$BUILD_ARCHITECTURE-zlib-$LINK_TYPE_SUFFIX/bin:$PATH
}
Expand Down
10 changes: 10 additions & 0 deletions library/subtargets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ function func_get_subtargets {
$( [[ $1 == clang || $2 == 4* ]] && echo cloog )
mingw-w64-download
mingw-w64-api
$( \
[[ $THREADS_MODEL == mcf ]] && { \
[[ $USE_MULTILIB == yes ]] && { \
echo "mcfgthread|$BUILD_ARCHITECTURE"; \
echo "mcfgthread|$REVERSE_ARCHITECTURE"; \
} || { \
echo mcfgthread; \
} \
} \
)
mingw-w64-crt
$( \
[[ $USE_MULTILIB == yes ]] && { \
Expand Down
Loading

0 comments on commit b876df9

Please sign in to comment.