diff mbox

[v2,2/4] dtc: bump version to 1.4.1

Message ID 1421000166-24963-2-git-send-email-ps.report@gmx.net
State Changes Requested
Headers show

Commit Message

Peter Seiderer Jan. 11, 2015, 6:16 p.m. UTC
Patch 0001-separate-lib-install.patch is no longer needed,
original Makefile already contains separate install-lib target.

Adjust 0002-extra-cflags.patch.

Add hash file.

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
  - delete additional invalid comment
---
 package/dtc/0001-separate-lib-install.patch | 28 ----------------------------
 package/dtc/0002-extra-cflags.patch         |  2 +-
 package/dtc/dtc.hash                        |  2 ++
 package/dtc/dtc.mk                          |  7 +++----
 4 files changed, 6 insertions(+), 33 deletions(-)
 delete mode 100644 package/dtc/0001-separate-lib-install.patch
 create mode 100644 package/dtc/dtc.hash

Comments

Thomas Petazzoni Jan. 12, 2015, 8:07 p.m. UTC | #1
Dear Peter Seiderer,

On Sun, 11 Jan 2015 19:16:04 +0100, Peter Seiderer wrote:
> Patch 0001-separate-lib-install.patch is no longer needed,
> original Makefile already contains separate install-lib target.
> 
> Adjust 0002-extra-cflags.patch.
> 
> Add hash file.
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v1 -> v2:
>   - delete additional invalid comment

This patch breaks the build, when building only the libfdt and not the
programs:

>>> dtc 1.4.1 Installing to staging directory
/usr/bin/make -j5 -C /home/thomas/projets/buildroot/output/build/dtc-1.4.1 DESTDIR=/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot PREFIX=/usr install-lib
make[1]: Entering directory '/home/thomas/projets/buildroot/output/build/dtc-1.4.1'
	CHK version_gen.h
	 CC util.o
	 CC srcpos.o
	 CC convert-dtsv0-lexer.lex.o
	 CC dtc.o
	 CC checks.o
	 CC data.o
	 CC flattree.o
	 CC fstree.o
	 CC livetree.o
	 CC dtc-lexer.lex.o
	 CC treesource.o
	 CC dtc-parser.tab.o
	 CC fdtdump.o
	 CC fdtget.o
	 CC fdtput.o
	 LD fdtdump
	 LD convert-dtsv0
	 LD fdtget
	 LD dtc
/usr/bin/ld: libfdt/libfdt.a(fdt.o): Relocations in generic ELF (EM: 40)
libfdt/libfdt.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:236: recipe for target 'fdtget' failed
make[1]: *** [fdtget] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/thomas/projets/buildroot/output/build/dtc-1.4.1'

This is due to the fact that the install-lib target depends on all.
When building only libfdt, we do "make libfdt" during the build step,
and then "make install-lib" during the install step, and this triggers
the build of the DTC programs, due to the dependency on the all target.
Unfortunately, since we don't pass CC, LD and al. at install time, this
doesn't work.

So I would suggest to just build everything (i.e plain "make" for the
build), and then use install-lib.

Best regards,

Thomas
Peter Seiderer Jan. 12, 2015, 10:13 p.m. UTC | #2
Hello Thomas,

> Gesendet: Montag, 12. Januar 2015 um 21:07 Uhr
> Von: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> An: "Peter Seiderer" <ps.report@gmx.net>
> Cc: buildroot@busybox.net
> Betreff: Re: [Buildroot] [PATCH v2 2/4] dtc: bump version to 1.4.1
>
> Dear Peter Seiderer,
> 
> On Sun, 11 Jan 2015 19:16:04 +0100, Peter Seiderer wrote:
> > Patch 0001-separate-lib-install.patch is no longer needed,
> > original Makefile already contains separate install-lib target.
> > 
> > Adjust 0002-extra-cflags.patch.
> > 
> > Add hash file.
> > 
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > Changes v1 -> v2:
> >   - delete additional invalid comment
> 
> This patch breaks the build, when building only the libfdt and not the
> programs:
> 
> >>> dtc 1.4.1 Installing to staging directory
> /usr/bin/make -j5 -C /home/thomas/projets/buildroot/output/build/dtc-1.4.1 DESTDIR=/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot PREFIX=/usr install-lib
> make[1]: Entering directory '/home/thomas/projets/buildroot/output/build/dtc-1.4.1'
> 	CHK version_gen.h
> 	 CC util.o
> 	 CC srcpos.o
> 	 CC convert-dtsv0-lexer.lex.o
> 	 CC dtc.o
> 	 CC checks.o
> 	 CC data.o
> 	 CC flattree.o
> 	 CC fstree.o
> 	 CC livetree.o
> 	 CC dtc-lexer.lex.o
> 	 CC treesource.o
> 	 CC dtc-parser.tab.o
> 	 CC fdtdump.o
> 	 CC fdtget.o
> 	 CC fdtput.o
> 	 LD fdtdump
> 	 LD convert-dtsv0
> 	 LD fdtget
> 	 LD dtc
> /usr/bin/ld: libfdt/libfdt.a(fdt.o): Relocations in generic ELF (EM: 40)
> libfdt/libfdt.a: error adding symbols: File in wrong format
> collect2: error: ld returned 1 exit status
> Makefile:236: recipe for target 'fdtget' failed
> make[1]: *** [fdtget] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make[1]: Leaving directory '/home/thomas/projets/buildroot/output/build/dtc-1.4.1'
> 
> This is due to the fact that the install-lib target depends on all.
> When building only libfdt, we do "make libfdt" during the build step,
> and then "make install-lib" during the install step, and this triggers
> the build of the DTC programs, due to the dependency on the all target.
> Unfortunately, since we don't pass CC, LD and al. at install time, this
> doesn't work.
> 
> So I would suggest to just build everything (i.e plain "make" for the
> build), and then use install-lib.
> 

Many thanks for testing (and failure analysis), will try your suggestion
and respin the patchset...

Regards,
Peter

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

Patch

diff --git a/package/dtc/0001-separate-lib-install.patch b/package/dtc/0001-separate-lib-install.patch
deleted file mode 100644
index c86d587..0000000
--- a/package/dtc/0001-separate-lib-install.patch
+++ /dev/null
@@ -1,28 +0,0 @@ 
-Makefile: add a rule to only install libfdt
-
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
-Patch not sent upstream.
-
-It's really specific to buildroot, and is probably not
-good (aka generic) enough to be pushed upstream.
-
-diff --git a/Makefile b/Makefile
-index 1169e6c..39e7190 100644
---- a/Makefile
-+++ b/Makefile
-@@ -160,10 +160,12 @@ endif
- # intermediate target and building them again "for real"
- .SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS)
- 
--install: all $(SCRIPTS)
-+install: all $(SCRIPTS) libfdt_install
- 	@$(VECHO) INSTALL
- 	$(INSTALL) -d $(DESTDIR)$(BINDIR)
- 	$(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
-+
-+libfdt_install: libfdt
- 	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
- 	$(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
- 	ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
diff --git a/package/dtc/0002-extra-cflags.patch b/package/dtc/0002-extra-cflags.patch
index 51b7957..f070692 100644
--- a/package/dtc/0002-extra-cflags.patch
+++ b/package/dtc/0002-extra-cflags.patch
@@ -23,7 +23,7 @@  index 962f94eba661..bf6b317158cf 100644
  CPPFLAGS = -I libfdt -I .
 -WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
 +WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
- 	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls
+ 	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
 -CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
 +CFLAGS ?= -g -Os
 +CFLAGS += -fPIC $(WARNINGS)
diff --git a/package/dtc/dtc.hash b/package/dtc/dtc.hash
new file mode 100644
index 0000000..8b3af33
--- /dev/null
+++ b/package/dtc/dtc.hash
@@ -0,0 +1,2 @@ 
+# from https://www.kernel.org/pub/software/utils/dtc/sha256sums.asc
+sha256 77992ad8eac7b68f553d0ba58e5b51604ac803d126196c99e3ae38aaae28bb94  dtc-1.4.1.tar.xz
diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk
index 6fd5064..c96f881 100644
--- a/package/dtc/dtc.mk
+++ b/package/dtc/dtc.mk
@@ -4,7 +4,7 @@ 
 #
 ################################################################################
 
-DTC_VERSION = 1.4.0
+DTC_VERSION = 1.4.1
 DTC_SOURCE = dtc-$(DTC_VERSION).tar.xz
 DTC_SITE = https://www.kernel.org/pub/software/utils/dtc
 DTC_LICENSE = GPLv2+/BSD-2c
@@ -29,8 +29,7 @@  endif
 else # $(BR2_PACKAGE_DTC_PROGRAMS) != y
 
 DTC_BUILD_GOAL = libfdt
-# libfdt_install is our own install rule added by our patch
-DTC_INSTALL_GOAL = libfdt_install
+DTC_INSTALL_GOAL = install-lib
 
 endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y
 
@@ -42,7 +41,7 @@  endef
 
 # For staging, only the library is needed
 define DTC_INSTALL_STAGING_CMDS
-	$(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr libfdt_install
+	$(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr install-lib
 endef
 
 define DTC_INSTALL_TARGET_CMDS