Work in progress cross compiler for x86_64. I've managed to get a full x86_64 gcc using the binaries built from foundation, and am working on implementing their builds into tidepool. ### Bootstrapping steps 0) Start with i686 tools (gcc, binutils, musl, etc) 1) Build binutils targeting x86_64-linux 2) Build a minimal gcc cross compiler using the cross binutils. This minimal cross compiler does not have support for libc, so is pretty much only useful for building musl or glibc. 3) Use the minimal cross compiler to build x86_64-linux glibc or musl 4) Now that we have a cross compiler and x86_64-linux libc, we can build gcc for the target architecture! 5) Profit! We can now build anything x86_64 using our gcc compiler! Co-authored-by: Jake Hamilton <jake.hamilton@hey.com> Reviewed-on: #8 Reviewed-by: Jake Hamilton <jake.hamilton@hey.com> Co-authored-by: Victor Fuentes <vmfuentes64@gmail.com> Co-committed-by: Victor Fuentes <vmfuentes64@gmail.com>
33 lines
No EOL
1.6 KiB
Diff
33 lines
No EOL
1.6 KiB
Diff
# From https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/development/compilers/gcc/patches/libstdc%2B%2B-target.patch
|
|
Patch to make the target libraries 'configure' scripts find the proper CPP.
|
|
I noticed that building the mingw32 cross compiler.
|
|
Looking at the build script for mingw in archlinux, I think that only nixos
|
|
needs this patch. I don't know why.
|
|
diff --git a/Makefile.in b/Makefile.in
|
|
index 93f66b6..d691917 100644
|
|
--- a/Makefile.in
|
|
+++ b/Makefile.in
|
|
@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \
|
|
AR="$(AR_FOR_TARGET)"; export AR; \
|
|
AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
|
|
CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
|
|
+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \
|
|
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
|
|
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
|
|
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
|
|
@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \
|
|
RAW_CXX_TARGET_EXPORTS = \
|
|
$(BASE_TARGET_EXPORTS) \
|
|
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
|
- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
|
|
+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
|
|
+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
|
|
|
|
NORMAL_TARGET_EXPORTS = \
|
|
$(BASE_TARGET_EXPORTS) \
|
|
- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
|
|
+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
|
|
+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
|
|
|
|
# Where to find GMP
|
|
HOST_GMPLIBS = @gmplibs@
|