svn commit: trunk/uClibc: libc libc/misc/internals
bernds at uclibc.org
bernds at uclibc.org
Fri Nov 23 18:02:13 UTC 2007
Author: bernds
Date: 2007-11-23 10:02:12 -0800 (Fri, 23 Nov 2007)
New Revision: 20510
Log:
Some shared flat improvements.
Fix minor errors:
- UCLIBC_SHARED_FLAT_ID instead of SHARED_FLAT_ID
- use -Wl,-shared-lib-id properly
Use libc_so.a as the source for the shared libc, in order to be able to
use -mleaf-id-shared-library on the Blackfin.
Modified:
trunk/uClibc/Makerules
trunk/uClibc/libc/Makefile.in
trunk/uClibc/libc/misc/internals/Makefile.in
Changeset:
Modified: trunk/uClibc/Makerules
===================================================================
--- trunk/uClibc/Makerules 2007-11-23 17:57:32 UTC (rev 20509)
+++ trunk/uClibc/Makerules 2007-11-23 18:02:12 UTC (rev 20510)
@@ -146,14 +146,17 @@
# Argument 1 is the shared library file -- i.e. $(@:.gdb=) -- and argument 2
# is the shared library identifier. If it wasn't for $(disp_ld), we could
# avoid passing $(@:.gdb=) as an argument and use $(@:.gdb=) instead of $(1).
+#
+# This is so far only used for libc, for which we want to link the entire
+# libgcc into the shared object.
define link-flat.so
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $(1) $@
@$(disp_ld)
$(Q)$(CC) $(LDFLAGS-$(notdir $@)) -nostdlib -o $(1) \
- -Wl,-elf2flt -Wl,-shared-lib-id $(2) $(top_builddir)lib/Scrt1.o \
+ -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \
$(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \
- -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
+ $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
$(top_builddir)/lib/crtn.o
endef
Modified: trunk/uClibc/libc/Makefile.in
===================================================================
--- trunk/uClibc/libc/Makefile.in 2007-11-23 17:57:32 UTC (rev 20509)
+++ trunk/uClibc/libc/Makefile.in 2007-11-23 18:02:12 UTC (rev 20510)
@@ -93,8 +93,11 @@
$(do_strip)
$(do_ar)
-$(top_builddir)lib/libc.gdb: $(top_builddir)lib/libc.a $(LINK_FLAT_CRTS)
- $(call link-flat.so,$(@:.gdb=),$(SHARED_FLAT_ID))
+# We use libc_so.a so that we can compile the shared library with special
+# flags - i.e. -mleaf-id-shared-library. The static libc.a needs to be
+# compiled without it.
+$(top_builddir)lib/libc.gdb: $(libc_OUT)/libc_so.a $(LINK_FLAT_CRTS)
+ $(call link-flat.so,$(@:.gdb=),$(UCLIBC_SHARED_FLAT_ID))
libc_clean:
$(RM) $(libc_OUT)/*.{o,os,oS,a}
Modified: trunk/uClibc/libc/misc/internals/Makefile.in
===================================================================
--- trunk/uClibc/libc/misc/internals/Makefile.in 2007-11-23 17:57:32 UTC (rev 20509)
+++ trunk/uClibc/libc/misc/internals/Makefile.in 2007-11-23 18:02:12 UTC (rev 20510)
@@ -16,11 +16,18 @@
MISC_INTERNALS_OBJ := $(patsubst %.c,$(MISC_INTERNALS_OUT)/%.o,$(CSRC))
libc-y += $(MISC_INTERNALS_OBJ)
+ifneq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
libc-shared-y += $(MISC_INTERNALS_OUT)/__uClibc_main.oS
+else
+libc-shared-y += $(MISC_INTERNALS_OUT)/__uClibc_main.os
+endif
libc-static-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o
libc-static-$(UCLIBC_FORMAT_SHARED_FLAT) += \
$(MISC_INTERNALS_OUT)/shared_flat_initfini.o \
$(MISC_INTERNALS_OUT)/shared_flat_add_library.o
+libc-shared-$(UCLIBC_FORMAT_SHARED_FLAT) += \
+ $(MISC_INTERNALS_OUT)/shared_flat_initfini.os \
+ $(MISC_INTERNALS_OUT)/shared_flat_add_library.os
libc-nomulti-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o
objclean-y += misc_internals_objclean
More information about the uClibc-cvs
mailing list