Submitted By: Robert Connolly (ashes) Date: 2005-02-04 Initial Package Version: 4.12 Upstream Status: Not submitted Origin: None Description: Add gcc -fpie, -fpic, and ld -pie, -z relro, -z now. File uses an undistributed non-standard set of m4 macro's, so I can't make a decent patch for configure. See: http://www.linuxfromscratch.org/~robert/Homogenic/ --- file-4.12.orig/src/Makefile.in 2005-02-04 05:06:13.746811808 +0000 +++ file-4.12/src/Makefile.in 2005-02-04 05:28:25.348046568 +0000 @@ -90,6 +90,8 @@ EXTRA_DIST = test.c bin_PROGRAMS = file +file_CFLAGS = -pie -fpie +file_LDFLAGS = -pie -z relro -z now AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' @@ -97,7 +99,7 @@ compress.c is_tar.c readelf.c print.c fsmagic.c \ funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c -libmagic_la_LDFLAGS = -version-info 1:0:0 +libmagic_la_LDFLAGS = -version-info 1:0:0 -z relro -z now file_SOURCES = file.c file_LDADD = libmagic.la @@ -115,10 +117,9 @@ bin_PROGRAMS = file$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_file_OBJECTS = file.$(OBJEXT) +am_file_OBJECTS = file-file.$(OBJEXT) file_OBJECTS = $(am_file_OBJECTS) file_DEPENDENCIES = libmagic.la -file_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -129,7 +130,7 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/apprentice.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/apptype.Plo ./$(DEPDIR)/ascmagic.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/compress.Plo ./$(DEPDIR)/file.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/compress.Plo ./$(DEPDIR)/file-file.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fsmagic.Plo ./$(DEPDIR)/funcs.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/is_tar.Plo ./$(DEPDIR)/magic.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/print.Plo ./$(DEPDIR)/readelf.Plo \ @@ -216,6 +217,7 @@ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done +file-file.$(OBJEXT): file.c file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) @rm -f file$(EXEEXT) $(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS) @@ -230,7 +232,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apptype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascmagic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compress.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsmagic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/funcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_tar.Plo@am__quote@ @@ -259,6 +261,24 @@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +file-file.o: file.c +@AMDEP_TRUE@ source='file.c' object='file-file.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/file-file.Po' tmpdepfile='$(DEPDIR)/file-file.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(file_CFLAGS) $(CFLAGS) -c -o file-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c + +file-file.obj: file.c +@AMDEP_TRUE@ source='file.c' object='file-file.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/file-file.Po' tmpdepfile='$(DEPDIR)/file-file.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(file_CFLAGS) $(CFLAGS) -c -o file-file.obj `cygpath -w file.c` + +file-file.lo: file.c +@AMDEP_TRUE@ source='file.c' object='file-file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/file-file.Plo' tmpdepfile='$(DEPDIR)/file-file.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(file_CFLAGS) $(CFLAGS) -c -o file-file.lo `test -f 'file.c' || echo '$(srcdir)/'`file.c CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: