-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ckormanyos/mingw64_recipe_for_gcc12
Fix #13 via x86_64-w64-mingw32 recipe avr-gcc
- Loading branch information
Showing
4 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff -ru gcc-12.3.0/gcc/system.h gcc-12.3.0_new/gcc/system.h | ||
--- gcc-12.3.0/gcc/system.h 2023-05-08 14:14:40.077167400 +0200 | ||
+++ gcc-12.3.0_new/gcc/system.h 2023-12-24 12:49:49.854090800 +0100 | ||
@@ -777,16 +777,18 @@ | ||
|
||
/* Redefine abort to report an internal error w/o coredump, and | ||
reporting the location of the error in the source file. */ | ||
-extern void fancy_abort (const char *, int, const char *) | ||
- ATTRIBUTE_NORETURN ATTRIBUTE_COLD; | ||
-#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) | ||
+extern void fancy_abort(const char *, int, const char *) __attribute__((noreturn, cold)); | ||
+ | ||
+__attribute__((noreturn, cold)) | ||
+static inline void fancy_abort_patch(void) { for(;;) { ; } } | ||
+ | ||
+#define abort() fancy_abort_patch() | ||
|
||
/* Use gcc_assert(EXPR) to test invariants. */ | ||
#if ENABLE_ASSERT_CHECKING | ||
-#define gcc_assert(EXPR) \ | ||
- ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) | ||
+#define gcc_assert(EXPR) ((void)(!(EXPR) ? 1 : 0)) | ||
#elif (GCC_VERSION >= 4005) | ||
-#define gcc_assert(EXPR) \ | ||
+#define gcc_assert(EXPR) \ | ||
((void)(__builtin_expect (!(EXPR), 0) ? __builtin_unreachable (), 0 : 0)) | ||
#else | ||
/* Include EXPR, so that unused variable warnings do not occur. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright Christopher Kormanyos 2023. | ||
# Distributed under The Unlicense. | ||
# | ||
|
||
SCRIPT_PATH=$(readlink -f "$BASH_SOURCE") | ||
SCRIPT_DIR=$(dirname "$SCRIPT_PATH") | ||
|
||
|
||
# echo 'install necessary packages and build tools' | ||
# pacman -S --needed --noconfirm wget make patch git mingw-w64-ucrt-x86_64-gcc texinfo bzip2 xz autoconf automake python unzip | ||
|
||
|
||
echo 'clean gcc_build directory' | ||
rm -rf gcc_build | true | ||
|
||
|
||
echo 'make and enter gcc_build directory' | ||
mkdir $SCRIPT_DIR/gcc_build | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
cp ../avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch . | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'get tar-balls' | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz | ||
wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.15.tar.bz2 | ||
wget --no-check-certificate https://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz | ||
wget --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-12.3.0/gcc-12.3.0.tar.xz | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build libiconv' | ||
tar -xf libiconv-1.17.tar.gz | ||
mkdir objdir-libiconv-1.17 | ||
cd objdir-libiconv-1.17 | ||
../libiconv-1.17/configure --prefix=/usr/local/libiconv-1.17 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared | ||
make --job=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build gmp' | ||
tar -xf gmp-6.3.0.tar.xz | ||
mkdir objdir-gmp-6.3.0 | ||
cd objdir-gmp-6.3.0 | ||
../gmp-6.3.0/configure --prefix=/usr/local/gmp-6.3.0 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build mpfr' | ||
tar -xf mpfr-4.2.1.tar.xz | ||
mkdir objdir-mpfr-4.2.1 | ||
cd objdir-mpfr-4.2.1 | ||
../mpfr-4.2.1/configure --prefix=/usr/local/mpfr-4.2.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build mpc' | ||
tar -xf mpc-1.3.1.tar.gz | ||
mkdir objdir-mpc-1.3.1 | ||
cd objdir-mpc-1.3.1 | ||
../mpc-1.3.1/configure --prefix=/usr/local/mpc-1.3.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build isl' | ||
tar -xjf isl-0.15.tar.bz2 | ||
mkdir objdir-isl-0.15 | ||
cd objdir-isl-0.15 | ||
../isl-0.15/configure --prefix=/usr/local/isl-0.15 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-gmp=/usr/local/gmp-6.3.0 | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build cloog' | ||
tar -xf cloog-0.18.1.tar.gz | ||
mkdir objdir-cloog-0.18.1 | ||
cd objdir-cloog-0.18.1 | ||
../cloog-0.18.1/configure --prefix=/usr/local/cloog-0.18.1 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-isl=/usr/local/isl-0.15 --with-gmp=/usr/local/gmp-6.3.0 | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build binutils' | ||
tar -xf binutils-2.41.tar.xz | ||
mkdir objdir-binutils-2.41-avr-gcc-12.3.0 | ||
cd objdir-binutils-2.41-avr-gcc-12.3.0 | ||
../binutils-2.41/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 --disable-werror | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
# | ||
# Notes on patch of GCC-12.3.0 | ||
# | ||
|
||
# How do you make the patch? | ||
# diff -ru gcc-12.3.0/ gcc-12.3.0_new/ > avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch | ||
|
||
# How do you apply the patch? | ||
# patch -p0 < avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build gcc' | ||
tar -xf gcc-12.3.0.tar.xz | ||
patch -p0 < avr-gcc-100-12.3.0_x86_64-w64-mingw32.patch | ||
mkdir objdir-gcc-12.3.0-avr | ||
cd objdir-gcc-12.3.0-avr | ||
../gcc-12.3.0/configure --prefix=/usr/local/gcc-12.3.0-avr --target=avr --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='Built by ckormanyos/real-time-cpp' --enable-static --disable-shared --disable-libada --disable-libssp --disable-nls --enable-mingw-wildcard --with-gnu-as --with-dwarf2 --with-isl=/usr/local/isl-0.15 --with-cloog=/usr/local/cloog-0.18.1 --with-gmp=/usr/local/gmp-6.3.0 --with-mpfr=/usr/local/mpfr-4.2.1 --with-mpc=/usr/local/mpc-1.3.1 --with-libiconv-prefix=/usr/local/libiconv-1.17 | ||
make --jobs=6 | ||
make install | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'clone and bootstrap avr-libc' | ||
git clone -b main --depth 1 https://github.com/avrdudes/avr-libc.git ./avr-libc | ||
rm -f avr-libc/tests/simulate/time/aux.c | ||
cd avr-libc | ||
./bootstrap | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'add avr-gcc path' | ||
PATH=/usr/local/gcc-12.3.0-avr/bin:"$PATH" | ||
export PATH | ||
CC="" | ||
export CC | ||
|
||
|
||
cd $SCRIPT_DIR/gcc_build | ||
echo 'build avr-libc' | ||
cd objdir-gcc-12.3.0-avr | ||
../avr-libc/configure --prefix=/usr/local/gcc-12.3.0-avr --build=x86_64-w64-mingw32 --host=avr --enable-static --disable-shared | ||
make --jobs=6 | ||
make install |