From 7e86ac05df7f43c27260159bcdbf40a588eb03fd5cb50e2a3ab2b015f77e0e0b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 12 Dec 2017 16:08:47 +0000 Subject: [PATCH] - tools-build-add-missing-dependencies.patch: Fix another random failure of parallel builds. OBS-URL: https://build.opensuse.org/package/show/Base:System/i2c-tools?expand=0&rev=47 --- i2c-tools.changes | 6 +++ i2c-tools.spec | 2 + tools-build-add-missing-dependencies.patch | 53 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 tools-build-add-missing-dependencies.patch diff --git a/i2c-tools.changes b/i2c-tools.changes index 6ac09fb..fbab03a 100644 --- a/i2c-tools.changes +++ b/i2c-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Dec 12 17:07:54 CET 2017 - jdelvare@suse.com + +- tools-build-add-missing-dependencies.patch: Fix another random + failure of parallel builds. + ------------------------------------------------------------------- Wed Dec 6 16:01:02 CET 2017 - jdelvare@suse.com diff --git a/i2c-tools.spec b/i2c-tools.spec index ebfcec2..cae8da3 100644 --- a/i2c-tools.spec +++ b/i2c-tools.spec @@ -30,6 +30,7 @@ Source1: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{ve Patch1: i2cbusses-path-overflows.patch Patch2: lib-build-add-missing-dependencies.patch Patch3: decode-dimms-hackweek-DDR4.patch +Patch4: tools-build-add-missing-dependencies.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: s390 s390x @@ -64,6 +65,7 @@ connected to the I2C or SMBus buses of the system. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" CC="%{__cc}" BUILD_STATIC_LIB:=0 diff --git a/tools-build-add-missing-dependencies.patch b/tools-build-add-missing-dependencies.patch new file mode 100644 index 0000000..8ebc7a2 --- /dev/null +++ b/tools-build-add-missing-dependencies.patch @@ -0,0 +1,53 @@ +From: Jean Delvare +Subject: tools/Module.mk: Add missing dependencies + +Better build the library before building the tools which link against +it, otherwise parallel builds could run into a race and break. +--- + lib/Module.mk | 7 +++++++ + tools/Module.mk | 10 +++++----- + 2 files changed, 12 insertions(+), 5 deletions(-) + +--- a/lib/Module.mk ++++ b/lib/Module.mk +@@ -37,6 +37,13 @@ ifeq ($(BUILD_STATIC_LIB),1) + LIB_TARGETS += $(LIB_STLIBNAME) + endif + ++# Library file to link against (static or dynamic) ++ifeq ($(USE_STATIC_LIB),1) ++LIB_DEPS := $(LIB_DIR)/$(LIB_STLIBNAME) ++else ++LIB_DEPS := $(LIB_DIR)/$(LIB_SHBASENAME) ++endif ++ + # + # Libraries + # +--- a/tools/Module.mk ++++ b/tools/Module.mk +@@ -24,19 +24,19 @@ TOOLS_TARGETS := i2cdetect i2cdump i2cse + # Programs + # + +-$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o ++$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o $(LIB_DEPS) + $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS) + +-$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o ++$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS) + $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS) + +-$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o ++$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS) + $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS) + +-$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o ++$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS) + $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS) + +-$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o ++$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS) + $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS) + + #