* [PATCH i-g-t v2] gem_largeobject: Fix for clang compiler
@ 2016-08-04 14:37 Derek Morton
2016-08-10 8:30 ` Morton, Derek J
0 siblings, 1 reply; 2+ messages in thread
From: Derek Morton @ 2016-08-04 14:37 UTC (permalink / raw)
To: intel-gfx
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>
---
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);
}
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH i-g-t v2] gem_largeobject: Fix for clang compiler
2016-08-04 14:37 [PATCH i-g-t v2] gem_largeobject: Fix for clang compiler Derek Morton
@ 2016-08-10 8:30 ` Morton, Derek J
0 siblings, 0 replies; 2+ messages in thread
From: Morton, Derek J @ 2016-08-10 8:30 UTC (permalink / raw)
To: intel-gfx
Bump,
Can this be merged? It is a simple fix for an issue with the clang compiler.
//Derek
-----Original Message-----
From: Morton, Derek J
Sent: Thursday, August 4, 2016 3:37 PM
To: intel-gfx@lists.freedesktop.org
Cc: Gore, Tim <tim.gore@intel.com>; Morton, Derek J <derek.j.morton@intel.com>
Subject: [PATCH i-g-t v2] 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>
---
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);
}
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-10 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 14:37 [PATCH i-g-t v2] gem_largeobject: Fix for clang compiler Derek Morton
2016-08-10 8:30 ` Morton, Derek J
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.