From 5e0e2739c95093a2702ea108ec49d7cce8d4bcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 30 Sep 2013 00:37:06 +0200 Subject: [PATCH] ARM: work around too many libgcc objects when linking libroot jam fails in execve() trying to run the command due to a too large arguments list because of the many objects in libgcc. We split them into two intermediate objects, then we link them to libroot. --- src/system/libroot/Jamfile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/Jamfile b/src/system/libroot/Jamfile index 719da31815..9a5991b2d8 100644 --- a/src/system/libroot/Jamfile +++ b/src/system/libroot/Jamfile @@ -14,6 +14,32 @@ for architectureObject in [ MultiArchSubDirSetup ] { # we need to link against libgcc.a objects and make # it available to other applications as in BeOS + # workaround for ARM having waaaaay too many objects in libgcc + # which fails execve() with too large argument list + # when linking them directly into libroot. + local libgccObjects1 = + $(HAIKU_GCC_LIBGCC_OBJECTS_$(architecture)[1-800]) ; + local libgccObjects2 = + $(HAIKU_GCC_LIBGCC_OBJECTS_$(architecture)[801-]) ; + + local librootLibgccObjects = + <$(architecture)>libgcc_part1_$(TARGET_ARCH).o ; + + MergeObject <$(architecture)>libgcc_part1_$(TARGET_ARCH).o : + : + $(libgccObjects1) + ; + + if $(libgccObjects2) { + librootLibgccObjects += + <$(architecture)>libgcc_part2_$(TARGET_ARCH).o ; + + MergeObject <$(architecture)>libgcc_part2_$(TARGET_ARCH).o : + : + $(libgccObjects2) + ; + } + local librootObjects = os_main.o os_arch_$(TARGET_ARCH).o @@ -70,7 +96,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { : libroot_init.c : - $(HAIKU_GCC_LIBGCC_OBJECTS_$(architecture)) + $(librootLibgccObjects) $(librootObjects) $(librootNoDebugObjects) $(HAIKU_STATIC_LIBSUPC++_$(architecture)) @@ -84,7 +110,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { : libroot_init.c : - $(HAIKU_GCC_LIBGCC_OBJECTS_$(architecture)) + $(librootLibgccObjects) $(librootObjects) $(librootDebugObjects) $(HAIKU_STATIC_LIBSUPC++_$(architecture))