summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rules.mak7
-rwxr-xr-xextra/scripts/initfini.awk121
-rw-r--r--libc/sysdeps/linux/common/Makefile48
3 files changed, 1 insertions, 175 deletions
diff --git a/Rules.mak b/Rules.mak
index 3b5515add..469427b30 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -79,13 +79,6 @@ endif
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
then echo "$(1)"; else echo "$(2)"; fi)
-# check if we have nawk, otherwise user awk
-AWK:=$(shell if [ -x /usr/bin/nawk ]; then echo "/usr/bin/nawk"; \
- else if [ -x /usr/bin/awk ]; then echo "/usr/bin/awk"; \
- else if [ -x /bin/awk ]; then echo "/bin/awk"; \
- else echo "awk"; fi; fi; fi)
-
-
# Make certain these contain a final "/", but no "//"s.
RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
diff --git a/extra/scripts/initfini.awk b/extra/scripts/initfini.awk
deleted file mode 100755
index ac7c034a4..000000000
--- a/extra/scripts/initfini.awk
+++ /dev/null
@@ -1,121 +0,0 @@
-#! /usr/bin/awk -f
-# Contributed by Christian MICHON <christian_michon@yahoo.fr> to
-# eliminate the compile time dependancy on perl introduced by
-# Erik's older initfini.pl
-# vim:ai:sw=2:
-
-BEGIN \
-{ alignval="";
- endp=0;
- end=0;
- system("touch crt[in].S");
- system("/bin/rm -f crt[in].S");
- omitcrti=0;
- omitcrtn=0;
- glb_idx = 0;
- while(getline < "initfini.S")
- { if(/\.endp/) {endp=1}
- if(/\.end/) {end=1}
- if(/\.align/) {alignval=$2}
-# here comes some special stuff for the SuperH targets
-# We search for all labels, which uses the _GLOBAL_OFFSET_TABLE_
-# or a call_gmon_start function reference, and store
-# them in the glb_label array.
- if(/_init_EPILOG_BEGINS/) {glb_idx=1;glb_idx_arr[glb_idx]=0}
- if(/_fini_EPILOG_BEGINS/) {glb_idx=2;glb_idx_arr[glb_idx]=0}
- if(/EPILOG_ENDS/) {glb_idx=0}
- if(/_GLOBAL_OFFSET_TABLE_/||/call_gmon_start/) {
- glb_label[glb_idx,glb_idx_arr[glb_idx]] = last;
- glb_idx_arr[glb_idx] += 1;
- glb_label[glb_idx,glb_idx_arr[glb_idx]] = $0;
- glb_idx_arr[glb_idx] += 1;
- }
- last = $1;
- }
- close("initfini.S");
-}
-# special rules for the SuperH targets (They do nothing on other targets)
-/SH_GLB_BEGINS/ && glb_idx_arr[1]==0 && glb_idx_arr[2]==0 {omitcrti +=1}
-/_init_SH_GLB/ {glb_idx=1}
-/_fini_SH_GLB/ {glb_idx=2}
-/SH_GLB_ENDS/ {omitcrti -=1}
-/SH_GLB/ \
-{
- if (glb_idx>0)
- {
- for (i=0;i<glb_idx_arr[glb_idx];i+=1) {
- print glb_label[glb_idx,i] >> "crti.S";
- }
- glb_idx = 0;
- }
- next;
-}
-# special rules for H8/300 (sorry quick hack)
-/.h8300h/ {end=0}
-
-# rules for all targets
-/HEADER_ENDS/{omitcrti=1;omitcrtn=1;getline}
-/PROLOG_BEGINS/{omitcrti=0;omitcrtn=0;getline}
-/i_am_not_a_leaf/{getline}
-/_init:/||/_fini:/{omitcrtn=1}
-/PROLOG_PAUSES/{omitcrti=1;getline}
-/PROLOG_UNPAUSES/{omitcrti=0;getline}
-/PROLOG_ENDS/{omitcrti=1;getline}
-/EPILOG_BEGINS/{omitcrtn=0;getline}
-/EPILOG_ENDS/{omitcrtn=1;getline}
-/TRAILER_BEGINS/{omitcrti=0;omitcrtn=0;getline}
-/GMON_STUFF_BEGINS/{omitcrtn=1;getline}
-/GMON_STUFF_PAUSES/{omitcrtn=0;getline}
-/GMON_STUFF_UNPAUSES/{omitcrtn=1;getline}
-/GMON_STUFF_ENDS/{omitcrtn=0;getline}
-
-/_GLOBAL_OFFSET_TABLE_/||/gmon_start/ \
-{
- if(omitcrti==0) {print >> "crti.S";}
- next; # no gmon_start or GLOBAL_OFFSET_TABLE references in crtn.S
-}
-
-/END_INIT/ \
-{ if(endp)
- { gsub("END_INIT",".endp _init",$0)
- }
- else
- { if(end)
- { gsub("END_INIT",".end _init",$0)
- }
- else
- { gsub("END_INIT","",$0)
- }
- }
-}
-
-/END_FINI/ \
-{ if(endp)
- { gsub("END_FINI",".endp _fini",$0)
- }
- else
- { if(end)
- { gsub("END_FINI",".end _fini",$0)
- }
- else
- { gsub("END_FINI","",$0)
- }
- }
-}
-
-/ALIGN/ \
-{ if(alignval!="")
- { gsub("ALIGN",sprintf(".align %s",alignval),$0)
- }
- else
- { gsub("ALIGN","",$0)
- }
-}
-
-omitcrti==0 {print >> "crti.S"}
-omitcrtn==0 {print >> "crtn.S"}
-
-END \
-{ close("crti.S");
- close("crtn.S");
-}
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index c08efc8b1..98d119a6a 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -38,30 +38,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
MSRC=syscalls.c
MOBJ=$(shell ./list_syscalls.sh)
-CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
-SAFECFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) -fno-builtin
-#
-# on SH4 addition of -g kills the initfini stuff, removed here for all
-# platforms as I suspect no one want initfini compiled -g :-) - davidm
-#
-SAFECFLAGS := $(filter-out -g,$(SAFECFLAGS))
-ifeq ($(strip $(DOPIC)),y)
-SAFECFLAGS+=$(PICFLAG)
-endif
-ifeq ($(strip $(UCLIBC_PROFILING)),y)
-SAFECFLAGS+=-DGMON_SUPPORT
-endif
-ifeq ($(strip $(UCLIBC_HAS_SOFT_FLOAT)),y)
-SAFECFLAGS += $(call check_gcc,-msoft-float,)
-endif
-
OBJ=$(COBJS) $(MOBJ)
all: $(STR_SYSCALLS) $(OBJ) $(LIBC)
$(LIBC): ar-target
-ar-target: $(OBJ) $(CTOR_TARGETS)
+ar-target: $(OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJ)
$(MOBJ): $(MSRC)
@@ -72,35 +55,6 @@ $(COBJS): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
-ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-initfini.S: initfini.c
- $(CC) $(SAFECFLAGS) -I$(TOPDIR)include -c initfini.c -S -o initfini.S
-
-crti.S crtn.S: initfini.S $(TOPDIR)/extra/scripts/initfini.awk
- $(AWK) -f $(TOPDIR)extra/scripts/initfini.awk initfini.S
-
-crti.o: crti.S
- $(CC) $(SAFECFLAGS) -c crti.S -o crti.o
-
-$(TOPDIR)lib/crti.o: crti.o
- $(INSTALL) -d $(TOPDIR)lib/
- cp crti.o $(TOPDIR)lib/
-
-crtn.o: crtn.S
- $(CC) $(SAFECFLAGS) -c crtn.S -o crtn.o
-
-$(TOPDIR)lib/crtn.o: crtn.o
- $(INSTALL) -d $(TOPDIR)lib/
- cp crtn.o $(TOPDIR)lib/
-else
-$(TOPDIR)lib/crti.o:
- $(INSTALL) -d $(TOPDIR)lib/
- $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
-$(TOPDIR)lib/crtn.o:
- $(INSTALL) -d $(TOPDIR)lib/
- $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
-endif
-
headers:
$(LN) -fs ../libc/sysdeps/linux/common/fpu_control.h $(TOPDIR)/include/