Skip to content

Commit 3b83419

Browse files
committed
Enable debug builds
1 parent 23b1f78 commit 3b83419

4 files changed

Lines changed: 52 additions & 26 deletions

File tree

.github/scripts/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ else
7171
GCC_VERSION="15.0.0"
7272
fi
7373

74-
DEBUG=${DEBUG:-0} # Enable debug build.
74+
DEBUG=${DEBUG:-1} # Enable debug build.
7575
CCACHE=${CCACHE:-0} # Enable usage of ccache.
7676
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
7777
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.

.github/scripts/toolchain/build-gcc-stage1.sh

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
1313

1414
if [[ "$DEBUG" = 1 ]]; then
1515
HOST_OPTIONS="$HOST_OPTIONS \
16-
--enable-debug"
16+
--enable-debug \
17+
--enable-libstdcxx-debug \
18+
--enable-checking"
19+
CFLAGS="-O0 -ggdb"
20+
CXXFLAGS="-O0 -ggdb"
21+
else
22+
HOST_OPTIONS="$HOST_OPTIONS \
23+
--enable-checking=release"
1724
fi
1825

1926
case "$ARCH" in
@@ -55,28 +62,34 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
5562
;;
5663
esac
5764

58-
$SOURCE_PATH/gcc/configure \
59-
--prefix=$TOOLCHAIN_PATH \
60-
--build=$BUILD \
61-
--host=$HOST \
62-
--target=$TARGET \
63-
--enable-static \
64-
--disable-shared \
65-
--disable-bootstrap \
66-
--disable-multilib \
67-
--disable-plugins \
68-
--disable-gcov \
69-
--disable-libatomic \
70-
--disable-libgomp \
71-
--disable-libvtv \
72-
--disable-libquadmath \
73-
--disable-libssp \
74-
--disable-nls \
75-
--with-gnu-as \
76-
--with-gnu-ld \
77-
--without-headers \
78-
$HOST_OPTIONS \
79-
$TARGET_OPTIONS
65+
CFLAGS=$CFLAGS \
66+
CXXFLAGS=$CXXFLAGS \
67+
BOOT_CFLAGS=$CFLAGS \
68+
LIBGCC2_CFLAGS=$CFLAGS \
69+
CFLAGS_FOR_TARGET=$CFLAGS \
70+
CXXFLAGS_FOR_TARGET=$CXXFLAGS \
71+
$SOURCE_PATH/gcc/configure \
72+
--prefix=$TOOLCHAIN_PATH \
73+
--build=$BUILD \
74+
--host=$HOST \
75+
--target=$TARGET \
76+
--enable-static \
77+
--disable-shared \
78+
--disable-bootstrap \
79+
--disable-multilib \
80+
--disable-plugins \
81+
--disable-gcov \
82+
--disable-libatomic \
83+
--disable-libgomp \
84+
--disable-libvtv \
85+
--disable-libquadmath \
86+
--disable-libssp \
87+
--disable-nls \
88+
--with-gnu-as \
89+
--with-gnu-ld \
90+
--without-headers \
91+
$HOST_OPTIONS \
92+
$TARGET_OPTIONS
8093
echo "::endgroup::"
8194
fi
8295

.github/scripts/toolchain/build-gcc.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
1313

1414
if [[ "$DEBUG" = 1 ]]; then
1515
HOST_OPTIONS="$HOST_OPTIONS \
16-
--enable-debug"
16+
--enable-debug \
17+
--enable-libstdcxx-debug \
18+
--enable-checking"
19+
CFLAGS="-O0 -ggdb"
20+
CXXFLAGS="-O0 -ggdb"
21+
else
22+
HOST_OPTIONS="$HOST_OPTIONS \
23+
--enable-checking=release"
1724
fi
1825

1926
case "$ARCH" in
@@ -73,7 +80,6 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
7380
--enable-version-specific-runtime-libs \
7481
--enable-lto \
7582
--enable-libgomp \
76-
--enable-checking=release \
7783
--disable-libstdcxx-pch \
7884
--disable-libstdcxx-debug \
7985
--disable-isl-version-check \
@@ -105,6 +111,12 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
105111
esac
106112

107113
# REMOVED: --enable-languages=ada,go,jit
114+
CFLAGS=$CFLAGS \
115+
CXXFLAGS=$CXXFLAGS \
116+
BOOT_CFLAGS=$CFLAGS \
117+
LIBGCC2_CFLAGS=$CFLAGS \
118+
CFLAGS_FOR_TARGET=$CFLAGS \
119+
CXXFLAGS_FOR_TARGET=$CXXFLAGS \
108120
$SOURCE_PATH/gcc/configure \
109121
--prefix=$TOOLCHAIN_PATH \
110122
--build=$BUILD \

.github/workflows/advanced.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ env:
122122
ARTIFACT_PATH: ${{ github.workspace }}/artifact
123123
RELATIVE_ARTIFACT_PATH: ./artifact
124124

125+
DEBUG: 1
125126
CCACHE: 1
126127
DELETE_BUILD: 1
127128

0 commit comments

Comments
 (0)