From d377ca26b3a4b1d4ca6f7b309faa52797975f2d4 Mon Sep 17 00:00:00 2001 From: Chris E Ferron Date: Mon, 12 Nov 2012 14:34:22 -0800 Subject: [PATCH] fusermount-compile-as-pie --- util/Makefile.am | 2 ++ util/Makefile.in | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/util/Makefile.am b/util/Makefile.am index 059d5fc..acd7bf3 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -10,6 +10,8 @@ noinst_PROGRAMS = mount.fuse # copying it over. fusermount_SOURCES = fusermount.c mount_util.c fusermount_CPPFLAGS = -I$(top_srcdir)/lib +fusermount_CFLAGS = -fPIE $(AM_CFLAGS) +fusermount_LDFLAGS = -pie $(AM_LDFLAGS) BUILT_SOURCES = mount_util.c mount_util.c: $(top_srcdir)/lib/mount_util.c @cp $(top_srcdir)/lib/mount_util.c . diff --git a/util/Makefile.in b/util/Makefile.in index 8c2e5e9..ac2e202 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -105,6 +105,9 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +fusermount_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(fusermount_CFLAGS) \ + $(CFLAGS) $(fusermount_LDFLAGS) $(LDFLAGS) -o $@ am_mount_fuse_OBJECTS = mount.fuse.$(OBJEXT) mount_fuse_OBJECTS = $(am_mount_fuse_OBJECTS) mount_fuse_LDADD = $(LDADD) @@ -313,6 +316,8 @@ AM_CPPFLAGS = -D_FILE_OFFSET_BITS=64 # copying it over. fusermount_SOURCES = fusermount.c mount_util.c fusermount_CPPFLAGS = -I$(top_srcdir)/lib +fusermount_CFLAGS = -fPIE $(AM_CFLAGS) +fusermount_LDFLAGS = -pie $(AM_LDFLAGS) BUILT_SOURCES = mount_util.c mount_fuse_SOURCES = mount.fuse.c ulockmgr_server_SOURCES = ulockmgr_server.c @@ -415,8 +420,7 @@ clean-noinstPROGRAMS: fusermount$(EXEEXT): $(fusermount_OBJECTS) $(fusermount_DEPENDENCIES) $(EXTRA_fusermount_DEPENDENCIES) @rm -f fusermount$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(fusermount_OBJECTS) $(fusermount_LDADD) $(LIBS) - + $(AM_V_CCLD)$(fusermount_LINK) $(fusermount_OBJECTS) $(fusermount_LDADD) $(LIBS) mount.fuse$(EXEEXT): $(mount_fuse_OBJECTS) $(mount_fuse_DEPENDENCIES) $(EXTRA_mount_fuse_DEPENDENCIES) @rm -f mount.fuse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mount_fuse_OBJECTS) $(mount_fuse_LDADD) $(LIBS) @@ -458,32 +462,32 @@ distclean-compile: @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< fusermount-fusermount.o: fusermount.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fusermount-fusermount.o -MD -MP -MF $(DEPDIR)/fusermount-fusermount.Tpo -c -o fusermount-fusermount.o `test -f 'fusermount.c' || echo '$(srcdir)/'`fusermount.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -MT fusermount-fusermount.o -MD -MP -MF $(DEPDIR)/fusermount-fusermount.Tpo -c -o fusermount-fusermount.o `test -f 'fusermount.c' || echo '$(srcdir)/'`fusermount.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fusermount-fusermount.Tpo $(DEPDIR)/fusermount-fusermount.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fusermount.c' object='fusermount-fusermount.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fusermount-fusermount.o `test -f 'fusermount.c' || echo '$(srcdir)/'`fusermount.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -c -o fusermount-fusermount.o `test -f 'fusermount.c' || echo '$(srcdir)/'`fusermount.c fusermount-fusermount.obj: fusermount.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fusermount-fusermount.obj -MD -MP -MF $(DEPDIR)/fusermount-fusermount.Tpo -c -o fusermount-fusermount.obj `if test -f 'fusermount.c'; then $(CYGPATH_W) 'fusermount.c'; else $(CYGPATH_W) '$(srcdir)/fusermount.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -MT fusermount-fusermount.obj -MD -MP -MF $(DEPDIR)/fusermount-fusermount.Tpo -c -o fusermount-fusermount.obj `if test -f 'fusermount.c'; then $(CYGPATH_W) 'fusermount.c'; else $(CYGPATH_W) '$(srcdir)/fusermount.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fusermount-fusermount.Tpo $(DEPDIR)/fusermount-fusermount.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fusermount.c' object='fusermount-fusermount.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fusermount-fusermount.obj `if test -f 'fusermount.c'; then $(CYGPATH_W) 'fusermount.c'; else $(CYGPATH_W) '$(srcdir)/fusermount.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -c -o fusermount-fusermount.obj `if test -f 'fusermount.c'; then $(CYGPATH_W) 'fusermount.c'; else $(CYGPATH_W) '$(srcdir)/fusermount.c'; fi` fusermount-mount_util.o: mount_util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fusermount-mount_util.o -MD -MP -MF $(DEPDIR)/fusermount-mount_util.Tpo -c -o fusermount-mount_util.o `test -f 'mount_util.c' || echo '$(srcdir)/'`mount_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -MT fusermount-mount_util.o -MD -MP -MF $(DEPDIR)/fusermount-mount_util.Tpo -c -o fusermount-mount_util.o `test -f 'mount_util.c' || echo '$(srcdir)/'`mount_util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fusermount-mount_util.Tpo $(DEPDIR)/fusermount-mount_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount_util.c' object='fusermount-mount_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fusermount-mount_util.o `test -f 'mount_util.c' || echo '$(srcdir)/'`mount_util.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -c -o fusermount-mount_util.o `test -f 'mount_util.c' || echo '$(srcdir)/'`mount_util.c fusermount-mount_util.obj: mount_util.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fusermount-mount_util.obj -MD -MP -MF $(DEPDIR)/fusermount-mount_util.Tpo -c -o fusermount-mount_util.obj `if test -f 'mount_util.c'; then $(CYGPATH_W) 'mount_util.c'; else $(CYGPATH_W) '$(srcdir)/mount_util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -MT fusermount-mount_util.obj -MD -MP -MF $(DEPDIR)/fusermount-mount_util.Tpo -c -o fusermount-mount_util.obj `if test -f 'mount_util.c'; then $(CYGPATH_W) 'mount_util.c'; else $(CYGPATH_W) '$(srcdir)/mount_util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fusermount-mount_util.Tpo $(DEPDIR)/fusermount-mount_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount_util.c' object='fusermount-mount_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fusermount-mount_util.obj `if test -f 'mount_util.c'; then $(CYGPATH_W) 'mount_util.c'; else $(CYGPATH_W) '$(srcdir)/mount_util.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fusermount_CPPFLAGS) $(CPPFLAGS) $(fusermount_CFLAGS) $(CFLAGS) -c -o fusermount-mount_util.obj `if test -f 'mount_util.c'; then $(CYGPATH_W) 'mount_util.c'; else $(CYGPATH_W) '$(srcdir)/mount_util.c'; fi` ulockmgr_server-ulockmgr_server.o: ulockmgr_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ulockmgr_server_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ulockmgr_server-ulockmgr_server.o -MD -MP -MF $(DEPDIR)/ulockmgr_server-ulockmgr_server.Tpo -c -o ulockmgr_server-ulockmgr_server.o `test -f 'ulockmgr_server.c' || echo '$(srcdir)/'`ulockmgr_server.c @@ -734,10 +738,6 @@ install-exec-local: $(INSTALL_PROGRAM) $(builddir)/mount.fuse $(DESTDIR)$(MOUNT_FUSE_PATH)/mount.fuse $(MKDIR_P) $(DESTDIR)$(INIT_D_PATH) $(INSTALL_SCRIPT) $(srcdir)/init_script $(DESTDIR)$(INIT_D_PATH)/fuse - @if test -x /usr/sbin/update-rc.d; then \ - echo "/usr/sbin/update-rc.d fuse start 34 S . start 41 0 6 . || true"; \ - /usr/sbin/update-rc.d fuse start 34 S . start 41 0 6 . || true; \ - fi install-data-local: $(MKDIR_P) $(DESTDIR)$(UDEV_RULES_PATH) -- 2.7.4