All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
@ 2017-12-14 13:23 Angelo Compagnucci
  2017-12-15  8:21 ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Angelo Compagnucci @ 2017-12-14 13:23 UTC (permalink / raw)
  To: buildroot

This patch bumps i2c-tools to version 4.0 and adds a couple of
new commands named i2ctransfer and eeprog.
It adds also several upstream commits not included in the release
that fix static compilation issues and parallel build issues.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
Changes:

v4 -> v5: After working with the upstrea we identified several problems
with the build system and fixed them. Unfortunately the maintainer
doesn't want to release a new package with these fixes so I had to add
several patches.


 ...efile-Add-flag-to-disable-dynamic-library.patch | 64 +++++++++++++++++++++
 ...odule.mk-Drop-unused-variable-LIB_OBJECTS.patch | 33 +++++++++++
 ...-tools-Module.mk-Add-missing-dependencies.patch | 67 ++++++++++++++++++++++
 ...04-lib-Module.mk-Fix-LIB_LINKS-dependency.patch | 34 +++++++++++
 ...low-to-really-disable-the-dynamic-library.patch | 33 +++++++++++
 package/i2c-tools/i2c-tools.hash                   |  2 +-
 package/i2c-tools/i2c-tools.mk                     | 16 +++++-
 7 files changed, 245 insertions(+), 4 deletions(-)
 create mode 100644 package/i2c-tools/0001-Makefile-Add-flag-to-disable-dynamic-library.patch
 create mode 100644 package/i2c-tools/0002-lib-Module.mk-Drop-unused-variable-LIB_OBJECTS.patch
 create mode 100644 package/i2c-tools/0003-tools-Module.mk-Add-missing-dependencies.patch
 create mode 100644 package/i2c-tools/0004-lib-Module.mk-Fix-LIB_LINKS-dependency.patch
 create mode 100644 package/i2c-tools/0005-Makefile-Allow-to-really-disable-the-dynamic-library.patch

diff --git a/package/i2c-tools/0001-Makefile-Add-flag-to-disable-dynamic-library.patch b/package/i2c-tools/0001-Makefile-Add-flag-to-disable-dynamic-library.patch
new file mode 100644
index 0000000..b5ec547
--- /dev/null
+++ b/package/i2c-tools/0001-Makefile-Add-flag-to-disable-dynamic-library.patch
@@ -0,0 +1,64 @@
+From 9906b2ecb6aec02d6348d6237b784135e6930d0b Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <angelo@amarulasolutions.com>
+Date: Wed, 6 Dec 2017 10:12:07 +0100
+Subject: Makefile: Add flag to disable dynamic library
+
+In such cases where you need to disable entirely the dynamic
+library compilation, now you can use the BUILD_DYNAMIC_LIB=0
+flag.
+
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ Makefile      | 10 +++++++++-
+ lib/Module.mk |  6 +++++-
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c85317c..1bb5572 100644
+--- a/Makefile
++++ b/Makefile
+@@ -32,12 +32,20 @@ CFLAGS		?= -O2
+ CFLAGS		+= -Wall
+ SOCFLAGS	:= -fpic -D_REENTRANT $(CFLAGS)
+ 
+-USE_STATIC_LIB ?= 0
++BUILD_DYNAMIC_LIB ?= 1
+ BUILD_STATIC_LIB ?= 1
++USE_STATIC_LIB ?= 0
++
+ ifeq ($(USE_STATIC_LIB),1)
+ BUILD_STATIC_LIB := 1
+ endif
+ 
++ifeq ($(BUILD_DYNAMIC_LIB),0)
++ifeq ($(BUILD_STATIC_LIB),0)
++$(error BUILD_DYNAMIC_LIB and BUILD_STATIC_LIB cannot be disabled at the same time)
++endif
++endif
++
+ KERNELVERSION	:= $(shell uname -r)
+ 
+ .PHONY: all strip clean install uninstall
+diff --git a/lib/Module.mk b/lib/Module.mk
+index fd2c8c4..44fa938 100644
+--- a/lib/Module.mk
++++ b/lib/Module.mk
+@@ -27,9 +27,13 @@ LIB_SHSONAME	:= $(LIB_SHBASENAME).$(LIB_MAINVER)
+ LIB_SHLIBNAME	:= $(LIB_SHBASENAME).$(LIB_VER)
+ LIB_STLIBNAME	:= libi2c.a
+ 
+-LIB_TARGETS	:= $(LIB_SHLIBNAME)
+ LIB_LINKS	:= $(LIB_SHSONAME) $(LIB_SHBASENAME)
+ LIB_OBJECTS	:= smbus.o
++
++LIB_TARGETS	:=
++ifeq ($(BUILD_DYNAMIC_LIB),1)
++LIB_TARGETS	+= $(LIB_SHLIBNAME)
++endif
+ ifeq ($(BUILD_STATIC_LIB),1)
+ LIB_TARGETS	+= $(LIB_STLIBNAME)
+ LIB_OBJECTS	+= smbus.ao
+-- 
+2.7.4
+
diff --git a/package/i2c-tools/0002-lib-Module.mk-Drop-unused-variable-LIB_OBJECTS.patch b/package/i2c-tools/0002-lib-Module.mk-Drop-unused-variable-LIB_OBJECTS.patch
new file mode 100644
index 0000000..43c915c
--- /dev/null
+++ b/package/i2c-tools/0002-lib-Module.mk-Drop-unused-variable-LIB_OBJECTS.patch
@@ -0,0 +1,33 @@
+From 1831b618fbedf0bcf15b0465981d133d9e3c53ee Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Wed, 6 Dec 2017 10:46:56 +0100
+Subject: lib/Module.mk: Drop unused variable LIB_OBJECTS
+
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+---
+ lib/Module.mk | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/lib/Module.mk b/lib/Module.mk
+index 44fa938..8a58f5b 100644
+--- a/lib/Module.mk
++++ b/lib/Module.mk
+@@ -28,7 +28,6 @@ LIB_SHLIBNAME	:= $(LIB_SHBASENAME).$(LIB_VER)
+ LIB_STLIBNAME	:= libi2c.a
+ 
+ LIB_LINKS	:= $(LIB_SHSONAME) $(LIB_SHBASENAME)
+-LIB_OBJECTS	:= smbus.o
+ 
+ LIB_TARGETS	:=
+ ifeq ($(BUILD_DYNAMIC_LIB),1)
+@@ -36,7 +35,6 @@ LIB_TARGETS	+= $(LIB_SHLIBNAME)
+ endif
+ ifeq ($(BUILD_STATIC_LIB),1)
+ LIB_TARGETS	+= $(LIB_STLIBNAME)
+-LIB_OBJECTS	+= smbus.ao
+ endif
+ 
+ #
+-- 
+2.7.4
+
diff --git a/package/i2c-tools/0003-tools-Module.mk-Add-missing-dependencies.patch b/package/i2c-tools/0003-tools-Module.mk-Add-missing-dependencies.patch
new file mode 100644
index 0000000..32b6656
--- /dev/null
+++ b/package/i2c-tools/0003-tools-Module.mk-Add-missing-dependencies.patch
@@ -0,0 +1,67 @@
+From 08b0d67ba7eceb862cb17f52eb1911e9579726ea Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Thu, 14 Dec 2017 08:52:26 +0100
+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.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Acked-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+---
+ lib/Module.mk   |  7 +++++++
+ tools/Module.mk | 10 +++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/lib/Module.mk b/lib/Module.mk
+index 8a58f5b..67afe91 100644
+--- 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
+ #
+diff --git a/tools/Module.mk b/tools/Module.mk
+index 6421a23..609de7a 100644
+--- a/tools/Module.mk
++++ b/tools/Module.mk
+@@ -24,19 +24,19 @@ TOOLS_TARGETS	:= i2cdetect i2cdump i2cset i2cget i2ctransfer
+ # 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)
+ 
+ #
+-- 
+2.7.4
+
diff --git a/package/i2c-tools/0004-lib-Module.mk-Fix-LIB_LINKS-dependency.patch b/package/i2c-tools/0004-lib-Module.mk-Fix-LIB_LINKS-dependency.patch
new file mode 100644
index 0000000..37a8ebc
--- /dev/null
+++ b/package/i2c-tools/0004-lib-Module.mk-Fix-LIB_LINKS-dependency.patch
@@ -0,0 +1,34 @@
+From de278d0933e3caea2508f95fd00e7e338bc12e8f Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <angelo@amarulasolutions.com>
+Date: Thu, 14 Dec 2017 13:34:29 +0100
+Subject: lib/Module.mk: Fix LIB_LINKS dependency
+
+LIB_LINKS should be added as a dependency only when
+BUILD_DYNAMIC_LIB is enabled.
+
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: 9906b2ecb6ae ("Makefile: Add flag to disable dynamic library"
+---
+ lib/Module.mk | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/Module.mk b/lib/Module.mk
+index 67afe91..2ebc70d 100644
+--- a/lib/Module.mk
++++ b/lib/Module.mk
+@@ -27,10 +27,9 @@ LIB_SHSONAME	:= $(LIB_SHBASENAME).$(LIB_MAINVER)
+ LIB_SHLIBNAME	:= $(LIB_SHBASENAME).$(LIB_VER)
+ LIB_STLIBNAME	:= libi2c.a
+ 
+-LIB_LINKS	:= $(LIB_SHSONAME) $(LIB_SHBASENAME)
+-
+ LIB_TARGETS	:=
+ ifeq ($(BUILD_DYNAMIC_LIB),1)
++LIB_LINKS	:= $(LIB_SHSONAME) $(LIB_SHBASENAME)
+ LIB_TARGETS	+= $(LIB_SHLIBNAME)
+ endif
+ ifeq ($(BUILD_STATIC_LIB),1)
+-- 
+2.7.4
+
diff --git a/package/i2c-tools/0005-Makefile-Allow-to-really-disable-the-dynamic-library.patch b/package/i2c-tools/0005-Makefile-Allow-to-really-disable-the-dynamic-library.patch
new file mode 100644
index 0000000..85438cb
--- /dev/null
+++ b/package/i2c-tools/0005-Makefile-Allow-to-really-disable-the-dynamic-library.patch
@@ -0,0 +1,33 @@
+From 57d2c370493f2e9e33b30e8767624c648f138ec4 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Thu, 14 Dec 2017 13:34:34 +0100
+Subject: Makefile: Allow to really disable the dynamic library
+
+If the user disables the build of the dynamic library, we have to
+link the tools with the static library. If we don't, the dependencies
+will cause the dynamic library to be built regardless of the user's
+request.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: 9906b2ecb6ae ("Makefile: Add flag to disable dynamic library")
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+---
+ Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 1bb5572..6bb741f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -43,6 +43,8 @@ endif
+ ifeq ($(BUILD_DYNAMIC_LIB),0)
+ ifeq ($(BUILD_STATIC_LIB),0)
+ $(error BUILD_DYNAMIC_LIB and BUILD_STATIC_LIB cannot be disabled at the same time)
++else
++USE_STATIC_LIB := 1
+ endif
+ endif
+ 
+-- 
+2.7.4
+
diff --git a/package/i2c-tools/i2c-tools.hash b/package/i2c-tools/i2c-tools.hash
index 464219d..3475d20 100644
--- a/package/i2c-tools/i2c-tools.hash
+++ b/package/i2c-tools/i2c-tools.hash
@@ -1,5 +1,5 @@
 # Locally computed
-sha256 6d6079153cd49a62d4addacef4c092db1a46ba60b2807070a3fbe050262aef87  i2c-tools-3.1.2.tar.xz
+sha256 d900ca1c11c51ea20caa50b096f948008b8a7ad832311b23353e21baa7af28d6  i2c-tools-4.0.tar.xz
 
 # License file
 sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
index 3bbaf38..0f71fd4 100644
--- a/package/i2c-tools/i2c-tools.mk
+++ b/package/i2c-tools/i2c-tools.mk
@@ -4,11 +4,12 @@
 #
 ################################################################################
 
-I2C_TOOLS_VERSION = 3.1.2
+I2C_TOOLS_VERSION = 4.0
 I2C_TOOLS_SOURCE = i2c-tools-$(I2C_TOOLS_VERSION).tar.xz
 I2C_TOOLS_SITE = https://www.kernel.org/pub/software/utils/i2c-tools
 I2C_TOOLS_LICENSE = GPL-2.0+, GPL-2.0 (py-smbus)
 I2C_TOOLS_LICENSE_FILES = COPYING
+I2C_TOOLS_MAKE_OPTS = EXTRA=eeprog
 
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 I2C_TOOLS_DEPENDENCIES += python
@@ -22,6 +23,14 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 I2C_TOOLS_DEPENDENCIES += busybox
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+I2C_TOOLS_MAKE_OPTS += BUILD_DYNAMIC_LIB=0 USE_STATIC_LIB=1
+endif
+
+ifeq ($(BR2_SHARED_LIBS),y)
+I2C_TOOLS_MAKE_OPTS += BUILD_STATIC_LIB=0
+endif
+
 # Build/install steps mirror the distutil python package type in the python package
 # infrastructure
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
@@ -47,15 +56,16 @@ endef
 endif # BR2_PACKAGE_PYTHON
 
 define I2C_TOOLS_BUILD_CMDS
-	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) -C $(@D)
 	$(I2C_TOOLS_BUILD_PYSMBUS)
 endef
 
 define I2C_TOOLS_INSTALL_TARGET_CMDS
-	for i in i2cdump i2cget i2cset i2cdetect; \
+	for i in i2cdump i2cget i2cset i2cdetect i2ctransfer; \
 	do \
 		$(INSTALL) -m 755 -D $(@D)/tools/$$i $(TARGET_DIR)/usr/sbin/$$i; \
 	done
+	$(INSTALL) -m 755 -D $(@D)/eeprog/eeprog $(TARGET_DIR)/usr/bin/eeprog;
 	$(I2C_TOOLS_INSTALL_PYSMBUS)
 endef
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-14 13:23 [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0 Angelo Compagnucci
@ 2017-12-15  8:21 ` Thomas Petazzoni
  2017-12-15  9:02   ` Angelo Compagnucci
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-12-15  8:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 14 Dec 2017 14:23:45 +0100, Angelo Compagnucci wrote:
> This patch bumps i2c-tools to version 4.0 and adds a couple of
> new commands named i2ctransfer and eeprog.
> It adds also several upstream commits not included in the release
> that fix static compilation issues and parallel build issues.
> 
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>

It still doesn't work here:

/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -Iinclude -c eeprog/eeprog.c -o eeprog/eeprog.o
/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -Iinclude -c eeprog/24cXX.c -o eeprog/24cXX.o
/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -shared  -Wl,--version-script=lib/libi2c.map -Wl,-soname,libi2c.so.0 -o lib/libi2c.so.0.1.0 lib/smbus.o -lc
/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o lib/libi2c.so -Llib -li2c
/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cset tools/i2cset.o tools/i2cbusses.o tools/util.o lib/libi2c.so -Llib -li2c
/home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cget tools/i2cget.o tools/i2cbusses.o tools/util.o lib/libi2c.so -Llib -li2c
lib/libi2c.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [tools/Module.mk:28: tools/i2cdetect] Error 1
make[2]: *** Waiting for unfinished jobs....
lib/libi2c.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [tools/Module.mk:34: tools/i2cset] Error 1
make[1]: *** [package/pkg-generic.mk:250: /home/thomas/projets/buildroot/output/build/i2c-tools-4.0/.stamp_built] Error 2
make: *** [Makefile:79: _all] Error 2
^Cmake: *** [Makefile:79: _all] Interrupt

After 5 or 6 rebuilds of the i2c-tools package this happened.

Without your patch, building the i2c-tools package survives this loop
that builds it 100 times:

for i in $(seq 1 100) ; do echo "=== $i ===" ; rm -rf output/build/i2c-tools* ; make i2c-tools || break ; done

With your patch applied, I've never been able to reach more than 5 or 6
iterations of the loop.

Could you rework this, and test 100 iterations of building the i2c-tools package ?

Of course, you need to have multiple cores on your machine to reproduce
the issue, otherwise the package is built with make -j1, and you
probably don't see the problem;

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-15  8:21 ` Thomas Petazzoni
@ 2017-12-15  9:02   ` Angelo Compagnucci
  2017-12-15 14:15     ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Angelo Compagnucci @ 2017-12-15  9:02 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

On Fri, Dec 15, 2017 at 9:21 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Thu, 14 Dec 2017 14:23:45 +0100, Angelo Compagnucci wrote:
>> This patch bumps i2c-tools to version 4.0 and adds a couple of
>> new commands named i2ctransfer and eeprog.
>> It adds also several upstream commits not included in the release
>> that fix static compilation issues and parallel build issues.
>>
>> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
>
> It still doesn't work here:
>
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -Iinclude -c eeprog/eeprog.c -o eeprog/eeprog.o
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -Iinclude -c eeprog/24cXX.c -o eeprog/24cXX.o
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc -shared  -Wl,--version-script=lib/libi2c.map -Wl,-soname,libi2c.so.0 -o lib/libi2c.so.0.1.0 lib/smbus.o -lc
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o lib/libi2c.so -Llib -li2c
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cset tools/i2cset.o tools/i2cbusses.o tools/util.o lib/libi2c.so -Llib -li2c
> /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc  -o tools/i2cget tools/i2cget.o tools/i2cbusses.o tools/util.o lib/libi2c.so -Llib -li2c
> lib/libi2c.so: file not recognized: File truncated
> collect2: error: ld returned 1 exit status
> make[2]: *** [tools/Module.mk:28: tools/i2cdetect] Error 1
> make[2]: *** Waiting for unfinished jobs....
> lib/libi2c.so: file not recognized: File truncated
> collect2: error: ld returned 1 exit status
> make[2]: *** [tools/Module.mk:34: tools/i2cset] Error 1
> make[1]: *** [package/pkg-generic.mk:250: /home/thomas/projets/buildroot/output/build/i2c-tools-4.0/.stamp_built] Error 2
> make: *** [Makefile:79: _all] Error 2
> ^Cmake: *** [Makefile:79: _all] Interrupt
>
> After 5 or 6 rebuilds of the i2c-tools package this happened.
>
> Without your patch,

You mean before bumping to version 4?

> building the i2c-tools package survives this loop
> that builds it 100 times:
>
> for i in $(seq 1 100) ; do echo "=== $i ===" ; rm -rf output/build/i2c-tools* ; make i2c-tools || break ; done
>
> With your patch applied, I've never been able to reach more than 5 or 6
> iterations of the loop.
>
> Could you rework this, and test 100 iterations of building the i2c-tools package ?

I built it now 3 times with my 8core machine with various -j settings,
unfortunately I cannot reproduce:

=== 100 ===
umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools

ls build/i2c-tools-4.0/
CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h

Could you give me more details?

Thanks!


>
> Of course, you need to have multiple cores on your machine to reproduce
> the issue, otherwise the package is built with make -j1, and you
> probably don't see the problem;
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-15  9:02   ` Angelo Compagnucci
@ 2017-12-15 14:15     ` Thomas Petazzoni
  2017-12-15 15:21       ` Angelo Compagnucci
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-12-15 14:15 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 15 Dec 2017 10:02:27 +0100, Angelo Compagnucci wrote:

> > After 5 or 6 rebuilds of the i2c-tools package this happened.
> >
> > Without your patch,  
> 
> You mean before bumping to version 4?

Yes, without your patch, i.e with the current version of i2c-tools in
Buildroot.

> > for i in $(seq 1 100) ; do echo "=== $i ===" ; rm -rf output/build/i2c-tools* ; make i2c-tools || break ; done
> >
> > With your patch applied, I've never been able to reach more than 5 or 6
> > iterations of the loop.
> >
> > Could you rework this, and test 100 iterations of building the i2c-tools package ?  
> 
> I built it now 3 times with my 8core machine with various -j settings,
> unfortunately I cannot reproduce:
> 
> === 100 ===
> umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
> O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools

So you built it 3 times, or 3 times my loop of 100 builds ?

> ls build/i2c-tools-4.0/
> CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
> COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h
> 
> Could you give me more details?

Well, I don't have more details to provide: I just build i2c-tools, and
it fails randomly.

Perhaps I should apply and see what the autobuilders have to say, i.e
if they agree with you (it builds) or with me (it fails randomly).

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-15 14:15     ` Thomas Petazzoni
@ 2017-12-15 15:21       ` Angelo Compagnucci
  2017-12-15 15:22         ` [Buildroot] FW: " Kees van Unen
  2017-12-18 10:51         ` [Buildroot] " Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Angelo Compagnucci @ 2017-12-15 15:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, Dec 15, 2017 at 3:15 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 15 Dec 2017 10:02:27 +0100, Angelo Compagnucci wrote:
>
>> > After 5 or 6 rebuilds of the i2c-tools package this happened.
>> >
>> > Without your patch,
>>
>> You mean before bumping to version 4?
>
> Yes, without your patch, i.e with the current version of i2c-tools in
> Buildroot.

Looking at the git history, the makefile is not changed that much but,
If I remember correctly, it had two bugs:

The first one was with parallel builds and fixed here [1] by the upstream.
The second one was with shared libraries when BR2_STATIC_LIBS is selected.
Imho these bugs were present before version 4.

Want we to keep version 3.1.2?

>> > for i in $(seq 1 100) ; do echo "=== $i ===" ; rm -rf output/build/i2c-tools* ; make i2c-tools || break ; done
>> >
>> > With your patch applied, I've never been able to reach more than 5 or 6
>> > iterations of the loop.
>> >
>> > Could you rework this, and test 100 iterations of building the i2c-tools package ?
>>
>> I built it now 3 times with my 8core machine with various -j settings,
>> unfortunately I cannot reproduce:
>>
>> === 100 ===
>> umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
>> O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools
>
> So you built it 3 times, or 3 times my loop of 100 builds ?

^^^ That "=== 100 ===" means the last row of the output from your loop.
So I run at least 3 times your loop and something more meanwhile.

>> ls build/i2c-tools-4.0/
>> CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
>> COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h
>>
>> Could you give me more details?
>
> Well, I don't have more details to provide: I just build i2c-tools, and
> it fails randomly.
>
> Perhaps I should apply and see what the autobuilders have to say, i.e
> if they agree with you (it builds) or with me (it fails randomly).

I hope it works!

>
> Thomas

[1] https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/commit/?id=a6a59693066fd8da81f7107479df3e32a129247d

> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] FW: [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-15 15:21       ` Angelo Compagnucci
@ 2017-12-15 15:22         ` Kees van Unen
  2017-12-18 10:51         ` [Buildroot] " Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Kees van Unen @ 2017-12-15 15:22 UTC (permalink / raw)
  To: buildroot




________________________________________
Van: buildrootNamensAngelo Compagnucci
Verzonden: vrijdag 15 december 2017 16:21:10 (UTC+01:00) Amsterdam, Berlijn, Bern, Rome, Stockholm, Wenen
Aan: Thomas Petazzoni
CC: buildroot at buildroot.org
Onderwerp: Re: [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0

Hello,

On Fri, Dec 15, 2017 at 3:15 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 15 Dec 2017 10:02:27 +0100, Angelo Compagnucci wrote:
>
>> > After 5 or 6 rebuilds of the i2c-tools package this happened.
>> >
>> > Without your patch,
>>
>> You mean before bumping to version 4?
>
> Yes, without your patch, i.e with the current version of i2c-tools in
> Buildroot.

Looking at the git history, the makefile is not changed that much but,
If I remember correctly, it had two bugs:

The first one was with parallel builds and fixed here [1] by the upstream.
The second one was with shared libraries when BR2_STATIC_LIBS is selected.
Imho these bugs were present before version 4.

Want we to keep version 3.1.2?

>> > for i in $(seq 1 100) ; do echo "=== $i ===" ; rm -rf output/build/i2c-tools* ; make i2c-tools || break ; done
>> >
>> > With your patch applied, I've never been able to reach more than 5 or 6
>> > iterations of the loop.
>> >
>> > Could you rework this, and test 100 iterations of building the i2c-tools package ?
>>
>> I built it now 3 times with my 8core machine with various -j settings,
>> unfortunately I cannot reproduce:
>>
>> === 100 ===
>> umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
>> O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools
>
> So you built it 3 times, or 3 times my loop of 100 builds ?

^^^ That "=== 100 ===" means the last row of the output from your loop.
So I run at least 3 times your loop and something more meanwhile.

>> ls build/i2c-tools-4.0/
>> CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
>> COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h
>>
>> Could you give me more details?
>
> Well, I don't have more details to provide: I just build i2c-tools, and
> it fails randomly.
>
> Perhaps I should apply and see what the autobuilders have to say, i.e
> if they agree with you (it builds) or with me (it fails randomly).

I hope it works!

>
> Thomas

[1] https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/commit/?id=a6a59693066fd8da81f7107479df3e32a129247d

> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-15 15:21       ` Angelo Compagnucci
  2017-12-15 15:22         ` [Buildroot] FW: " Kees van Unen
@ 2017-12-18 10:51         ` Thomas Petazzoni
  2017-12-21 11:35           ` Angelo Compagnucci
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-12-18 10:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 15 Dec 2017 16:21:10 +0100, Angelo Compagnucci wrote:

> > Yes, without your patch, i.e with the current version of i2c-tools in
> > Buildroot.  
> 
> Looking at the git history, the makefile is not changed that much but,
> If I remember correctly, it had two bugs:
> 
> The first one was with parallel builds and fixed here [1] by the upstream.
> The second one was with shared libraries when BR2_STATIC_LIBS is selected.
> Imho these bugs were present before version 4.
> 
> Want we to keep version 3.1.2?

No we want to bump, but not if that introduces regressions.

> >> === 100 ===
> >> umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
> >> O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools  
> >
> > So you built it 3 times, or 3 times my loop of 100 builds ?  
> 
> ^^^ That "=== 100 ===" means the last row of the output from your loop.
> So I run at least 3 times your loop and something more meanwhile.

OK. Weird.

> >> ls build/i2c-tools-4.0/
> >> CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
> >> COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h
> >>
> >> Could you give me more details?  
> >
> > Well, I don't have more details to provide: I just build i2c-tools, and
> > it fails randomly.
> >
> > Perhaps I should apply and see what the autobuilders have to say, i.e
> > if they agree with you (it builds) or with me (it fails randomly).  
> 
> I hope it works!

I'd like someone else in the Buildroot community to test your patch and
see if the parallel build problems are also reproducible. Anyone
available to test Angelo's patch?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0
  2017-12-18 10:51         ` [Buildroot] " Thomas Petazzoni
@ 2017-12-21 11:35           ` Angelo Compagnucci
  0 siblings, 0 replies; 8+ messages in thread
From: Angelo Compagnucci @ 2017-12-21 11:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, Dec 18, 2017 at 11:51 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 15 Dec 2017 16:21:10 +0100, Angelo Compagnucci wrote:
>
>> > Yes, without your patch, i.e with the current version of i2c-tools in
>> > Buildroot.
>>
>> Looking at the git history, the makefile is not changed that much but,
>> If I remember correctly, it had two bugs:
>>
>> The first one was with parallel builds and fixed here [1] by the upstream.
>> The second one was with shared libraries when BR2_STATIC_LIBS is selected.
>> Imho these bugs were present before version 4.
>>
>> Want we to keep version 3.1.2?
>
> No we want to bump, but not if that introduces regressions.
>
>> >> === 100 ===
>> >> umask 0022 && make -C /home/angelo/DEV/BUILDROOT/buildroot
>> >> O=/home/angelo/DEV/BUILDROOT/br_qemu_arm/. i2c-tools
>> >
>> > So you built it 3 times, or 3 times my loop of 100 builds ?
>>
>> ^^^ That "=== 100 ===" means the last row of the output from your loop.
>> So I run at least 3 times your loop and something more meanwhile.
>
> OK. Weird.
>
>> >> ls build/i2c-tools-4.0/
>> >> CHANGES  COPYING.LGPL  eeprom    include  Makefile  README  tools
>> >> COPYING  eeprog        eepromer  lib      py-smbus  stub    version.h
>> >>
>> >> Could you give me more details?
>> >
>> > Well, I don't have more details to provide: I just build i2c-tools, and
>> > it fails randomly.
>> >
>> > Perhaps I should apply and see what the autobuilders have to say, i.e
>> > if they agree with you (it builds) or with me (it fails randomly).
>>
>> I hope it works!
>
> I'd like someone else in the Buildroot community to test your patch and
> see if the parallel build problems are also reproducible. Anyone
> available to test Angelo's patch?

I'm doing some other tests and now I'm hitting a parallel build issue,
so you were right!
Solving it as soon as possible!

Thanks!

>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-21 11:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 13:23 [Buildroot] [PATCH v5] package/i2c-tools: bump to version 4.0 Angelo Compagnucci
2017-12-15  8:21 ` Thomas Petazzoni
2017-12-15  9:02   ` Angelo Compagnucci
2017-12-15 14:15     ` Thomas Petazzoni
2017-12-15 15:21       ` Angelo Compagnucci
2017-12-15 15:22         ` [Buildroot] FW: " Kees van Unen
2017-12-18 10:51         ` [Buildroot] " Thomas Petazzoni
2017-12-21 11:35           ` Angelo Compagnucci

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.