X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Makerules;h=05d9548cb408be344406df9de5d27316d37f65be;hb=143b7505a2cc505e94bde9b82cad4f695d15433d;hp=7153836cfce9bb0b4a155de95991ec39c9631b03;hpb=26242d9e53bcb0997000aa2a50c6c9a72f92541d;p=uclinux-h8%2FuClibc.git diff --git a/Makerules b/Makerules index 7153836cf..05d9548cb 100644 --- a/Makerules +++ b/Makerules @@ -50,6 +50,10 @@ all_objs: $(ar_objs) endif $(shared_objs) $(ar_objs): | $(sub_headers) +define objects_with_syms + $(foreach o,$(2),$(if $(shell $(NM) $(1) $(o) | grep .),$(o))) +endef + headers-y: $(headers-y) @true @@ -236,14 +240,14 @@ cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \ cmd_compile.i = $(cmd_compile.c:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS) cmd_compile.s = $(cmd_compile.c:-c=-S) cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep) -cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@)) +cmd_compile.S = $(filter-out -std=%, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@)) cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@)) cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS) cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags))) cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^ cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@ -cmd_ar = $(AR) $(ARFLAGS) $@ $^ +cmd_ar = $(AR) $(ARFLAGS) $@ $(call objects_with_syms,,$^) define do_ln @$(disp_ln) @@ -299,8 +303,8 @@ define create-lds $(Q)$(CC) -nostdlib -nostartfiles -shared -Wl,-z,combreloc \ -Wl,-z,relro -Wl,--hash-style=gnu -Wl,-z,defs \ -Wl,--verbose 2>&1 | LC_ALL=C \ - sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' > $@.lds + $(SED) -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/\. = .* + SIZEOF_HEADERS;/& $(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds endef define link.so @@ -373,14 +377,9 @@ $(top_builddir)%.dep: $(top_builddir)lib/interp.c: | $(top_builddir)lib $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@.tmp $(Q)echo "#include " >> $@.tmp -ifeq ($(HARDWIRED_ABSPATH),y) $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \ "(\".interp\"))) =\""$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO)"\";" >> $@.tmp $(Q)$(SED) -i -e 's://:/:g' $@.tmp -else - $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \ - "(\".interp\"))) =\""$(UCLIBC_LDSO)"\";" >> $@.tmp -endif $(Q)mv $@.tmp $@ $(interp): $(top_builddir)lib/interp.c | $(sub_headers) @@ -470,6 +469,8 @@ files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \ $(libm-a-y) $(libm-so-y) \ $(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y) \ $(libthread_db-a-y) $(libthread_db-so-y) $(libpthread-generated-y) \ + $(START_FILE-libpthread.so) $(END_FILE-libpthread.so) \ + $(PTHREAD_INITFINI:.c=.s) \ $(librt-a-y) $(librt-so-y) $(libresolv-a-y) $(libresolv-so-y) \ $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \ $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \