From 5fe8fc1ac4b5eb0f9e9bb01295c14b99d80ab41e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 31 Mar 2015 22:44:22 +0200 Subject: buildsys: Do not build crt upon pregen No need to build crt when just generating headers Signed-off-by: Bernhard Reutner-Fischer --- Makerules | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index fd6bb190d..10dc5298f 100644 --- a/Makerules +++ b/Makerules @@ -22,9 +22,9 @@ ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y) libs: $(lib-gdb-y) endif libs: $(lib-a-y) -$(lib-a-y): | $(top_builddir)lib endif objs: all_objs +$(lib-so-y) $(lib-a-y): | $(top_builddir)lib # apply unconditional per-directory flags define add_IS_IN_lib @@ -451,18 +451,18 @@ CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-dire $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c | $(top_builddir)lib $(compile.c) -$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s | $(top_builddir)lib - $(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ - gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp +$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s + $(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ + $(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp $(Q)mv $@.tmp $@ $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h - $(Q)sed -n -e '1,/@HEADER_ENDS/p' \ + $(do_sed) -n -e '1,/@HEADER_ENDS/p' \ -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \ -e '/@TRAILER_BEGINS/,$$p' $< > $@ $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s - $(Q)sed -n -e '1,/@HEADER_ENDS/p' \ + $(do_sed) -n -e '1,/@HEADER_ENDS/p' \ -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \ -e '/@TRAILER_BEGINS/,$$p' $< > $@ @@ -482,9 +482,10 @@ CRTS_COMPAT := #endif startfiles = $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) -$(crt-y): $(startfiles) +startfiles: $(startfiles) $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers -$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES) : | $(top_builddir)lib +$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) \ + $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES): | $(top_builddir)lib $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y) $(Q)$(RM) $@ -- cgit v1.2.3 From 1df50b08dfe4133d306156483a224f5a478f7dff Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 14 Apr 2015 23:58:41 +0200 Subject: prelink: handle _begin in a gold-agnostic way The nostartfiles is redundant but better be safe Signed-off-by: Bernhard Reutner-Fischer --- Makerules | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index 10dc5298f..dd19cea79 100644 --- a/Makerules +++ b/Makerules @@ -326,22 +326,13 @@ endef cmd_hcompile.u = $(HOSTCC) $(filter-out $(PHONY),$^) $(DEPS-$(notdir $@)) -o $@ $(BUILD_LDFLAGS) $(BUILD_LDFLAGS-$(notdir $(^D))) $(BUILD_LDFLAGS-$(notdir $@)) $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@)) cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@)) -define create-lds - $(Q)$(RM) $@.lds - $(Q)$(CC) $(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) \ - -nostdlib -nostartfiles -shared -Wl,-z,combreloc \ - -Wl,-z,relro $(CFLAG_-Wl--hash-style=gnu) -Wl,-z,defs \ - -x c /dev/null -Wl,--verbose 2>&1 | LC_ALL=C \ - $(SED) -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/^\([ ]*\)\. = .* + SIZEOF_HEADERS;/&\n\1$(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds -endef - define link.so $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1) @$(disp_ld) $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(LDFLAGS-y-$(@F)) \ -Wl,-soname=$(notdir $@).$(2) \ - $(CFLAG_-nostdlib) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ + $(CFLAG_-nostdlib) $(CFLAG_-nostartfiles) \ + -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@)) $(Q)$(LN) -sf $(1) $@.$(2) -- cgit v1.2.3