From patchwork Thu Aug 4 14:37:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 9263747 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 B245760754 for ; Thu, 4 Aug 2016 14:37:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A42D3283E1 for ; Thu, 4 Aug 2016 14:37:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 988A928405; Thu, 4 Aug 2016 14:37:33 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89182283E1 for ; Thu, 4 Aug 2016 14:37:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 818DB6E05F; Thu, 4 Aug 2016 14:37:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id B28936E05F for ; Thu, 4 Aug 2016 14:37:27 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 04 Aug 2016 07:37:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,470,1464678000"; d="scan'208";a="744167841" Received: from djmorton-linux2.isw.intel.com ([10.102.226.90]) by FMSMGA003.fm.intel.com with ESMTP; 04 Aug 2016 07:37:26 -0700 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Thu, 4 Aug 2016 15:37:23 +0100 Message-Id: <1470321443-15671-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH i-g-t v2] gem_largeobject: Fix for clang compiler 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 The clang compiler generates a build error for binaries with >128MB data segments because "The gap between stack and binary is only guarenteed to be 128MB on x86_64" Simple solution is to allocate the required memory from the heap. [v2: moved malloc to after skip_on_simulation] Signed-off-by: Derek Morton --- tests/gem_largeobject.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c index c001c17..518396f 100644 --- a/tests/gem_largeobject.c +++ b/tests/gem_largeobject.c @@ -39,7 +39,7 @@ /* Should take 64 pages to store the page pointers on 64 bit */ #define OBJ_SIZE (128 * 1024 * 1024) -unsigned char data[OBJ_SIZE]; +unsigned char *data; static void test_large_object(int fd) @@ -79,7 +79,12 @@ igt_simple_main igt_skip_on_simulation(); + data = malloc(OBJ_SIZE); + igt_assert(data); + fd = drm_open_driver(DRIVER_INTEL); test_large_object(fd); + + free(data); }