From 176d4e610327d40de2ebd486abaff3d2726ad77a Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Mon, 18 Dec 2023 18:23:13 +0000 Subject: RISC OS: push backtrace extensions into Makefile.gcc These are GCC-specific, so ensure they're only enabled when using that compiler. Also, enable unwind table generation for gnueabi(hf) hosts. --- makefiles/Makefile.gcc | 16 +++++++++++++++- makefiles/Makefile.tools | 5 ++--- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'makefiles') diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc index 4a9dff7..0ce0d9b 100644 --- a/makefiles/Makefile.gcc +++ b/makefiles/Makefile.gcc @@ -67,7 +67,10 @@ endif # RISC OS module extensions ifeq ($(COMPONENT_TYPE),riscos-module) ifneq ($(HOST),arm-unknown-riscos) - $(error Attempting to build a RISC OS module for a non-RISC OS target) + # Note: this also rejects the gnueabi(hf) RISC OS hosts, too, as the + # tooling for those is not able to generate code compatible with RISC OS + # module environments. + $(error Attempting to build a RISC OS module for a non-RISC OS host) endif CFLAGS := $(CFLAGS) -mmodule @@ -75,6 +78,17 @@ ifeq ($(COMPONENT_TYPE),riscos-module) LDFLAGS := $(LDFLAGS) -mmodule endif +# RISC OS backtrace extensions +ifneq ($(findstring -riscos,$(HOST)),) + CFLAGS := $(CFLAGS) -mpoke-function-name + CXXFLAGS := $(CXXFLAGS) -mpoke-function-name + ifneq ($(findstring -gnueabi,$(HOST)),) + # Note: this assumes we're not generating RISC OS module code (see above) + CFLAGS := $(CFLAGS) -funwind-tables + CXXFLAGS := $(CXXFLAGS) -funwind-tables + endif +endif + ############################################################################### # Mac OS X Universal Binaries ############################################################################### diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools index e5504e7..40e4d10 100644 --- a/makefiles/Makefile.tools +++ b/makefiles/Makefile.tools @@ -185,9 +185,8 @@ else EXEEXT := ,ffa endif - # TODO: this assumes GCC - CFLAGS := $(CFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include - CXXFLAGS := $(CXXFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include + CFLAGS := $(CFLAGS) -I$(GCCSDK_INSTALL_ENV)/include + CXXFLAGS := $(CXXFLAGS) -I$(GCCSDK_INSTALL_ENV)/include LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib CMHGFLAGS := -p -tgcc -32bit -apcs 3/32/nonreent/fpe2/noswst/nofpr/nofp -- cgit v1.2.3