From: Tamar Christina <Tamar.Christina@arm.com>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Cc: nd <nd@arm.com>, Richard Earnshaw <Richard.Earnshaw@arm.com>,
"Marcus Shawcroft" <Marcus.Shawcroft@arm.com>,
"jjohnstn@redhat.com" <jjohnstn@redhat.com>
Subject: [PATCH][Newlib][libgloss][AArch64] - Semihosting v2 Makefile changes (2 / 5)
Date: Mon, 03 Jul 2017 16:53:00 -0000 [thread overview]
Message-ID: <VI1PR0801MB2031577FC1E845A2040032C8FFD60@VI1PR0801MB2031.eurprd08.prod.outlook.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 832 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
For AArch64 no new spec files are needed.
Regression tested on aarch64-none-elf.
OK for master?
PS. I do not have commit rights so if OK can someone apply for me?
Thanks,
Tamar
libgloss/
2017-07-03 Tamar Christina <tamar.christina@arm.com>
* aarch64/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.
* aarch64/elf-rdimon.specs: Document rdimon version.
* aarch64/elf-aem-validation.specs: Likewise.
* aarch64/elf-aem-ve.specs: Likewise.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: semihosting-patch-2.patch --]
[-- Type: text/x-patch; name="semihosting-patch-2.patch", Size: 6370 bytes --]
diff --git a/libgloss/aarch64/Makefile.in b/libgloss/aarch64/Makefile.in
index 3c8a9fd10182ad1330b91b3eba3961666ba550a1..546557e3ceb7db8ef77fe131a3f415b823f4b86a 100644
--- a/libgloss/aarch64/Makefile.in
+++ b/libgloss/aarch64/Makefile.in
@@ -52,8 +52,11 @@ MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
+MULTILIBNAME =
MULTIDO = true
MULTICLEAN = true
+MULTI_FLAGS_FOR_TARGET = MULTI_DEFAULT_FLAGS
+MULTI_DEFAULT_FLAGS = -DSEMIHOST_V2
SHELL = /bin/sh
@@ -77,11 +80,12 @@ OBJS = ftruncate.o libcfunc.o syscalls.o truncate.o _exit.o _kill.o
CRT0 = crt0.o
CRT0_INSTALL = install-crt0
-CRT0_INSTALL = install-crt0
-RDIMON_CRT0 = rdimon-crt0.o
-RDIMON_BSP = librdimon.a
+RDIMON_CRT0 = rdimon-crt0${${MULTILIBNAME}}.o
+RDIMON_BSP = librdimon${${MULTILIBNAME}}.a
RDIMON_OBJS = $(patsubst %,rdimon-%,$(OBJS))
-RDIMON_SCRIPTS = rdimon.specs aem-ve.specs aem-validation.specs
+RDIMON_SCRIPTS = rdimon${${MULTILIBNAME}}.specs \
+ aem-ve${${MULTILIBNAME}}.specs \
+ aem-validation${${MULTILIBNAME}}.specs
RDIMON_INSTALL = install-rdimon
CFLAGS = -g
@@ -93,6 +97,7 @@ CFLAGS = -g
# build a test program for each target board. Just trying to get
# it to link is a good test, so we ignore all the errors for now.
#
+
all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP} ${RDIMON_SCRIPTS}
@rootpre=`pwd`/; export rootpre; \
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
@@ -103,6 +108,7 @@ all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP} ${RDIMON_SCRIPTS}
else true; fi; \
else true; fi; \
done
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
#
# here's where we build the test programs for each target
@@ -112,35 +118,53 @@ test:
#
crt0.o: crt0.S
+ $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -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-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-_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-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-_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-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 $<
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-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_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) ${RDIMON_SCRIPTS}
@rootpre=`pwd`/; export rootpre; \
@@ -152,6 +176,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 *~
@@ -167,6 +192,7 @@ install: ${CRT0_INSTALL} ${RDIMON_INSTALL}
else true; fi; \
else true; fi; \
done
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
install-crt0:
${INSTALL_DATA} ${CRT0} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x
@@ -189,3 +215,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/aarch64/elf-aem-validation.specs b/libgloss/aarch64/elf-aem-validation.specs
index ca0c92d5845ba83bf6bad6a3ea218515e62f007a..800791ac1dcfef955d62697d907c81b9f0e2aa9f 100644
--- a/libgloss/aarch64/elf-aem-validation.specs
+++ b/libgloss/aarch64/elf-aem-validation.specs
@@ -1,7 +1,7 @@
# aem-ve.specs
#
# Spec file for AArch64 baremetal newlib, libgloss on the validation platform
-# with AngelAPI semi-hosting.
+# with version 2 of AngelAPI semi-hosting.
%rename lib libc
diff --git a/libgloss/aarch64/elf-aem-ve.specs b/libgloss/aarch64/elf-aem-ve.specs
index 671d3c14fea55b587aeee92ec18abc5f6b645105..8d86de1bea92f32414e1c4447e7c9ebf94541871 100644
--- a/libgloss/aarch64/elf-aem-ve.specs
+++ b/libgloss/aarch64/elf-aem-ve.specs
@@ -1,7 +1,7 @@
# aem-ve.specs
#
-# Spec file for AArch64 baremetal newlib, libgloss on VE platform with AngelAPI
-# semi-hosting.
+# Spec file for AArch64 baremetal newlib, libgloss on VE platform with version 2
+# of AngelAPI semi-hosting.
#
# This Spec file is also appropriate for the foundation model.
diff --git a/libgloss/aarch64/elf-rdimon.specs b/libgloss/aarch64/elf-rdimon.specs
index cb964db5bc1a3d7e9eeb4165e4f834fa618fae2f..a1d84c2bba474119ed560052b29dbdc1b36ab287 100644
--- a/libgloss/aarch64/elf-rdimon.specs
+++ b/libgloss/aarch64/elf-rdimon.specs
@@ -1,3 +1,8 @@
+# rdimon.specs
+#
+# Spec file for AArch64 baremetal newlib with version 2 of the
+# AngelAPI semi-hosting.
+
%rename lib libc
*libgloss:
next reply other threads:[~2017-07-03 16:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 16:53 Tamar Christina [this message]
2017-07-05 12:13 ` Tamar Christina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VI1PR0801MB2031577FC1E845A2040032C8FFD60@VI1PR0801MB2031.eurprd08.prod.outlook.com \
--to=tamar.christina@arm.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=jjohnstn@redhat.com \
--cc=nd@arm.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).