X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=e23a8332f5e1e4a64e8b88bb5eecabbe465e9b2c;hb=165a1e37a570422c3f3f816a734bfea0366982e5;hp=3e656d26716ad1937e8de032667e0263ca978ab1;hpb=157e28492a287907fb6f3d39894c2c1b84122b51;p=musl diff --git a/Makefile b/Makefile index 3e656d26..e23a8332 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,9 @@ CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS)) AOBJS = $(LIBC_OBJS) LOBJS = $(LIBC_OBJS:.o=.lo) -GENH = obj/include/bits/alltypes.h +GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h GENH_INT = obj/src/internal/version.h -IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h) +IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h) LDFLAGS = LDFLAGS_AUTO = @@ -62,7 +62,7 @@ ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES: EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a) -CRT_LIBS = lib/crt1.o lib/Scrt1.o lib/rcrt1.o lib/crti.o lib/crtn.o +CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS))) STATIC_LIBS = lib/libc.a SHARED_LIBS = lib/libc.so TOOL_LIBS = lib/musl-gcc.specs @@ -96,6 +96,10 @@ $(OBJ_DIRS): obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@ +obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in + cp $< $@ + sed -n -e s/__NR_/SYS_/p < $< >> $@ + obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git) printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@ @@ -109,24 +113,17 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC -obj/crt/$(ARCH)/crti.o: $(srcdir)/crt/$(ARCH)/crti.s - -obj/crt/$(ARCH)/crtn.o: $(srcdir)/crt/$(ARCH)/crtn.s - OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 -MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c -$(MEMOPS_SRCS:%.c=obj/%.o) $(MEMOPS_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS) - -NOSSP_SRCS = $(wildcard crt/*.c) \ - src/env/__libc_start_main.c src/env/__init_tls.c \ - src/env/__stack_chk_fail.c \ - src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \ - src/string/memset.c src/string/$(ARCH)/memset.c \ - src/string/memcpy.c src/string/$(ARCH)/memcpy.c \ - ldso/dlstart.c ldso/dynlink.c -$(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) +MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS)) +$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS) + +NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \ + %/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \ + %/__set_thread_area.o %/memset.o %/memcpy.o \ + , $(LIBC_OBJS)) +$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) $(CRT_OBJS): CFLAGS_ALL += -DCRT