Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp563713ybx; Wed, 6 Nov 2019 05:07:46 -0800 (PST) X-Google-Smtp-Source: APXvYqy96R3MTqsZe8pvWz7MPyNd1siEcbZ+LpGtkOdJe+rO6er4JnM9+vV72xLqqbRwAvCiW6id X-Received: by 2002:a17:906:4913:: with SMTP id b19mr273190ejq.61.1573045666621; Wed, 06 Nov 2019 05:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045666; cv=none; d=google.com; s=arc-20160816; b=Ix0/+xsoWdvlExavp+oS5Q7439G7vwqcM+YEf0ray6RlYnuS1oLLBaVR/x2YUfm1RD KtgM+0j10KfauLNRmjT3MMsYNNWv6f/9pp/3AOfONCY7mTPMYOc5eMcijr00khd3twPg opkcia4qnoYFxXWHivv9dedaPwm33BEvgOEj9CkDzu9IC6fj0eFhk68CpKDZaL5RnP8X 5Godjev+hVqSw4Ikt4o2msyBNUX+jg5Ksqh8IKXoiJf6ddoeieyqB7hGylvVcenFtdYX vmBQyT6JjksdAJTAej/S6jufsbxA5wgnXgAdl53GUU9g9xqn3r9KDoGICTfsowjRsoX3 cCcw== 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 qp14si1419908ejb.274.2019.11.06.05.07.22; Wed, 06 Nov 2019 05:07:46 -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 S1730456AbfKFNET (ORCPT + 99 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 Content-Type: text/plain 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. 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 || -- 2.17.1