Browse Source

touchup PIE support for all the utils and fix stripping on iconv

Mike Frysinger 20 years ago
parent
commit
ef8c7a93f9
1 changed files with 8 additions and 3 deletions
  1. 8 3
      utils/Makefile

+ 8 - 3
utils/Makefile

@@ -46,22 +46,27 @@ readelf: readelf.c
 	$(CC) $(CFLAGS) $^ -o $@
 	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
+ifeq ($(strip $(UCLIBC_STATIC_LDCONFIG)),y)
+LDCONFIG_CFLAGS := -static
+else
+LDCONFIG_CFLAGS := $(PIEFLAG) $(LDPIEFLAG)
+endif
 ldconfig: ldconfig.c
-	$(CC) $(CFLAGS) $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
+	$(CC) $(CFLAGS) $(LDCONFIG_CFLAGS) \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
 	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 ldd: ldd.c
-	$(CC) $(CFLAGS) $(PIEFLAG) \
+	$(CC) $(CFLAGS) $(PIEFLAG) $(LDPIEFLAG) \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
 	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 iconv: ../libc/misc/wchar/wchar.c
-	$(CC) $(CFLAGS) $(PIEFLAG) -Wl,-s \
+	$(CC) $(CFLAGS) $(PIEFLAG) $(LDPIEFLAG) \
 		-DL_iconv_main \
 		$^ -o $@
 	$(STRIPTOOL) -s -x -R .note -R .comment $@