although NDK r7 has brought us some reduction of the command line
length, we're still facing it with our current build setup. One way
would be to split the project into several static libraries, but our
cross-platform project generator toolchain we're using would be much
more complicated and debugging probably too. I wonder why the NDK does
not create a text file with the object file names and use this with
the @file option of g++. This way the 32k command line length
limitation under windows with the CreateProcess call of make(?) would
not be a limit to us and I guess many others. I tried it by copying
the arguments from the output window into a text file and a batch file
and it seem to work flawlessly but unfortunately I'm not familiar with
GNU Make so that I would be able to change the NDK toolchain to create
such a separate text file containing the $(PRIVATE_OBJECTS) (?) and
add this file using the @ option of g++.
Can anybody help me out, or even better can the NDK r8 may change this
to the default toolchain behaviour?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
ndk/build/core/build-binary.mk
toolchains/arm-linux-androideabi-4.4.3/setup.mk
--- android-ndk-r7/build/core/build-binary_original.mk Mi Nov 23
18:52:03 2011
+++ android-ndk-r7/build/core/build-binary.mk Mi Nov 23 11:55:16 2011
@@ -304,13 +304,21 @@
ALL_STATIC_LIBRARIES += $(LOCAL_BUILT_MODULE)
endif
+# $1 script, $2 filespec
+define WRITE_CMD
+@ $(HOST_ECHO) -n "$(2) " >> $(1)
+
+endef # keep blank line above
+
#
# If this is a shared library module
#
ifeq ($(call module-get-class,$(LOCAL_MODULE)),SHARED_LIBRARY)
$(LOCAL_BUILT_MODULE): $(LOCAL_OBJECTS)
@ $(call host-mkdir,$(dir $@))
- @ $(HOST_ECHO) "SharedLibrary : $(PRIVATE_NAME)"
+ @ $(HOST_ECHO) "SharedLibrary : $(PRIVATE_NAME)"
+ $(hide) $(HOST_ECHO) -n > objects.txt
+ $(hide) $(foreach ofile,$(PRIVATE_OBJECTS), $(call
WRITE_CMD,objects.txt,$(ofile)))
$(hide) $(cmd-build-shared-library)
ALL_SHARED_LIBRARIES += $(LOCAL_BUILT_MODULE)
--- android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/
setup_original.mk Mi Nov 23 18:51:49 2011
+++ android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/setup.mk Mi
Nov 23 10:34:53 2011
@@ -122,7 +122,7 @@
-Wl,-soname,$(notdir $@) \
-shared \
--sysroot=$(call host-path,$(PRIVATE_SYSROOT)) \
- $(call host-path, $(PRIVATE_OBJECTS)) \
+ $(call host-path, @objects.txt) \
$(call link-whole-archives,$(PRIVATE_WHOLE_STATIC_LIBRARIES)) \
$(call host-path,\
$(PRIVATE_STATIC_LIBRARIES) \
It does not include all the other build targets and is slowing down
the build process a bit because of the many calls to WRITE_CMD
but it works.
Would be nice if a clean solution may find its way to the next NDK
release.
On 23 Nov., 11:55, David Turner <di...@android.com> wrote:
> Hello Volker,
>
$(hide) $(foreach object, $(call host-path, $(PRIVATE_OBJECTS)), echo
'$(object)' >> $(linkargs); )
$(hide) echo \
$(call link-whole-archives,$(PRIVATE_WHOLE_STATIC_LIBRARIES)) \
$(call host-path,\
$(PRIVATE_STATIC_LIBRARIES) \
$(PRIVATE_LIBGCC) \
$(PRIVATE_SHARED_LIBRARIES)) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_LDLIBS) \
-o $(call host-path,$@) \
>> $(linkargs)
$(hide) $(PRIVATE_CXX) @$(linkargs)
endef
################################################################
P.S.
you can use this way with r6 too, but be careful to not miss -lsupc++
linker option (it gone with r7)