From 00ee5d0367cd59a3b1cdd1f36dae101d05495be3 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 12 Apr 2024 15:59:45 +0200 Subject: [PATCH 1/5] On ARM, do not assume -marm by default if OS_EMBEDDED=1 --- Makefile.system | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.system b/Makefile.system index 902b536052..a4f41236b6 100644 --- a/Makefile.system +++ b/Makefile.system @@ -811,8 +811,10 @@ ifeq ($(ARCH), arm) NO_BINARY_MODE = 1 BINARY_DEFINED = 1 +ifneq ($(OS_EMBEDDED), 1) CCOMMON_OPT += -marm FCOMMON_OPT += -marm +endif # If softfp abi is mentioned on the command line, force it. ifeq ($(ARM_SOFTFP_ABI), 1) From 930ebed48b80cee741c4a3139a764cfb26c6821a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 18 Apr 2024 15:59:24 +0200 Subject: [PATCH 2/5] Add option EMBEDDED --- Makefile.rule | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.rule b/Makefile.rule index 2e777cdc67..bb239be2a4 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -173,6 +173,10 @@ NO_AFFINITY = 1 # If you are compiling for Linux and you have more than 16 numa nodes or more than 256 cpus # BIGNUMA = 1 +# If you are compiling for an embedded system ("bare metal") like Cortex M series +# Note that you will have to provide implementations of malloc() and free() in this case +# EMBEDDED = 1 + # Don't use AVX kernel on Sandy Bridge. It is compatible with old compilers # and OS. However, the performance is low. # NO_AVX = 1 From d6b0badc058010c368aae55570c7d8ad8c925d4a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 18 Apr 2024 16:06:21 +0200 Subject: [PATCH 3/5] Fix declarations for EMBEDDED --- Makefile.system | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index a4f41236b6..70a7436e9b 100644 --- a/Makefile.system +++ b/Makefile.system @@ -811,9 +811,11 @@ ifeq ($(ARCH), arm) NO_BINARY_MODE = 1 BINARY_DEFINED = 1 -ifneq ($(OS_EMBEDDED), 1) +ifneq ($(EMBEDDED), 1) CCOMMON_OPT += -marm FCOMMON_OPT += -marm +else +CCOMMON_OPT += -DOS_EMBEDDED endif # If softfp abi is mentioned on the command line, force it. From 0ec0746ae40d17a4e9d3d08b8fb60afe15b15783 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 18 Apr 2024 16:11:20 +0200 Subject: [PATCH 4/5] Update Makefile.system --- Makefile.system | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index 70a7436e9b..1f1cfd16c2 100644 --- a/Makefile.system +++ b/Makefile.system @@ -815,7 +815,7 @@ ifneq ($(EMBEDDED), 1) CCOMMON_OPT += -marm FCOMMON_OPT += -marm else -CCOMMON_OPT += -DOS_EMBEDDED +CCOMMON_OPT += -DOS_EMBEDDED -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 endif # If softfp abi is mentioned on the command line, force it. From a5ab76c75e2f5d842e3be832dcf1c9f88c861618 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 18 Apr 2024 16:44:04 +0200 Subject: [PATCH 5/5] Update .cirrus.yml --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7a13d123fc..e8a0b85c02 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -156,7 +156,7 @@ FreeBSD_task: image_family: freebsd-13-2 install_script: - pkg update -f && pkg upgrade -y && pkg install -y gmake gcc - - ln -s /usr/local/lib/gcc12/libgfortran.so.5.0.0 /usr/lib/libgfortran.so + - ln -s /usr/local/lib/gcc13/libgfortran.so.5.0.0 /usr/lib/libgfortran.so compile_script: - gmake CC=clang FC=gfortran USE_OPENMP=1 CPP_THREAD_SAFETY_TEST=1