[uClibc] Re: buildroot: Installing libstdc++ libgcc_s

Tim Connors connors at hpl.hp.com
Fri Sep 24 16:20:53 UTC 2004


Summary:
	libgcc_s and libstdc++ don't appear to be handled symmetrically.


I'd like to build a uClibc system (on i386 for ARM) which can run C++
programs.  So, in the top level Makefile, I tried

	INSTALL_LIBSTDCPP:=true

To my delight, the c++ toolchain is built.  However, neither libstdc++
nor libsupc++ are installed anywhere in

	./build_$(ARCH)/root/

OTOH, if you also specify

	TARGETS+=gcc_target

you will get the c++ libs installed in root (what I want) along with a
complete toolchain (which I don't need, it's too big).  Specifying
gcc_target supplies the desired libs since one of the make dependents
for gcc_target executes

	make ... DESTDIR=$(TARGET_DIR) ... install

This is also what causes the complete toolchain to be installed in root.

After figuring that out, I noticed that a similar situation occurs for
straight C and libgcc_s.  How does libgcc_s get installed in root
without specifying gcc_target??  The answer is that libgcc_s is an
explicit make dependent of the target gcc.  The build commands for
this explicit dependent hand copy libgcc_s to the root file system.
Voila!

So it seems to me that there needs to be some explicit make dependent
of gcc (in the case c++ is requested) which will hand copy the c++ libs
to ./build_$(ARCH)/root/.

I tried the following in ./make/gcc-uclibc-3.x.mk.  It appearred to
work.  Am I on the right track and if so, can something like this be
added to the official source?


ifeq ($(INSTALL_LIBSTDCPP),true)
gcc: $(TARGET_DIR)/lib/libstdc++.so.6

$(TARGET_DIR)/lib/libstdc++.so.6: $(GCC_BUILD_DIR2)/.installed
	# These are in /lib, so...
	rm -rf $(TARGET_DIR)/usr/lib/libstdc++.so*
	-$(STRIP) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++.so.6
	-cp -a $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++.so* $(TARGET_DIR)/lib/
endif


Thanks,
-Tim



More information about the uClibc mailing list