summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-03-25 12:15:49 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-03-25 12:15:49 +0100
commit029cda0ee7311ee887adebccda82ec0da764a726 (patch)
tree9905f9c1066a97244630b54d530feff0caa881d9
parentcdd2c91952da3655fa960ef69bb6993cf5738be6 (diff)
msp430fr5994lp-256k: aspectc support
AspectC++ is not aware of the type "__int20", so we need to map it to a type known to AspectC++ (only for ag++, not g++) and fix its autogenerated constructor signatures.
-rw-r--r--include/arch/msp430fr5994lp/int20.h3
-rwxr-xr-xsrc/arch/msp430fr5994lp-256k/g++wrap11
-rw-r--r--src/arch/msp430fr5994lp/Makefile.inc8
3 files changed, 20 insertions, 2 deletions
diff --git a/include/arch/msp430fr5994lp/int20.h b/include/arch/msp430fr5994lp/int20.h
new file mode 100644
index 0000000..d648f5c
--- /dev/null
+++ b/include/arch/msp430fr5994lp/int20.h
@@ -0,0 +1,3 @@
+#ifdef __acweaving
+#define __int20 long
+#endif
diff --git a/src/arch/msp430fr5994lp-256k/g++wrap b/src/arch/msp430fr5994lp-256k/g++wrap
new file mode 100755
index 0000000..df8c7ab
--- /dev/null
+++ b/src/arch/msp430fr5994lp-256k/g++wrap
@@ -0,0 +1,11 @@
+#!/bin/zsh
+
+echo "> $@"
+
+for i in {1..$#}; do
+ if [[ $argv[$i] == *_agxx_* && -f $argv[$i] ]]; then
+ sed -i 's/inline void \* operator new (unsigned int,/inline void * operator new(__int20 unsigned,/' $argv[$i]
+ fi
+done
+
+exec /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-g++ "$@"
diff --git a/src/arch/msp430fr5994lp/Makefile.inc b/src/arch/msp430fr5994lp/Makefile.inc
index c442f02..df0c1ab 100644
--- a/src/arch/msp430fr5994lp/Makefile.inc
+++ b/src/arch/msp430fr5994lp/Makefile.inc
@@ -15,7 +15,7 @@ COMMON_FLAGS += -mcpu=${CPU} -mmcu=${MCU} -DMULTIPASS_ARCH_msp430fr5994lp
COMMON_FLAGS += -DMULTIPASS_ARCH_HAS_I2C
ifneq (${msp430_large}, )
- COMMON_FLAGS += -mcode-region=either -mlarge -DADDR_20BIT
+ COMMON_FLAGS += -mcode-region=either -mlarge -DADDR_20BIT -include int20.h
endif
# LTO seems to be broken.
@@ -31,7 +31,11 @@ ARCH_SHORTNAME = msp430
CXX_TARGETS += src/arch/msp430fr5994lp/arch.cc
ifeq (${aspectc}, 1)
- CXX = ag++ -r build/repo.acp -v 0 --c_compiler /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-g++ -p . --Xcompiler
+ ifeq (${msp430_large}, )
+ CXX = ag++ -r build/repo.acp -v 0 --c_compiler /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-g++ -p . --Xcompiler
+ else
+ CXX = ag++ -r build/repo.acp -v 0 --c_compiler /home/derf/var/projects/multipass/src/arch/msp430fr5994lp-256k/g++wrap -p . --Xcompiler
+ endif
endif
ifneq ($(findstring adc,${arch_drivers}), )