1 Subject: Sort list of files to make build reproducible
2 Author: Bernhard M. Wiedemann <bwiedemann suse de>
5 https://github.com/geometer/FBReader/pull/295
6 https://bugzilla.opensuse.org/show_bug.cgi?id=1041090
8 sort linker input files
10 when building packages (e.g. for openSUSE Linux)
11 (random) filesystem order of input files
12 influences ordering of functions in the output,
13 thus without the patch, builds (in disposable VMs) would usually differ.
15 See https://reproducible-builds.org/ for why this matters.
17 Setting LC_ALL is needed because locales influence how sorting happens.
19 Index: fbreader-0.99.4/fbreader/Makefile
20 ===================================================================
21 --- fbreader-0.99.4.orig/fbreader/Makefile
22 +++ fbreader-0.99.4/fbreader/Makefile
23 @@ -22,7 +22,7 @@ all: .resources
26 @echo -n 'Linking $(TARGET) ...'
27 - @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3
28 + @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o | LC_ALL=C sort` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3
31 FBSHAREDIR = $(DESTDIR)$(SHAREDIR)/FBReader