From 8488ee817ac98596d8c3963f218d23b044d4c355 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sun, 28 May 2017 06:49:14 +0200 Subject: [PATCH] sort linker input files when building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output, thus without the patch, builds (in disposable VMs) would usually differ. See https://reproducible-builds.org/ for why this matters. Setting LC_ALL is needed because locales influence how sorting happens. --- fbreader/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbreader/Makefile b/fbreader/Makefile index bfa92427c..a5acd0fcd 100644 --- a/fbreader/Makefile +++ b/fbreader/Makefile @@ -22,7 +22,7 @@ all: .resources fi; \ done; @echo -n 'Linking $(TARGET) ...' - @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o` -L$(ROOTDIR)/zlibrary/text $(TEXT_LIBS) $(CORE_LIBS) -lsqlite3 + @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o | LC_ALL=C sort` -L$(ROOTDIR)/zlibrary/text $(TEXT_LIBS) $(CORE_LIBS) -lsqlite3 @echo ' OK' FBSHAREDIR = $(DESTDIR)$(SHAREDIR)/FBReader