public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][Newlib][libgloss][ARM] - Semihosting v2 Makefile changes (3 / 5)
@ 2017-07-03 16:55 Tamar Christina
  2017-07-05 12:14 ` Tamar Christina
  0 siblings, 1 reply; 2+ messages in thread
From: Tamar Christina @ 2017-07-03 16:55 UTC (permalink / raw)
  To: newlib; +Cc: nd, nickc, Richard Earnshaw, jjohnstn

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

Hi All, 


This patch adds the needed build system changes in order to compile
and create the new libraries for Semihosting v2.

This uses the new recursive build target in multi-build.in

The new spec files are:

For AArch32/ARM (m for mixed mode):
  - rdimon-v2m.specs
  - aprofile-validation-v2m.specs
  - aprofile-ve-v2m.specs

Regression tested on arm-none-eabi and no regressions.

OK for master?

PS. I don't have commit rights so if OK can someone apply for me?

Thanks,
Tamar


libgloss/
2017-07-03  Tamar Christina  <tamar.christina@arm.com>

	* arm/Makefile.in (MULTI_FLAGS_FOR_TARGET, MULTILIBNAME): New.
	(install, clean, all): Make recursively.
	(multi-do, all-multi, clean-multi, install-multi): New.
	(all-recursive, clean-recursive, install-recursive): New.
	* arm/elf-rdimon.specs:  Document rdimon version.
	* arm/coff-rdimon.specs:  Likewise.
	* arm/elf-aprofile-validation.specs:  Likewise.
	* arm/elf-aprofile-ve.specs:  Likewise.
	* arm/elf-rdimon-v2m.specs:  New.
	* arm/coff-rdimon-v2m.specs:  Likewise.
	* arm/elf-aprofile-validation-v2m.specs:  Likewise.
	* arm/elf-aprofile-ve-v2m.specs:  Likewise.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: semihosting-patch-3.patch --]
[-- Type: text/x-patch; name="semihosting-patch-3.patch", Size: 10935 bytes --]

diff --git a/libgloss/arm/Makefile.in b/libgloss/arm/Makefile.in
index 3f87deae2998a0f5cb39fee7da51e7a410275ecb..e1bad1710c61a0b8586c986fc70e50a9f2cf3a8a 100644
--- a/libgloss/arm/Makefile.in
+++ b/libgloss/arm/Makefile.in
@@ -29,8 +29,15 @@ MULTISRCTOP =
 MULTIBUILDTOP =
 MULTIDIRS =
 MULTISUBDIR =
+MULTILIBNAME =
 MULTIDO = true
 MULTICLEAN = true
+MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
+MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
+
+MULTIDIRS += semihv2m
+MULTIDIR_semihv2m_FLAGS = $(MULTI_DEFAULT_FLAGS) -DSEMIHOST_V2_MIXED_MODE
+MULTIDIR_semihv2m_NAME = -v2m
 
 SHELL =	/bin/sh
 
@@ -75,10 +82,12 @@ RDPMON_OBJS	= ftruncate.o libcfunc.o syscalls.o trap.o truncate.o _exit.o _kill.
 RDPMON_SCRIPTS	= rdpmon.specs
 RDPMON_INSTALL	= install-rdpmon
 
-RDIMON_CRT0	= rdimon-crt0.o
-RDIMON_BSP	= librdimon.a
+RDIMON_CRT0	= rdimon-crt0${${MULTILIBNAME}}.o
+RDIMON_BSP	= librdimon${${MULTILIBNAME}}.a
 RDIMON_OBJS	= $(patsubst %,rdimon-%,$(RDPMON_OBJS))
-RDIMON_SCRIPTS	= rdimon.specs aprofile-validation.specs aprofile-ve.specs
+RDIMON_SCRIPTS	= rdimon${${MULTILIBNAME}}.specs \
+		  aprofile-validation${${MULTILIBNAME}}.specs \
+		  aprofile-ve${${MULTILIBNAME}}.specs
 RDIMON_INSTALL	= install-rdimon
 
 CFLAGS		= -g
@@ -110,6 +119,7 @@ all: ${CRT0} ${LINUX_CRT0} ${LINUX_BSP} ${REDBOOT_CRT0} ${REDBOOT_OBJS} ${RDPMON
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 #
 # here's where we build the test programs for each target
@@ -121,33 +131,34 @@ test:
 crt0.o: crt0.S
 redboot-crt0.o: redboot-crt0.S
 redboot-syscalls.o: redboot-syscalls.c $(srcdir)/../syscall.h
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
 
 rdpmon-crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
 
-rdimon-crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-ftruncate.o: ftruncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-trap.o: trap.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-truncate.o: truncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_exit.o: _exit.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_kill.o: _kill.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-syscalls.o: syscalls.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-libcfunc.o: libcfunc.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 $(LINUX_BSP): $(LINUX_OBJS)
 	${AR} ${ARFLAGS} $@ $^
@@ -161,6 +172,23 @@ $(RDIMON_BSP): $(RDIMON_OBJS)
 	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
+# Multilib support.
+.PHONY:  multi-do all-multi clean-multi install-multi
+
+all-recursive: all-multi
+clean-recursive: clean-multi
+install-recursive: install-multi
+
+# The $(MAKE) comments below are to enable parallel building.
+all-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=all multi-do
+
+clean-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=clean multi-do
+
+install-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=install multi-do
+
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(IQ80310_BSP)
 	@rootpre=`pwd`/; export rootpre; \
@@ -172,6 +200,7 @@ clean mostlyclean:
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) clean-recursive
 
 distclean maintainer-clean realclean: clean
 	rm -f Makefile config.status *~
@@ -187,6 +216,7 @@ install: ${CRT0_INSTALL} ${LINUX_INSTALL} ${REDBOOT_INSTALL} ${RDPMON_INSTALL} $
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
 
 install-nano:
 	set -e; for x in ${NANO_SCRIPTS}; do ${INSTALL_DATA} ${srcdir}/${objtype}$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
@@ -228,3 +258,5 @@ Makefile: Makefile.in config.status @host_makefile_frag_path@
 
 config.status: configure
 	$(SHELL) config.status --recheck
+
+include $(srcdir)/../multi-build.in
\ No newline at end of file
diff --git a/libgloss/arm/coff-rdimon-v2m.specs b/libgloss/arm/coff-rdimon-v2m.specs
new file mode 100644
index 0000000000000000000000000000000000000000..c0f723e9d3b9526fa57ff798ec62ae83b3aa2273
--- /dev/null
+++ b/libgloss/arm/coff-rdimon-v2m.specs
@@ -0,0 +1,16 @@
+# rdimon-v2m.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting. This version is intended for AArch64/AArch32
+# mixed mode executables and as such uses the HLT trap instructions.
+#
+# This version supports extensibility through an extension mechanism.
+
+%rename link                old_link
+
+*link:
+%(old_link) -lrdimon-v2m
+
+*startfile:
+rdimon-crt0-v2m%O%s
+
diff --git a/libgloss/arm/coff-rdimon.specs b/libgloss/arm/coff-rdimon.specs
index ace5506148813534ee2dd1eb7d2e4fd3c1120f98..89135cfba796ff7ce3f77ac6c21e5614872f045d 100644
--- a/libgloss/arm/coff-rdimon.specs
+++ b/libgloss/arm/coff-rdimon.specs
@@ -1,3 +1,10 @@
+# rdimon.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting using the SVC trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
 %rename link                old_link
 
 *link:
diff --git a/libgloss/arm/elf-aprofile-validation-v2m.specs b/libgloss/arm/elf-aprofile-validation-v2m.specs
new file mode 100644
index 0000000000000000000000000000000000000000..accef99e12bb94b33676a271b5b6a444b603b7f1
--- /dev/null
+++ b/libgloss/arm/elf-aprofile-validation-v2m.specs
@@ -0,0 +1,23 @@
+# aprofile-validation-v2m.specs
+#
+# Spec file for AArch32 A profile baremetal newlib, libgloss on
+# VALIDATION platform with AngelAPI semi-hosting version 2 using the HLT
+# trap instruction.
+#
+# This Spec file is also appropriate for the foundation model.
+
+%rename link old_link
+
+*link:
+--defsym=_rdimon_vector_base=0x00000000 -Ttext-segment=0x00010000 %(old_link)
+
+%rename lib libc
+
+*libgloss:
+-lrdimon-v2m
+
+*lib:
+cpu-init/rdimon-aem.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
diff --git a/libgloss/arm/elf-aprofile-validation.specs b/libgloss/arm/elf-aprofile-validation.specs
index 166a5dec68db511c2932dc72e6c4558d8f4d63c6..4ef0e95102781e0e189a5b2abe04fce839d1fefd 100644
--- a/libgloss/arm/elf-aprofile-validation.specs
+++ b/libgloss/arm/elf-aprofile-validation.specs
@@ -1,7 +1,8 @@
-# aem-validation.specs
+# aprofile-validation.specs
 #
 # Spec file for AArch32 A profile baremetal newlib, libgloss on
-# VALIDATION platform with AngelAPI semi-hosting.
+# VALIDATION platform with AngelAPI semi-hosting version 2 using the SVC
+# trap instruction.
 #
 # This Spec file is also appropriate for the foundation model.
 
diff --git a/libgloss/arm/elf-aprofile-ve-v2m.specs b/libgloss/arm/elf-aprofile-ve-v2m.specs
new file mode 100644
index 0000000000000000000000000000000000000000..75f3802161aa11eee34cf9997d75bf731c8962d4
--- /dev/null
+++ b/libgloss/arm/elf-aprofile-ve-v2m.specs
@@ -0,0 +1,22 @@
+# aprofile-ve-v2m.specs
+#
+# Spec file for AArch32 A profile baremetal newlib, libgloss on VE platform with AngelAPI
+# semi-hosting version 2 using the HLT trap instruction.
+#
+# This Spec file is also appropriate for the foundation model.
+
+%rename link old_link
+
+*link:
+--defsym=_rdimon_vector_base=0x80000000 -Ttext-segment=0x80010000 %(old_link)
+
+%rename lib libc
+
+*libgloss:
+-lrdimon-v2m
+
+*lib:
+cpu-init/rdimon-aem.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
diff --git a/libgloss/arm/elf-aprofile-ve.specs b/libgloss/arm/elf-aprofile-ve.specs
index d94bb7a94d2919a2627390c7581022b36150813c..1461b34bff2728365b980e10803ea23e72051fa7 100644
--- a/libgloss/arm/elf-aprofile-ve.specs
+++ b/libgloss/arm/elf-aprofile-ve.specs
@@ -1,7 +1,7 @@
-# aem-ve.specs
+# aprofile-ve.specs
 #
 # Spec file for AArch32 A profile baremetal newlib, libgloss on VE platform with AngelAPI
-# semi-hosting.
+# semi-hosting version 2 using the SVC trap instruction.
 #
 # This Spec file is also appropriate for the foundation model.
 
diff --git a/libgloss/arm/elf-rdimon-v2m.specs b/libgloss/arm/elf-rdimon-v2m.specs
new file mode 100644
index 0000000000000000000000000000000000000000..e4f2545a4d4ef08f11469b15300e4953ab11b9dd
--- /dev/null
+++ b/libgloss/arm/elf-rdimon-v2m.specs
@@ -0,0 +1,22 @@
+# rdimon-v2m.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting. This version is intended for AArch64/AArch32
+# mixed mode executables and as such uses the HLT trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
+%rename link_gcc_c_sequence                rdimon_link_gcc_c_sequence
+
+*rdimon_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*rdimon_libgloss:
+%{!specs=nano.specs:-lrdimon-v2m} %{specs=nano.specs:-lrdimon_nano}
+
+*link_gcc_c_sequence:
+%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) %(rdimon_libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
+
diff --git a/libgloss/arm/elf-rdimon.specs b/libgloss/arm/elf-rdimon.specs
index c35061f3a8879a24c8ea372cfcfd6a54373d8898..b4d020d77131f5776799dc295d081791e12bf246 100644
--- a/libgloss/arm/elf-rdimon.specs
+++ b/libgloss/arm/elf-rdimon.specs
@@ -1,3 +1,10 @@
+# rdimon.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting using the SVC trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
 %rename link_gcc_c_sequence                rdimon_link_gcc_c_sequence
 
 *rdimon_libc:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][Newlib][libgloss][ARM] - Semihosting v2 Makefile changes (3 / 5)
  2017-07-03 16:55 [PATCH][Newlib][libgloss][ARM] - Semihosting v2 Makefile changes (3 / 5) Tamar Christina
@ 2017-07-05 12:14 ` Tamar Christina
  0 siblings, 0 replies; 2+ messages in thread
From: Tamar Christina @ 2017-07-05 12:14 UTC (permalink / raw)
  To: newlib; +Cc: nd, nickc, Richard Earnshaw, jjohnstn

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

Hi All,

resubmitting these as git-am patches.

Thanks,
Tamar
________________________________________
From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of Tamar Christina <Tamar.Christina@arm.com>
Sent: Monday, July 3, 2017 5:54:54 PM
To: newlib@sourceware.org
Cc: nd; nickc@redhat.com; Richard Earnshaw; jjohnstn@redhat.com
Subject: [PATCH][Newlib][libgloss][ARM] - Semihosting v2 Makefile changes (3 / 5)

Hi All,


This patch adds the needed build system changes in order to compile
and create the new libraries for Semihosting v2.

This uses the new recursive build target in multi-build.in

The new spec files are:

For AArch32/ARM (m for mixed mode):
  - rdimon-v2m.specs
  - aprofile-validation-v2m.specs
  - aprofile-ve-v2m.specs

Regression tested on arm-none-eabi and no regressions.

OK for master?

PS. I don't have commit rights so if OK can someone apply for me?

Thanks,
Tamar


libgloss/
2017-07-03  Tamar Christina  <tamar.christina@arm.com>

        * arm/Makefile.in (MULTI_FLAGS_FOR_TARGET, MULTILIBNAME): New.
        (install, clean, all): Make recursively.
        (multi-do, all-multi, clean-multi, install-multi): New.
        (all-recursive, clean-recursive, install-recursive): New.
        * arm/elf-rdimon.specs:  Document rdimon version.
        * arm/coff-rdimon.specs:  Likewise.
        * arm/elf-aprofile-validation.specs:  Likewise.
        * arm/elf-aprofile-ve.specs:  Likewise.
        * arm/elf-rdimon-v2m.specs:  New.
        * arm/coff-rdimon-v2m.specs:  Likewise.
        * arm/elf-aprofile-validation-v2m.specs:  Likewise.
        * arm/elf-aprofile-ve-v2m.specs:  Likewise.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-Add-the-needed-build-system-changes-in-order-to-comp.patch --]
[-- Type: text/x-patch; name="0003-Add-the-needed-build-system-changes-in-order-to-comp.patch", Size: 11875 bytes --]

From 75b61bb7c56431c9f509ee9cfd3ef3db9c3a619b Mon Sep 17 00:00:00 2001
From: Tamar Christina <tamar.christina@arm.com>
Date: Wed, 5 Jul 2017 13:02:30 +0100
Subject: [PATCH 3/5] Add the needed build system changes in order to compile
 and create the new libraries for Semihosting v2 for ARM.

This uses the new recursive build target in multi-build.in

The new spec files are:

For AArch32/ARM (m for mixed mode):
  - rdimon-v2m.specs
  - aprofile-validation-v2m.specs
  - aprofile-ve-v2m.specs

These spec files will be using the new libraries generated
by multi-build.in.

Signed-off-by: Tamar Christina <tamar.christina@arm.com>
---
 libgloss/arm/Makefile.in                       | 58 ++++++++++++++++++++------
 libgloss/arm/coff-rdimon-v2m.specs             | 16 +++++++
 libgloss/arm/coff-rdimon.specs                 |  7 ++++
 libgloss/arm/elf-aprofile-validation-v2m.specs | 23 ++++++++++
 libgloss/arm/elf-aprofile-validation.specs     |  5 ++-
 libgloss/arm/elf-aprofile-ve-v2m.specs         | 22 ++++++++++
 libgloss/arm/elf-aprofile-ve.specs             |  4 +-
 libgloss/arm/elf-rdimon-v2m.specs              | 22 ++++++++++
 libgloss/arm/elf-rdimon.specs                  |  7 ++++
 9 files changed, 147 insertions(+), 17 deletions(-)
 create mode 100644 libgloss/arm/coff-rdimon-v2m.specs
 create mode 100644 libgloss/arm/elf-aprofile-validation-v2m.specs
 create mode 100644 libgloss/arm/elf-aprofile-ve-v2m.specs
 create mode 100644 libgloss/arm/elf-rdimon-v2m.specs

diff --git a/libgloss/arm/Makefile.in b/libgloss/arm/Makefile.in
index 3f87deae2..e1bad1710 100644
--- a/libgloss/arm/Makefile.in
+++ b/libgloss/arm/Makefile.in
@@ -29,8 +29,15 @@ MULTISRCTOP =
 MULTIBUILDTOP =
 MULTIDIRS =
 MULTISUBDIR =
+MULTILIBNAME =
 MULTIDO = true
 MULTICLEAN = true
+MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
+MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
+
+MULTIDIRS += semihv2m
+MULTIDIR_semihv2m_FLAGS = $(MULTI_DEFAULT_FLAGS) -DSEMIHOST_V2_MIXED_MODE
+MULTIDIR_semihv2m_NAME = -v2m
 
 SHELL =	/bin/sh
 
@@ -75,10 +82,12 @@ RDPMON_OBJS	= ftruncate.o libcfunc.o syscalls.o trap.o truncate.o _exit.o _kill.
 RDPMON_SCRIPTS	= rdpmon.specs
 RDPMON_INSTALL	= install-rdpmon
 
-RDIMON_CRT0	= rdimon-crt0.o
-RDIMON_BSP	= librdimon.a
+RDIMON_CRT0	= rdimon-crt0${${MULTILIBNAME}}.o
+RDIMON_BSP	= librdimon${${MULTILIBNAME}}.a
 RDIMON_OBJS	= $(patsubst %,rdimon-%,$(RDPMON_OBJS))
-RDIMON_SCRIPTS	= rdimon.specs aprofile-validation.specs aprofile-ve.specs
+RDIMON_SCRIPTS	= rdimon${${MULTILIBNAME}}.specs \
+		  aprofile-validation${${MULTILIBNAME}}.specs \
+		  aprofile-ve${${MULTILIBNAME}}.specs
 RDIMON_INSTALL	= install-rdimon
 
 CFLAGS		= -g
@@ -110,6 +119,7 @@ all: ${CRT0} ${LINUX_CRT0} ${LINUX_BSP} ${REDBOOT_CRT0} ${REDBOOT_OBJS} ${RDPMON
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 #
 # here's where we build the test programs for each target
@@ -121,33 +131,34 @@ test:
 crt0.o: crt0.S
 redboot-crt0.o: redboot-crt0.S
 redboot-syscalls.o: redboot-syscalls.c $(srcdir)/../syscall.h
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
 
 rdpmon-crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDP_MONITOR -o $@ -c $<
 
-rdimon-crt0.o: crt0.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-ftruncate.o: ftruncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-trap.o: trap.S
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-truncate.o: truncate.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_exit.o: _exit.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-_kill.o: _kill.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-syscalls.o: syscalls.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 rdimon-libcfunc.o: libcfunc.c
-	$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+	$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 $(LINUX_BSP): $(LINUX_OBJS)
 	${AR} ${ARFLAGS} $@ $^
@@ -161,6 +172,23 @@ $(RDIMON_BSP): $(RDIMON_OBJS)
 	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
+# Multilib support.
+.PHONY:  multi-do all-multi clean-multi install-multi
+
+all-recursive: all-multi
+clean-recursive: clean-multi
+install-recursive: install-multi
+
+# The $(MAKE) comments below are to enable parallel building.
+all-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=all multi-do
+
+clean-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=clean multi-do
+
+install-multi:
+	$(MAKE) $(AM_MAKEFLAGS) DO=install multi-do
+
 clean mostlyclean:
 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(IQ80310_BSP)
 	@rootpre=`pwd`/; export rootpre; \
@@ -172,6 +200,7 @@ clean mostlyclean:
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) clean-recursive
 
 distclean maintainer-clean realclean: clean
 	rm -f Makefile config.status *~
@@ -187,6 +216,7 @@ install: ${CRT0_INSTALL} ${LINUX_INSTALL} ${REDBOOT_INSTALL} ${RDPMON_INSTALL} $
 	    else true; fi; \
 	  else true; fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
 
 install-nano:
 	set -e; for x in ${NANO_SCRIPTS}; do ${INSTALL_DATA} ${srcdir}/${objtype}$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
@@ -228,3 +258,5 @@ Makefile: Makefile.in config.status @host_makefile_frag_path@
 
 config.status: configure
 	$(SHELL) config.status --recheck
+
+include $(srcdir)/../multi-build.in
\ No newline at end of file
diff --git a/libgloss/arm/coff-rdimon-v2m.specs b/libgloss/arm/coff-rdimon-v2m.specs
new file mode 100644
index 000000000..c0f723e9d
--- /dev/null
+++ b/libgloss/arm/coff-rdimon-v2m.specs
@@ -0,0 +1,16 @@
+# rdimon-v2m.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting. This version is intended for AArch64/AArch32
+# mixed mode executables and as such uses the HLT trap instructions.
+#
+# This version supports extensibility through an extension mechanism.
+
+%rename link                old_link
+
+*link:
+%(old_link) -lrdimon-v2m
+
+*startfile:
+rdimon-crt0-v2m%O%s
+
diff --git a/libgloss/arm/coff-rdimon.specs b/libgloss/arm/coff-rdimon.specs
index ace550614..89135cfba 100644
--- a/libgloss/arm/coff-rdimon.specs
+++ b/libgloss/arm/coff-rdimon.specs
@@ -1,3 +1,10 @@
+# rdimon.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting using the SVC trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
 %rename link                old_link
 
 *link:
diff --git a/libgloss/arm/elf-aprofile-validation-v2m.specs b/libgloss/arm/elf-aprofile-validation-v2m.specs
new file mode 100644
index 000000000..accef99e1
--- /dev/null
+++ b/libgloss/arm/elf-aprofile-validation-v2m.specs
@@ -0,0 +1,23 @@
+# aprofile-validation-v2m.specs
+#
+# Spec file for AArch32 A profile baremetal newlib, libgloss on
+# VALIDATION platform with AngelAPI semi-hosting version 2 using the HLT
+# trap instruction.
+#
+# This Spec file is also appropriate for the foundation model.
+
+%rename link old_link
+
+*link:
+--defsym=_rdimon_vector_base=0x00000000 -Ttext-segment=0x00010000 %(old_link)
+
+%rename lib libc
+
+*libgloss:
+-lrdimon-v2m
+
+*lib:
+cpu-init/rdimon-aem.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
diff --git a/libgloss/arm/elf-aprofile-validation.specs b/libgloss/arm/elf-aprofile-validation.specs
index 166a5dec6..4ef0e9510 100644
--- a/libgloss/arm/elf-aprofile-validation.specs
+++ b/libgloss/arm/elf-aprofile-validation.specs
@@ -1,7 +1,8 @@
-# aem-validation.specs
+# aprofile-validation.specs
 #
 # Spec file for AArch32 A profile baremetal newlib, libgloss on
-# VALIDATION platform with AngelAPI semi-hosting.
+# VALIDATION platform with AngelAPI semi-hosting version 2 using the SVC
+# trap instruction.
 #
 # This Spec file is also appropriate for the foundation model.
 
diff --git a/libgloss/arm/elf-aprofile-ve-v2m.specs b/libgloss/arm/elf-aprofile-ve-v2m.specs
new file mode 100644
index 000000000..75f380216
--- /dev/null
+++ b/libgloss/arm/elf-aprofile-ve-v2m.specs
@@ -0,0 +1,22 @@
+# aprofile-ve-v2m.specs
+#
+# Spec file for AArch32 A profile baremetal newlib, libgloss on VE platform with AngelAPI
+# semi-hosting version 2 using the HLT trap instruction.
+#
+# This Spec file is also appropriate for the foundation model.
+
+%rename link old_link
+
+*link:
+--defsym=_rdimon_vector_base=0x80000000 -Ttext-segment=0x80010000 %(old_link)
+
+%rename lib libc
+
+*libgloss:
+-lrdimon-v2m
+
+*lib:
+cpu-init/rdimon-aem.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
diff --git a/libgloss/arm/elf-aprofile-ve.specs b/libgloss/arm/elf-aprofile-ve.specs
index d94bb7a94..1461b34bf 100644
--- a/libgloss/arm/elf-aprofile-ve.specs
+++ b/libgloss/arm/elf-aprofile-ve.specs
@@ -1,7 +1,7 @@
-# aem-ve.specs
+# aprofile-ve.specs
 #
 # Spec file for AArch32 A profile baremetal newlib, libgloss on VE platform with AngelAPI
-# semi-hosting.
+# semi-hosting version 2 using the SVC trap instruction.
 #
 # This Spec file is also appropriate for the foundation model.
 
diff --git a/libgloss/arm/elf-rdimon-v2m.specs b/libgloss/arm/elf-rdimon-v2m.specs
new file mode 100644
index 000000000..e4f2545a4
--- /dev/null
+++ b/libgloss/arm/elf-rdimon-v2m.specs
@@ -0,0 +1,22 @@
+# rdimon-v2m.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting. This version is intended for AArch64/AArch32
+# mixed mode executables and as such uses the HLT trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
+%rename link_gcc_c_sequence                rdimon_link_gcc_c_sequence
+
+*rdimon_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*rdimon_libgloss:
+%{!specs=nano.specs:-lrdimon-v2m} %{specs=nano.specs:-lrdimon_nano}
+
+*link_gcc_c_sequence:
+%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) %(rdimon_libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0-v2m%O%s} %{pg:rdimon-crt0-v2m%O%s}
+
diff --git a/libgloss/arm/elf-rdimon.specs b/libgloss/arm/elf-rdimon.specs
index c35061f3a..b4d020d77 100644
--- a/libgloss/arm/elf-rdimon.specs
+++ b/libgloss/arm/elf-rdimon.specs
@@ -1,3 +1,10 @@
+# rdimon.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting using the SVC trap instruction.
+#
+# This version supports extensibility through an extension mechanism.
+
 %rename link_gcc_c_sequence                rdimon_link_gcc_c_sequence
 
 *rdimon_libc:
-- 
2.13.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-05 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 16:55 [PATCH][Newlib][libgloss][ARM] - Semihosting v2 Makefile changes (3 / 5) Tamar Christina
2017-07-05 12:14 ` Tamar Christina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).