diff options
author | Derek Morton <derek.j.morton@intel.com> | 2016-08-04 15:37:23 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-08-10 12:06:32 +0200 |
commit | 904aa908b0afb7fedad9c8349474277066e2130d (patch) | |
tree | 9080d3be339af0766f941719fbc47774ca1224bc /tests/gem_largeobject.c | |
parent | 48df4f23b3066d546c271997490f6e3acea70c02 (diff) |
gem_largeobject: Fix for clang compiler
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 <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_largeobject.c')
-rw-r--r-- | tests/gem_largeobject.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c index c001c17f..518396fa 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); } |