From a8717827937bf98d4cb2b2934a20937eac342574 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Tue, 7 Jun 2022 12:43:41 -0700 Subject: [PATCH] Fix no-exception libstdc++ Was including the exception enabled version by default. Fixing this saves ~6K flash and 4K RAM. --- Makefile | 6 +++--- README.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ebf690d..ecf773a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ REL := $(if $(REL),$(REL),1.0.0) SUBREL := $(if $(SUBREL),$(SUBREL),testing) ARDUINO := $(if $(ARDUINO),$(ARDUINO),$(shell pwd)/arduino) -GCC := $(if $(GCC),$(GCC),10.2) +GCC := $(if $(GCC),$(GCC),10.3) # General constants PWD := $(shell pwd) @@ -486,11 +486,11 @@ clean: .cleaninst.LINUX.clean .cleaninst.LINUX32.clean .cleaninst.WIN32.clean .c .stage.%.libstdcpp-nox: .stage.%.libstdcpp echo STAGE: $@ # We copy existing stdc, adjust the makefile, and build a single .a to save much time + cp $(ARCH)$(call ext,$@)/$(ARCH)/lib/thumb/libstdc++.a $(ARCH)$(call ext,$@)/$(ARCH)/lib/thumb/libstdc++-exc.a >> $(call log,$@) 2>&1 rm -rf $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3-nox > $(call log,$@) 2>&1 cp -a $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3 $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3-nox >> $(call log,$@) 2>&1 (cd $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3-nox; $(call setenv,$@); $(MAKE) clean; find . -name Makefile -exec sed -i 's/-free/-free -fno-exceptions/' \{\} \; ; $(MAKE)) >> $(call log,$@) 2>&1 - cp $(ARCH)$(call ext,$@)/$(ARCH)/lib/thumb/libstdc++.a $(ARCH)$(call ext,$@)/$(ARCH)/lib/thumb/libstdc++-exc.a >> $(call log,$@) 2>&1 - cp $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3-nox/src/.libs/libstdc++.a $(ARCH)$(call ext,$@)/$(ARCH)/lib/libstdc++.a >> $(call log,$@) 2>&1 + cp $(call arena,$@)/$(GCC_DIR)/$(ARCH)/libstdc++-v3-nox/src/.libs/libstdc++.a $(ARCH)$(call ext,$@)/$(ARCH)/lib/thumb/libstdc++.a >> $(call log,$@) 2>&1 touch $@ .stage.%.strip: .stage.%.libstdcpp-nox diff --git a/README.md b/README.md index a5e8504..30dd168 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Allows building Win32, Win64, OSX, Linux x86_64, ARM64 (aarch64) and Raspberry P ## Work In Progesss -Builds work for GCC 9.3, and 10.x. Others not fully tested but were building last time they were tried. +Builds work for GCC 9.3, 10.x, and 12.1. Others not fully tested but were building last time they were tried. ## Downloading GCC/etc. sources @@ -18,7 +18,7 @@ to clone the GCC and libs needed to the repo/ directory. This takes a while, so If you're only compiling natively, you can just clone this repo and run ```` -make GCC={9.3|10.2|10.3} REL=x.x.x SUBREL=x -jx # I like -j32 on a 16-core server, adjust according to your CPU power +make GCC={9.3|10.2|10.3|12.1} REL=x.x.x SUBREL=x -jx # I like -j32 on a 16-core server, adjust according to your CPU power ```` Note that to build a non-linux toolchain, you first need to build a linux chain in the directory. This is because the cross compiler requires a local host executable gcc for the target architecture to build properly. @@ -29,7 +29,7 @@ To build all architectures use the commands ```` git clone https://github.com/earlephilhower/pico-quick-toolchain cd pico-quick-toolchain -docker run --user $(id -u):$(id -g) --rm -v $(pwd):/workdir earlephilhower/gcc-cross-v6 bash -c "cd /workdir; make -j32 GCC={9.3|10.1|10.2|10.3} REL=2.5.0 SUBREL=3 all" +docker run --user $(id -u):$(id -g) --rm -v $(pwd):/workdir earlephilhower/gcc-cross-v6 bash -c "cd /workdir; make -j32 GCC={9.3|10.1|10.2|10.3|12.1} REL=2.5.0 SUBREL=3 all" ```` To make a draft release of the binaries: @@ -41,7 +41,7 @@ You then promote the draft to a pre-release so it becomes visible and can then m Then to install the libraries and headers into the Arduino core (not including the toolchain exes) just ```` -make GCC={9.3|10.2|10.3} REL=2.5.0 SUBREL=3 install (INSTALLBRANCH=xxx may be added to apply against a predefined branch other than master) +make GCC={9.3|10.2|10.3|12.1} REL=2.5.0 SUBREL=3 install (INSTALLBRANCH=xxx may be added to apply against a predefined branch other than master) git commit -a ````