From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Miccio Subject: Re: [PATCH] xen/Makefile: remove all temporary files for every architecture Date: Thu, 23 Mar 2017 13:48:24 +0100 Message-ID: <56B5E136-5D9E-4D8B-960A-0E316FD6C661@gmail.com> References: <20170323013137.37599-1-lucmiccio@gmail.com> <20170323110704.coylbras6guq6tf6@citrix.com> <20170323111959.o2clurft2wrbgmch@citrix.com> Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Content-Type: multipart/mixed; boundary="===============1384819360031791362==" Return-path: In-Reply-To: <20170323111959.o2clurft2wrbgmch@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu Cc: Stefano Stabellini , George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com, xen-devel@lists.xenproject.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============1384819360031791362== Content-Type: multipart/alternative; boundary="Apple-Mail=_7C0E83E7-A441-4A48-9F0A-9203D8937809" --Apple-Mail=_7C0E83E7-A441-4A48-9F0A-9203D8937809 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Il giorno 23 mar 2017, alle ore 12:20, Wei Liu = ha scritto: >=20 > On Thu, Mar 23, 2017 at 11:07:04AM +0000, Wei Liu wrote: >> On Thu, Mar 23, 2017 at 02:31:37AM +0100, Luca Miccio wrote: >>> Execute the clean target for both arm and x86 architecture. >>>=20 >>> When trying to build Xen for a different architecture in the same >>> tree, the command make clean will only remove temporary files for >>> the host architecture. >>> This will lead a compilation error when trying to build ARM64 and >>> ARM32 Xen in the same tree. >>> (See also: = https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg02176.html= ) >>>=20 >>> Signed-off-by: Luca Miccio >>> --- >>> xen/Makefile | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>=20 >>> diff --git a/xen/Makefile b/xen/Makefile >>> index dc6862e04d..fcd5c7e9d6 100644 >>> --- a/xen/Makefile >>> +++ b/xen/Makefile >>> @@ -115,7 +115,8 @@ _clean: delete-unfresh-files >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean >>> $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean >>> - $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean >>> + $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/arm clean >>> + $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/x86 clean >>=20 >> A more future-proof way of doing this is to use find to collect a = list >> of directory under arch/ and iterate. >>=20 >> But I don't see a new architecture support coming any time soon, so >> this is just a suggestion. >>=20 I had the same doubt, but, as you said there is no new architecture = support coming soon. However i could add this option. >=20 > Also, you seem to have missed overriding TARGET_ARCH and = TARGET_SUBARCH. > I believe there are references to them in arch-specific Makefiles. >=20 > Wei. I don=E2=80=99t get your point/suggestion. When we use =E2=80=9Cmake = clean=E2=80=9D, with my patch applied, we=20 simply execute the clean target for every architecture supported for = now.=20 I took a look at the clean target used both from the arm and the x86 = Makefile and i didn=E2=80=99t find any references to TARGET_ARCH and TARGET_SUBARCH. Also, with the current command: $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean The target clean is called only for the $TARGET_ARCH architecture, = which, if it=E2=80=99s not set ( "make clean | distclean" at the xen = root directory), is the host one. Maybe i=E2=80=99m missing something. Luca. --Apple-Mail=_7C0E83E7-A441-4A48-9F0A-9203D8937809 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Il giorno 23 mar 2017, alle ore 12:20, Wei Liu <wei.liu2@citrix.com>= ha scritto:

On Thu, Mar 23, 2017 at 11:07:04AM +0000, = Wei Liu wrote:
On Thu, Mar 23, 2017 at = 02:31:37AM +0100, Luca Miccio wrote:
Execute the clean target for both arm and x86 = architecture.

When trying to build Xen for = a different architecture in the same
tree, the command = make clean will only remove temporary files for
the host = architecture.
This will lead a compilation error when = trying to build ARM64 and
ARM32 Xen in the same tree.
(See also: https://lists.xenproject.org/archives/html/xen-devel/2016-11/ms= g02176.html)

Signed-off-by: Luca Miccio = <lucmiccio@gmail.com>
---
xen/Makefile | 3 ++-
1 file changed, 2 = insertions(+), 1 deletion(-)

diff --git = a/xen/Makefile b/xen/Makefile
index dc6862e04d..fcd5c7e9d6 = 100644
--- a/xen/Makefile
+++ = b/xen/Makefile
@@ -115,7 +115,8 @@ _clean: = delete-unfresh-files
$(MAKE) -f $(BASEDIR)/Rules.mk -C = drivers clean
$(MAKE) -f $(BASEDIR)/Rules.mk -C = xsm clean
$(MAKE) -f $(BASEDIR)/Rules.mk -C = crypto clean
- $(MAKE) -f $(BASEDIR)/Rules.mk -C = arch/$(TARGET_ARCH) clean
+ $(MAKE) -f $(BASEDIR)/Rules.mk -C = arch/arm clean
+ $(MAKE) -f $(BASEDIR)/Rules.mk -C = arch/x86 clean

A more = future-proof way of doing this is to use find to collect a list
of directory under arch/ and iterate.

But I don't see a new architecture support coming any time = soon, so
this is just a suggestion.


I had the same doubt, but, as you said there is no = new architecture support coming soon.
However i could add this = option.

Also, you seem to = have missed overriding TARGET_ARCH and TARGET_SUBARCH.
I believe there are = references to them in arch-specific Makefiles.

Wei.
I don=E2=80=99= t get your point/suggestion. When we use =E2=80=9Cmake clean=E2=80=9D, = with my patch applied, we 
simply execute the clean = target for every architecture supported for now. 
I took = a look at the clean target used both from the arm and the x86 Makefile = and i didn=E2=80=99t find
any references to TARGET_ARCH and = TARGET_SUBARCH.

Also, with the = current command:
$(MAKE) -f $(BASEDIR)/Rules.mk -C = arch/$(TARGET_ARCH) clean
The target clean is called only for = the $TARGET_ARCH architecture, which, if it=E2=80=99s not set ( "make = clean | distclean" at the xen root directory),
is the host = one.

Maybe i=E2=80=99m missing = something.

Luca.

= --Apple-Mail=_7C0E83E7-A441-4A48-9F0A-9203D8937809-- --===============1384819360031791362== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============1384819360031791362==--