Repository navigation
Replies: 1 comment
|
So the last time I tried this I spent two days getting nowhere, now I managed to compile everything. Typical. Here's a brain-dump. You will of course have to change paths etc etc. I had to apply the Barman path for gcc and I had to change zutil.h for both gcc and binutils: diff --git a/3rdparty/zlib/zutil.h b/3rdparty/zlib/zutil.h
index 902a304cc2d..48dd7febae6 100644
--- a/3rdparty/zlib/zutil.h
+++ b/3rdparty/zlib/zutil.h
@@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
-#if defined(MACOS) || defined(TARGET_OS_MAC)
+#if defined(MACOS)
# define OS_CODE 7
-# ifndef Z_SOLO
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-# endif
#endif
#ifdef __acorn(found here https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=124406) Here's my binutils script: #!/bin/sh
# Stop on any error
set -e
echo "### Preparing to build binutils-gdb for m68k-amiga-elf ###"
# --- Configuration ---
# Use the same prefix as your GCC build to keep the toolchain together
export PREFIX="$HOME/commodore/bin/gcc-15.1.0"
export TARGET="m68k-amiga-elf"
# --- Prerequisites ---
echo "### Installing prerequisites via Homebrew... ###"
# The --with-expat flag requires the expat library
brew install expat
# Define Brew prefix for configure script
export BREW_PREFIX=$(brew --prefix)
# --- Source Code ---
# Clean up previous attempts
rm -rf binutils-gdb
rm -rf build-binutils-gdb
#echo "### Cloning the repository... ###"
git clone https://github.com/BartmanAbyss/binutils-gdb.git
cd binutils-gdb
echo "### Downloading prerequisites... ###"
bash ./contrib/download_prerequisites
cd ..
# --- Build ---
echo "### Configuring the build... ###"
mkdir build-binutils-gdb
cd build-binutils-gdb
# This is the corrected configure line for macOS
# NOTE: We have removed LDFLAGS, --host, and static/shared flags
../binutils-gdb/configure \
--target=$TARGET \
--prefix=$PREFIX \
--with-sysroot=$PREFIX/$TARGET \
--with-expat="$BREW_PREFIX" \
--disable-nls \
--disable-werror
echo "### Starting make... ###"
make -j$(sysctl -n hw.ncpu)
echo "### Starting make install... ###"
make install
echo "### binutils-gdb build and install finished successfully! ###"
echo "### m68k-amiga-elf tools are now in $PREFIX/bin ###"Here's my gcc build script: #!/bin/sh
# Stop on any error
set -e
echo "### Preparing to build Bootstrap GCC (Stage 1) - Final ###"
# --- Configuration ---
export PREFIX="$HOME/commodore/bin/gcc-15.1.0"
export TARGET="m68k-amiga-elf"
# The PATH export is still good practice for other tools.
export PATH="$PREFIX/bin:$PATH"
# --- Clean Slate ---
# It's crucial to clean out the old, broken configuration first.
# If you have already run configure in the build dir, run 'make distclean'
# or simply remove and recreate the build directory.
echo "### Cleaning previous configuration... ###"
make distclean || true
# --- Configure ---
echo "### Configuring GCC with explicit tool paths... ###"
# This is the key: We are telling configure EXACTLY where to find 'as' and 'ld'.
../gcc/configure \
--target=$TARGET \
--prefix=$PREFIX \
--enable-languages=c \
--with-system-zlib \
--with-as=$PREFIX/bin/m68k-amiga-elf-as \
--with-ld=$PREFIX/bin/m68k-amiga-elf-ld \
--disable-nls \
--without-headers \
--disable-threads \
--disable-multilib \
--disable-libssp \
--disable-libgomp \
--disable-libstdcxx
# --- Build and Install ---
echo "### Building all-gcc... ###"
make -j$(sysctl -n hw.ncpu) all-gcc
echo "### Installing gcc... ###"
make install-gcc
echo ""
echo "### Bootstrap GCC build and install should be finished! ###" |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Has anyone got that working? I've been trying to compile gcc with the Bartman patch, but I no luck so far.
All reactions