From patchwork Wed Nov 6 09:19:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 178636 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp335462ilf; Wed, 6 Nov 2019 01:21:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxbSkqar01hl857rln6F9uZLfODhEsh5rtV3pWB7rNSo44bWu5Wp/t+FlFnL0HZVznUL0AE X-Received: by 2002:a6b:8d8f:: with SMTP id p137mr31640609iod.53.1573032068072; Wed, 06 Nov 2019 01:21:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573032068; cv=none; d=google.com; s=arc-20160816; b=PUnvdMIKhh2TQC0xLvgY9WhI1uyxaNW++ZGjKpWk29EUJP9pnVI5dBIqGgjUTBZiih /yvCknik8j138cmvg6JciQ2UkmM1HPW/OWWFpPMYw0rqKO+r14bi4VzMu5YNOJ9rAPk5 xvEnAg3K5fWKAv8QEQLcKplp309JF9/zMM1K2E2cX4LiAAsgOAoHtYJGqSHKffedei6X rA0L1GmThhhxH0eZ5o4VYim3CY9H1mBzUEqejuXt4TgBzRaFWZHJsfAh40C373wfH9rC rm5yHrVO+3YyDJZ/dijw5wnVNKOvi9ZNvYJZk3uhB/cOfixiEHzNl3gNDGgs/Vw9aU4G R4lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :dkim-signature; bh=RteT+dgxmE1cfXxwA0OouzIUif0xfWdCJB9Q+UL6+ac=; b=enXW6dM3MWMfLR71hb7WOUN8F/2VdvxVH9CJ4j2RQut8KWIwSIOsFCuaBFjjEVU4uI 08ykx+Bs/leMS8QDaoVK+8heYAoVQ+Cww1rMLHFSwS7YDmr1bl0UFBE7rMOYMPY9EQXf TwGNCTXtC4DlYoZudbDQttf1vryyEMdJOCQcRvZ8sesGcV2h6Qyda2ndlVIRjcQAHnhh BNII+Z+SbSg4POvfVqIm5NnHRsig/xDY1meztnTRHd+3xDb79Fhpw7CRaBrTSuKkQNiH NVbD59GK42dSW1NpkfSQ+Oz8lWKkeD27LoiIZHgha1bnEJVjtxxpUND/G0gF9YUdiVsy cSdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=imZLBWBS; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id l13si14541710ils.138.2019.11.06.01.21.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 01:21:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=imZLBWBS; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTK-0006rW-Te; Wed, 06 Nov 2019 09:19:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTI-0006rO-TV for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:24 +0000 X-Inumbo-ID: 8388bb1c-0076-11ea-adbe-bc764e2007e4 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8388bb1c-0076-11ea-adbe-bc764e2007e4; Wed, 06 Nov 2019 09:19:20 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id t5so25236023ljk.0 for ; Wed, 06 Nov 2019 01:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y60o9fNUcHZsrorXcWFX4zvC9XULhWVpmJqmThUGBvs=; b=imZLBWBS0BJ7Slb1xEMmz7uUDllOi1B5SPzOa4E59Fx/u6gcbMWxkuWXAaJZGCWt1e mSb/Nal1B8A7d4GjoAaWx9DQ3r3CZbRt0PPwrrDOHyHnOYMtahcx25Ay+Mtcq4Ui2UjO FG/xbXglpY0Y4zAzBswfAC6Tb9jFpNA3vq6Co6nMz3qSV1iSDzOd4eEqC6QyfOsBDNOR n3bbnCSdIrjnBD44KowCtgYooSTQdNQz1s4gjmY18rg3YyaJo8vjvoe/nd8f3NTNP+5H tsSUO6J0/V/GIvDDg/f6Fa1ZsEfbzUIFxe5onipgRsHnwPS5BR+1qaMfowQkdH8AYM6m hDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y60o9fNUcHZsrorXcWFX4zvC9XULhWVpmJqmThUGBvs=; b=S9NCUjy3nL+7FBplMrGR49s//YSs54TVZPAqmqczjABYyL8nBAYPCSv5JscDytTVcQ 4IptwPKmGIceD6oB8wjp5VDG898r4P+Vdf9S81FzkHDw1/Dr3EFg9LHTxL08ytkPw77U MKeT1RxZD+ZhFBUia1t9OdpgyYMwLxLfdsdey4dL22Ml09fWPBsi6rmyqFllQKBW8xWd ibSnXS/bGC2OHG1S4jUco1BCH1TzWLLEqIE0PKaBaQIoCjVzvv8K7iaqDCe6h0s/Hs0G OHBJF7YkjrOs3JeKURxqDB+jhFUCtJyVXruzAn1+zdwMusOYvY0Vj5x1ro3VnAQkQsZ2 6IEQ== X-Gm-Message-State: APjAAAVeo4je9dxcUuq59ACSjh+1UzdX3wGxtIeLjMxMywI/rKfUZpCZ 2O28to0SioRpn3DyhO4es6lpog3D1ds= X-Received: by 2002:a2e:890e:: with SMTP id d14mr1098025lji.6.1573031958811; Wed, 06 Nov 2019 01:19:18 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:18 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:07 +0200 Message-Id: <1573031953-12894-2-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 1/7] xen: clang: Support correctly cross-compile X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall Clang uses "-target" option for cross-compilation. Signed-off-by: Julien Grall --- config/StdGNU.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/StdGNU.mk b/config/StdGNU.mk index 039274e..48c50b5 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -1,8 +1,13 @@ AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld ifeq ($(clang),y) -CC = $(CROSS_COMPILE)clang -CXX = $(CROSS_COMPILE)clang++ +ifneq ($(CROSS_COMPILE),) +CC = clang -target $(CROSS_COMPILE:-=) +CXX = clang++ -target $(CROSS_COMPILE:-=) +else +CC = clang +CXX = clang++ +endif LD_LTO = $(CROSS_COMPILE)llvm-ld else CC = $(CROSS_COMPILE)gcc