Skip to content

Commit

Permalink
i686 will use DWARF, x86_64 - SEH by default, extra patches removed, …
Browse files Browse the repository at this point in the history
…tests was fixed
  • Loading branch information
niXman committed Mar 5, 2023
1 parent 18665dd commit 36482a3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 32 deletions.
28 changes: 13 additions & 15 deletions build
Expand Up @@ -198,18 +198,8 @@ while [[ $# > 0 ]]; do
--arch=*)
readonly BUILD_ARCHITECTURE=${1/--arch=/}
case $BUILD_ARCHITECTURE in
i686)
case $EXCEPTIONS_MODEL in
dwarf|sjlj|dwarfseh) ;;
*) die "\"$BUILD_ARCHITECTURE\" is not valid architecture model for exception model \"$EXCEPTIONS_MODEL\". terminate." ;;
esac
;;
x86_64)
case $EXCEPTIONS_MODEL in
seh|sjlj|dwarfseh) ;;
*) die "\"$BUILD_ARCHITECTURE\" is not valid architecture model for exception model \"$EXCEPTIONS_MODEL\". terminate." ;;
esac
;;
x86_64|i686)
;;
*) die "Unsupported architecture: \"$BUILD_ARCHITECTURE\". terminate." ;;
esac
;;
Expand Down Expand Up @@ -460,7 +450,7 @@ mkdir -p \

# **************************************************************************

[[ -z ${BUILD_ARCHITECTURE} ]] && {
[[ -z $BUILD_ARCHITECTURE ]] && {
die "Build architecture is not specified. terminate."
}

Expand All @@ -469,10 +459,18 @@ mkdir -p \
die "you can't build 64-bit toolchain using 32-bit OS. terminate."
}
[[ $USE_MULTILIB == yes ]] && {
die "you can't build multitarget MinGW using 32-bit OS. terminate."
die "you can't build multitarget MinGW-W64 using 32-bit OS. terminate."
}
}

[[ -z $EXCEPTIONS_MODEL ]] && {
[[ $BUILD_ARCHITECTURE == i686 ]] && {
EXCEPTIONS_MODEL=dwarf
} || {
EXCEPTIONS_MODEL=seh
}
}

case $EXCEPTIONS_MODEL in
dwarf)
[[ ${BUILD_ARCHITECTURE} == x86_64 ]] && {
Expand Down Expand Up @@ -517,7 +515,7 @@ esac
# **************************************************************************
# Install host toolchains

if ! [[ -z "$PROVIDED_TOOLCHAIN" ]] ; then
if [[ -n $PROVIDED_TOOLCHAIN ]] ; then
func_check_user_toolchain "$PROVIDED_TOOLCHAIN"

echo "Using provided toolchain: $PROVIDED_TOOLCHAIN"
Expand Down
4 changes: 2 additions & 2 deletions library/config.sh
Expand Up @@ -110,8 +110,8 @@ CLANG_GCC_VERSION=gcc-4.9.3
FETCH_MODE=no
UPDATE_SOURCES=no
BUILD_ARCHITECTURE=
EXCEPTIONS_MODEL=sjlj
USE_MULTILIB=yes
EXCEPTIONS_MODEL=
USE_MULTILIB=no
STRIP_ON_INSTALL=yes
BOOTSTRAPING=yes
BOOTSTRAPINGALL=no
Expand Down
2 changes: 0 additions & 2 deletions scripts/gcc-trunk.sh
Expand Up @@ -51,9 +51,7 @@ PKG_PATCHES=(
gcc/gcc-5.1-iconv.patch
gcc/gcc-4.8-libstdc++export.patch
gcc/gcc-12-fix-for-windows-not-minding-non-existant-parent-dirs.patch
gcc/gcc-4.8.2-windows-lrealpath-no-force-lowercase-nor-backslash.patch
gcc/gcc-5.1.0-make-xmmintrin-header-cplusplus-compatible.patch
gcc/gcc-12-fix-mingw-pch.patch
gcc/gcc-5-dwarf-regression.patch
gcc/gcc-12-ktietz-libgomp.patch
gcc/gcc-libgomp-ftime64.patch
Expand Down
28 changes: 15 additions & 13 deletions scripts/tests.sh
Expand Up @@ -39,6 +39,8 @@ PKG_NAME=tests
PKG_DIR_NAME=tests/$PKG_ARCHITECTURE
PKG_PRIORITY=main

TESTS_GCC_VERSION=$(func_map_gcc_name_to_gcc_version $BUILD_MODE_VERSION)

dll_test1_list=(
"dll1.cpp -shared -o dll1.dll"
"dll_test1.cpp -o dll_test1.exe"
Expand All @@ -63,15 +65,15 @@ pthread_test_list=(
"pthread_test.c -mthreads -lpthread -o pthread_test.exe"
)

[[ `echo $BUILD_VERSION | cut -d. -f1` == 4 && `echo $BUILD_VERSION | cut -d. -f2` -le 6 ]] && (
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` == 4 && `echo $TESTS_GCC_VERSION | cut -d. -f2` -le 6 ]] && {
stdthread_test_list=(
"stdthread_test.cpp -std=c++0x -o stdthread_test.exe"
)
) || (
} || {
stdthread_test_list=(
"stdthread_test.cpp -std=c++11 -o stdthread_test.exe"
)
)
}

lasterror_test1_list=(
"lasterror_test1.cpp -o lasterror_test1.exe"
Expand All @@ -81,25 +83,25 @@ lasterror_test2_list=(
"lasterror_test2.cpp -o lasterror_test2.exe"
)

[[ $MSVCRT_VERSION == ucrt ]] && (
[[ $MSVCRT_VERSION == ucrt ]] && {
time_test_list=(
"time_test.c -lpthread -lucrt -o time_test.exe"
)
) || (
} || {
time_test_list=(
"time_test.c -lpthread -o time_test.exe"
)
)
}

[[ `echo $BUILD_VERSION | cut -d. -f1` == 4 && `echo $BUILD_VERSION | cut -d. -f2` -le 6 ]] && (
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` == 4 && `echo $TESTS_GCC_VERSION | cut -d. -f2` -le 6 ]] && {
sleep_test_list=(
"sleep_test.cpp -std=c++0x -o sleep_test.exe"
)
) || (
} || {
sleep_test_list=(
"sleep_test.cpp -std=c++11 -o sleep_test.exe"
)
)
}

random_device_list=(
"random_device.cpp -std=c++11 -o random_device.exe"
Expand All @@ -119,10 +121,10 @@ PKG_TESTS["dll_test2"]=dll_test2_list[@]
[[ "$DISABLE_GCC_LTO" != yes ]] && { PKG_TESTS["lto_test"]=lto_test_list[@]; }
PKG_TESTS["omp_test"]=omp_test_list[@]
PKG_TESTS["pthread_test"]=pthread_test_list[@]
[[ $THREADS_MODEL == posix ]] && { PKG_TESTS["stdthread_test"]=stdthread_test_list[@]; }
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` -ge 13 || $THREADS_MODEL == posix ]] && { PKG_TESTS["stdthread_test"]=stdthread_test_list[@]; }
PKG_TESTS["lasterror_test1"]=lasterror_test1_list[@]
PKG_TESTS["lasterror_test2"]=lasterror_test2_list[@]
PKG_TESTS["time_test"]=time_test_list[@]
[[ $THREADS_MODEL == posix ]] && { PKG_TESTS["sleep_test"]=sleep_test_list[@]; }
[[ `echo $BUILD_VERSION | cut -d. -f1` -ge 6 ]] && { PKG_TESTS["random_device"]=random_device_list[@]; }
[[ `echo $BUILD_VERSION | cut -d. -f1` -ge 8 ]] && { PKG_TESTS["filesystem"]=filesystem_list[@]; }
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` -ge 13 || $THREADS_MODEL == posix ]] && { PKG_TESTS["sleep_test"]=sleep_test_list[@]; }
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` -ge 6 ]] && { PKG_TESTS["random_device"]=random_device_list[@]; }
[[ `echo $TESTS_GCC_VERSION | cut -d. -f1` -ge 8 ]] && { PKG_TESTS["filesystem"]=filesystem_list[@]; }

0 comments on commit 36482a3

Please sign in to comment.