diff --git a/btrfs-support-pie.patch b/btrfs-support-pie.patch new file mode 100644 index 0000000..0134b3f --- /dev/null +++ b/btrfs-support-pie.patch @@ -0,0 +1,104 @@ +Index: btrfs-progs-v4.10.2/Makefile +=================================================================== +--- btrfs-progs-v4.10.2.orig/Makefile ++++ btrfs-progs-v4.10.2/Makefile +@@ -341,25 +341,25 @@ $(lib_links): + + btrfs-%.static: btrfs-%.static.o $(static_objects) $(patsubst %.o,%.static.o,$(standalone_deps)) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $@.o $(static_objects) \ ++ $(Q)$(CC) -o $@ $@.o $(static_objects) \ + $(patsubst %.o, %.static.o, $($(subst -,_,$(subst .static,,$@)-objects))) \ + $(static_libbtrfs_objects) $(STATIC_LDFLAGS) \ + $($(subst -,_,$(subst .static,,$@)-libs)) $(STATIC_LIBS) + + btrfs-%: btrfs-%.o $(objects) $(standalone_deps) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $(objects) $@.o \ ++ $(Q)$(CC) -o $@ $(objects) $@.o \ + $($(subst -,_,$@-objects)) \ + $(libs_static) \ + $(LDFLAGS) $(LIBS) $($(subst -,_,$@-libs)) + + btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP) + + btrfs.static: btrfs.static.o $(static_objects) $(static_cmds_objects) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP) ++ $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP) + + # For backward compatibility, 'btrfs' changes behaviour to fsck if it's named 'btrfsck' + btrfsck: btrfs +@@ -372,43 +372,43 @@ btrfsck.static: btrfs.static + + mkfs.btrfs: $(mkfs_objects) $(objects) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) + + mkfs.btrfs.static: $(static_mkfs_objects) $(static_objects) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) ++ $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) + + btrfstune: btrfstune.o $(objects) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) + + btrfstune.static: btrfstune.static.o $(static_objects) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) ++ $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) + + btrfs-image: image/main.o $(objects) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP) + + btrfs-image.static: image/main.static.o $(static_objects) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP) ++ $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP) + + btrfs-convert: $(convert_objects) $(objects) $(libs_static) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(btrfs_convert_libs) $(LIBS) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(btrfs_convert_libs) $(LIBS) + + btrfs-convert.static: $(static_convert_objects) $(static_objects) $(static_libbtrfs_objects) + @echo " [LD] $@" +- $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $^ $(STATIC_LDFLAGS) $(btrfs_convert_libs) $(STATIC_LIBS) ++ $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(btrfs_convert_libs) $(STATIC_LIBS) + + dir-test: dir-test.o $(objects) $(libs) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) + + quick-test: quick-test.o $(objects) $(libs) + @echo " [LD] $@" +- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) ++ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) + + ioctl-test.o: ioctl-test.c ioctl.h kerncompat.h ctree.h + @echo " [CC] $@" +@@ -430,13 +430,13 @@ ioctl-test: ioctl-test.o + + ioctl-test-32: ioctl-test-32.o + @echo " [LD32] $@" +- $(Q)$(CC) $(CFLAGS) -m32 -o $@ $< $(LDFLAGS) ++ $(Q)$(CC) -m32 -o $@ $< $(LDFLAGS) + @echo " ?[PAHOLE] $@.pahole" + -$(Q)pahole $@ > $@.pahole + + ioctl-test-64: ioctl-test-64.o + @echo " [LD64] $@" +- $(Q)$(CC) $(CFLAGS) -m64 -o $@ $< $(LDFLAGS) ++ $(Q)$(CC) -m64 -o $@ $< $(LDFLAGS) + @echo " ?[PAHOLE] $@.pahole" + -$(Q)pahole $@ > $@.pahole + diff --git a/btrfsprogs.changes b/btrfsprogs.changes index a9143c5..26b9ef7 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jun 10 15:00:59 UTC 2017 - meissner@suse.com + +- btrfs-support-pie.patch: remove CFLAGS usage from linker lines, + this will allow the default PIE support to work. + ------------------------------------------------------------------- Thu Apr 6 00:00:00 CEST 2017 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 1156b39..bb90663 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -45,6 +45,7 @@ Source5: sles11-defaults.h Patch163: 0163-btrfs-progs-fsck-fix-segfault.patch Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch +Patch169: btrfs-support-pie.patch Patch1000: local-version-override.patch Patch1001: mkfs-default-features.patch @@ -142,6 +143,7 @@ thing. %patch163 -p1 %patch167 -p1 %patch168 -p1 +%patch169 -p1 %patch1000 -p1 %patch1001 -p1