Skip to contentSkip to conversation

gem_largeobject: Fix for clang compiler

PATCH Superseded Derek Morton 1 participant 1 message Aug 4, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tests/gem_largeobject.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/gem_largeobject.c +4 -1
index c001c17..4f323bb 100644
@@ -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)
@@ -77,6 +77,9 @@ igt_simple_main
 {
 	int fd;
 
+	data = malloc(OBJ_SIZE);
+	igt_assert(data);
+
 	igt_skip_on_simulation();
 
 	fd = drm_open_driver(DRIVER_INTEL);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx