sort 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.
This commit is contained in:
Bernhard M. Wiedemann 2017-05-30 16:21:32 +02:00 committed by Stephen Smalley
parent 22ac4f9bd3
commit c18ea1df62
9 changed files with 9 additions and 9 deletions

View File

@ -53,7 +53,7 @@ PCRE_LDLIBS ?= -lpcre
ifeq ($(ANDROID_HOST),y)
TARGETS=sefcontext_compile
else
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
endif
sefcontext_compile: LDLIBS += $(PCRE_LDLIBS) ../src/libselinux.a -lsepol

View File

@ -51,7 +51,7 @@ SWIGFILES=$(SWIGSO) semanage.py
SWIGRUBYSO=$(RUBYPREFIX)_semanage.so
LIBSO=$(TARGET).$(LIBVERSION)
GENERATED=$(SWIGCOUT) $(SWIGRUBYCOUT) semanageswig_python_exception.i $(wildcard conf-*.[ch])
GENERATED=$(SWIGCOUT) $(SWIGRUBYCOUT) semanageswig_python_exception.i $(sort $(wildcard conf-*.[ch]))
SRCS= $(filter-out $(GENERATED),$(sort $(wildcard *.c)))
OBJS= $(patsubst %.c,%.o,$(SRCS)) conf-scan.o conf-parse.o

View File

@ -2,7 +2,7 @@ PREFIX ?= $(DESTDIR)/usr
LIBDIR ?= $(PREFIX)/lib
# Add your test source files here:
SOURCES = $(wildcard *.c)
SOURCES = $(sort $(wildcard *.c))
# Add the required external object files here:
LIBS = ../src/libsemanage.a -lselinux -lsepol

View File

@ -15,7 +15,7 @@ CHECKPOLICY := ../../checkpolicy/
CPPFLAGS += -I../include/ -I$(CHECKPOLICY)
# test program object files
objs := $(patsubst %.c,%.o,$(wildcard *.c))
objs := $(patsubst %.c,%.o,$(sort $(wildcard *.c)))
parserobjs := $(CHECKPOLICY)queue.o $(CHECKPOLICY)y.tab.o \
$(CHECKPOLICY)parse_util.o $(CHECKPOLICY)lex.yy.o \
$(CHECKPOLICY)policy_define.o $(CHECKPOLICY)module_compiler.o

View File

@ -7,7 +7,7 @@ override CFLAGS += -I../include
override LDFLAGS += -L../src
LDLIBS += -lsepol
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
all: $(TARGETS)

View File

@ -8,7 +8,7 @@ CFLAGS ?= -Wall
override CFLAGS += -I../src -D_GNU_SOURCE
LDLIBS += -lselinux -lpcre
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
all: $(TARGETS)

View File

@ -10,7 +10,7 @@ HLLDIR ?= $(LIBEXECDIR)/selinux/hll
CFLAGS ?= -Werror -Wall -W
LDLIBS = -lsepol
PP_SRCS = $(wildcard *.c)
PP_SRCS = $(sort $(wildcard *.c))
PP_OBJS = $(patsubst %.c,%.o,$(PP_SRCS))
all: pp

View File

@ -9,7 +9,7 @@ CFLAGS ?= -Werror -Wall -W
override CFLAGS += $(LDFLAGS) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
LDLIBS += -lsepol -lselinux
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
all: $(TARGETS)

View File

@ -23,7 +23,7 @@ ifeq ($(AUDITH), y)
LDLIBS += -laudit
endif
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
all: $(TARGETS)