From patchwork Wed Nov 6 13:00:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178682 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp578266ilf; Wed, 6 Nov 2019 05:04:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyCi2ySWu7OckjYf0LuEYNCaCla6prlw0IvHYDlitMnusWJbSbZe5w4e5O/X18/bXAXQdoK X-Received: by 2002:a50:bac2:: with SMTP id x60mr2490588ede.114.1573045461276; Wed, 06 Nov 2019 05:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045461; cv=none; d=google.com; s=arc-20160816; b=pgm6sBix2T0S3HB84BjAE4J0Kur8X75Xnnu7c19ICs/WomdT74L1pd7RRh6DdMvpDk DD8O4J76ybRUaQRbzAjbMoi+MzE6JqQLS+hHV2DnVUVbvTXr4rSL6v/wpewzKtA0CRwy DD9x00JdQsEscCvvn0wokxINfq9dffgR1W4qpt6YKskSBsBbT+ktjGes9ipXrMkCxViu v+tWBJ5qUukaVrb4X2MtAlgMTjlHG7EULa+n5DGufPalJeU7xXa/bmVP1Jq+36BdUbOD wdNFzPN2VZg1t0vQUdy+EB2l2m1zYKu58Mvu5muzafywSZsXm761YxUa73po9fCEuS9Q 8jlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=0357d5VlNSqY4lAroWMcvu/dQab6iH2Gcyb9a2qpI0o=; b=PetaDOvahITVhzGTA058/MqIcR5O7cTLG/CqeNuqsZAsI/usiZEfxdw6JIw0fV2JbN ruRFRpgQXnR7TlZKoK6lHKH1rCvtlZ8JP0RNtDYXvjleozYtSZ4gdnDdOvwrjJiTcz8Z ehhTeiDOdY18UZVrCmAPIbhJaZd1aAsMzPh0VIJP3K+NafmX8D+WYPmmxFR0yIVeZWaT 1vTc7ZvInVIEDbH1F1D2mIzmEW8Tbl6iIU9meTswwn4mao5Akm7ttMlbYgTno8H2D9tO Xaa0bPqvUJrDexqSSVKM30eZwAxHKqJEPKxwfELiEjwDoYH81BYwWUOnbI9pG0numiE1 FI4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg4si7562131ejb.236.2019.11.06.05.04.21; Wed, 06 Nov 2019 05:04:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730768AbfKFNET (ORCPT + 26 others); Wed, 6 Nov 2019 08:04:19 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:37410 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729430AbfKFNET (ORCPT ); Wed, 6 Nov 2019 08:04:19 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C32D1F37FB2D9B81F177; Wed, 6 Nov 2019 21:04:16 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Wed, 6 Nov 2019 21:04:07 +0800 From: John Garry To: , , , , , , CC: , , , John Garry Subject: [RFC PATCH] perf tools: Fix cross compile for ARM64 Date: Wed, 6 Nov 2019 21:00:54 +0800 Message-ID: <1573045254-39833-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently when cross compiling perf tool for ARM64 on my x86 machine I get this error: arch/arm64/util/sym-handling.c:9:10: fatal error: gelf.h: No such file or directory #include For the build, libelf is reported off: Auto-detecting system features: ... ... libelf: [ OFF ] Indeed, test-libelf is not built successfully: more ./build/feature/test-libelf.make.output test-libelf.c:2:10: fatal error: libelf.h: No such file or directory #include ^~~~~~~~~~ compilation terminated. I have no such problems natively compiling on ARM64, and I did not previously have this issue for cross compiling. Fix by relocating the gelf.h include. Signed-off-by: John Garry --- I marked this as RFC as I am suspicious that I have seen no other reports, and whether fixing up the libelf.h include issue is the proper approach. -- 2.17.1 diff --git a/tools/perf/arch/arm64/util/sym-handling.c b/tools/perf/arch/arm64/util/sym-handling.c index 5df788985130..8dfa3e5229f1 100644 --- a/tools/perf/arch/arm64/util/sym-handling.c +++ b/tools/perf/arch/arm64/util/sym-handling.c @@ -6,9 +6,10 @@ #include "symbol.h" // for the elf__needs_adjust_symbols() prototype #include -#include #ifdef HAVE_LIBELF_SUPPORT +#include + bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) { return ehdr.e_type == ET_EXEC ||