From patchwork Thu Oct 12 13:29:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10001993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 769AF6028A for ; Thu, 12 Oct 2017 13:29:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6856E28DD6 for ; Thu, 12 Oct 2017 13:29:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D78328DD9; Thu, 12 Oct 2017 13:29:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D35CC28DD6 for ; Thu, 12 Oct 2017 13:29:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B89EB6E84D; Thu, 12 Oct 2017 13:29:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id E67FF6E848; Thu, 12 Oct 2017 13:29:54 +0000 (UTC) Received: by mail-qt0-x244.google.com with SMTP id v41so3362954qtv.12; Thu, 12 Oct 2017 06:29:54 -0700 (PDT) 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=hrS2uc8P/yE3E5pod4MOAvE7eKn/Re+OFuTmQvbEPyE=; b=eqS0LFfgQgh+3InDwWH5mj4blYzf3UROp48hkII8PEKjZx2b7k1q6oLs1XXgjnsOiq ztGykHtPbOqt129Hm7TOndozK59to2x+suQImxARrmk8GC9TP7tfJMJaey5LPfJQ4PWI rx5HNUPPH9UhhfWiLF2SRoCCZyAXlcVymTD1jUlSVqnLiAWaL/gM4UgUX61/3h2CyJ3U TCcH0uLu9xNe5e9XyLdxEujJlyrJF/m4iB+DJ1hlRrT4rDS1WnrlQ/6/VyfVFwplfYiP 7FZ2gaZftqPhbeuuGpMjOP8DNV/0QpR2cqOxwE0YHDs7Igqnp0YjksycGwm+BlBg3SFn L/Kg== 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=hrS2uc8P/yE3E5pod4MOAvE7eKn/Re+OFuTmQvbEPyE=; b=K2RE2YbC83hGSU1EFUJHfXOZ7B6JmaWyB/dGXgaJ+DmB7D+o86D2B8708sKyK29MD6 fBjNk2sHk5anmvs4WsV3C1H7o87Tv+yNEft3qOq3Y79IapeIIi3rpevcdRIvPxqDClXx ZAMKCBho77gnRarBQJ4SGIl7B30/c4eLWLF49uCkWCuUqHPMW0rRm78qmJR2CibRwuFB oH+IVrG4flbWVWRJT0YtKFOnwwacqLwqSe0HQ//Avw/xNY2yNTnD1rN9+xuQLwlnQczO KMWStVEZSUCPUWDocIXeOS4lKmOQGEow+Q2a8coQHPUWUatGSkH0/xNRs5vj1A07VZLA sm4Q== X-Gm-Message-State: AMCzsaXk5adUQrAAgwg8wsQfOvn6eiSOrYuPR8QvU0Vb+q7QtJGSH8EJ G275mrGKwx0wBZdD3ZoMYN/DmQ== X-Google-Smtp-Source: AOwi7QCugb5VEo9x9GLISr4dlU4j8Cdjw7k2+9MABjperY1SIRn7Sjj9zhoHYSJRRHawUOa7ogkTnQ== X-Received: by 10.200.52.85 with SMTP id v21mr3607881qtb.2.1507814991322; Thu, 12 Oct 2017 06:29:51 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id 2sm7327455qto.28.2017.10.12.06.29.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 06:29:50 -0700 (PDT) From: Thierry Reding To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2017 15:29:39 +0200 Message-Id: <20171012132943.28316-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171012132943.28316-1-thierry.reding@gmail.com> References: <20171012132943.28316-1-thierry.reding@gmail.com> Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 3/7] lib: Fix compilation on non-x86 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The meson build avoids the failure by excluding the igt_x86.c file from the compilation. autotools being what they are don't support that in an easy way, so just use the preprocessor to avoid the duplicate function definitions. Since igt_x86.c will now be ignored for non-x86 builds, the meson work- around can be removed. Signed-off-by: Thierry Reding Reviewed-by: Ville Syrjälä --- lib/igt_x86.c | 2 ++ lib/igt_x86.h | 2 +- lib/meson.build | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/igt_x86.c b/lib/igt_x86.c index 0f0963ced044..0ed3c6f1d356 100644 --- a/lib/igt_x86.c +++ b/lib/igt_x86.c @@ -93,6 +93,7 @@ #define has_YMM 0x1 +#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void) { unsigned max = __get_cpuid_max(BASIC_CPUID, 0); @@ -172,3 +173,4 @@ char *igt_x86_features_to_string(unsigned features, char *line) return ret; } +#endif diff --git a/lib/igt_x86.h b/lib/igt_x86.h index d6dcfa108331..27b7f0fd5837 100644 --- a/lib/igt_x86.h +++ b/lib/igt_x86.h @@ -40,7 +40,7 @@ #define AVX 0x80 #define AVX2 0x100 -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__i386__) unsigned igt_x86_features(void); char *igt_x86_features_to_string(unsigned features, char *line); #else diff --git a/lib/meson.build b/lib/meson.build index 42919eef52a8..e89d4bdf8278 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -56,6 +56,7 @@ lib_sources = [ 'igt_stats.c', 'igt_sysfs.c', 'igt_vgem.c', + 'igt_x86.c', 'instdone.c', 'intel_batchbuffer.c', 'intel_chipset.c', @@ -88,10 +89,6 @@ lib_sources = [ 'igt_kmod.c', ] -if ['x86', 'x86_64'].contains(host_machine.cpu_family()) - lib_sources += 'igt_x86.c' -endif - lib_deps = [ cairo, glib,