summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/arm/Makefile')
-rw-r--r--libc/sysdeps/linux/arm/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile
index c6505c93c..4b23adae7 100644
--- a/libc/sysdeps/linux/arm/Makefile
+++ b/libc/sysdeps/linux/arm/Makefile
@@ -25,7 +25,14 @@ include $(TOPDIR)Rules.mak
LIBC=$(TOPDIR)libc.a
ASFLAGS=$(CFLAGS)
-CRT0=crt0.S
+TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
+
+ifeq ($(TARGET_MACHINE_TYPE),arm-pic-elf)
+ CRT0=crt0pic.S
+else
+ CRT0=crt0.S
+endif
+
CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
SSRC=longjmp.S setjmp.S
@@ -43,7 +50,7 @@ $(LIBC): ar-target
ar-target: $(OBJS) $(CRT0_OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
- cp $(CRT0_OBJ) $(TOPDIR)$(CRT0_OBJ)
+ cp $(CRT0_OBJ) $(TOPDIR)crt0.o
$(CRT0_OBJ): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@