Skip to contentSkip to conversation

package/dtc: do not install headers for the host version

PATCH New unixmania at gmail.com 3 participants 5 messages Nov 2, 2019 – Nov 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/dtc: do not install headers for the host version

From: Carlos Santos <[email protected]>

None of the packages that depend on host-dtc need the headers and they interfere with the build of the kernel, as in beaglebone:

2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts
2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts/dtc need-builtin=
2019-11-01T22:23:16 (cat /dev/null; ) > scripts/dtc/modules.order
2019-11-01T22:23:16 /usr/bin/gcc -O2 -I/work/beaglebone/host/include -L/work/beaglebone/host/lib -Wl,-rpath,/work/beaglebone/host/lib -Wp,-MD,scripts/dtc/libfdt/.fdt_ro.o.d -Wall -Wmissing-prototypes -Wstrict-p>
2019-11-01T22:23:16 scripts/dtc/libfdt/fdt_ro.c:92:10: error: redefinition of ?fdt_get_max_phandle?
2019-11-01T22:23:16 uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 In file included from scripts/dtc/libfdt/fdt_ro.c:54:
2019-11-01T22:23:16 /work/beaglebone/host/include/libfdt.h:384:24: note: previous definition of ?fdt_get_max_phandle? was here
2019-11-01T22:23:16 static inline uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 make[4]: *** [scripts/Makefile.host:107: scripts/dtc/libfdt/fdt_ro.o] Error 1
2019-11-01T22:23:16 make[3]: *** [scripts/Makefile.build:544: scripts/dtc] Error 2
2019-11-01T22:23:16 make[2]: *** [Makefile:1066: scripts] Error 2
2019-11-01T22:23:16 make[1]: *** [package/pkg-generic.mk:241: /work/beaglebone/build/linux-4dae378bbe721277b08699d1d88ffae12acc9b09/.stamp_built] Error 2
---
 package/dtc/dtc.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dtc/dtc.mk +1 -1
index 7fde0dc968..35ac0b332b 100644
@@ -68,7 +68,7 @@ define HOST_DTC_BUILD_CMDS
 endef
 
 define HOST_DTC_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install-bin install-lib
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 package/dtc: do not install headers for the host version

Hello Carlos,

Quoted 4 lines · unixmania at gmail.com

From: Carlos Santos <[email protected]>

None of the packages that depend on host-dtc need the headers and they interfere with the build of the kernel, as in beaglebone:

I was also looking at that particular build failure, but the solution I had in mind was to disable the compilation of the dtc shipped with the Kernel when host-dtc is selected.

I'm wondering if some users might actually be using the libfdt + headers for their own EXTERNAL packages.

Quoted 28 lines
2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts
2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts/dtc need-builtin=
2019-11-01T22:23:16 (cat /dev/null; ) > scripts/dtc/modules.order
2019-11-01T22:23:16 /usr/bin/gcc -O2 -I/work/beaglebone/host/include -L/work/beaglebone/host/lib -Wl,-rpath,/work/beaglebone/host/lib -Wp,-MD,scripts/dtc/libfdt/.fdt_ro.o.d -Wall -Wmissing-prototypes -Wstrict-p>
2019-11-01T22:23:16 scripts/dtc/libfdt/fdt_ro.c:92:10: error: redefinition of ?fdt_get_max_phandle?
2019-11-01T22:23:16 uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 In file included from scripts/dtc/libfdt/fdt_ro.c:54:
2019-11-01T22:23:16 /work/beaglebone/host/include/libfdt.h:384:24: note: previous definition of ?fdt_get_max_phandle? was here
2019-11-01T22:23:16 static inline uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 make[4]: *** [scripts/Makefile.host:107: scripts/dtc/libfdt/fdt_ro.o] Error 1
2019-11-01T22:23:16 make[3]: *** [scripts/Makefile.build:544: scripts/dtc] Error 2
2019-11-01T22:23:16 make[2]: *** [Makefile:1066: scripts] Error 2
2019-11-01T22:23:16 make[1]: *** [package/pkg-generic.mk:241: /work/beaglebone/build/linux-4dae378bbe721277b08699d1d88ffae12acc9b09/.stamp_built] Error 2
---
  package/dtc/dtc.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
package/dtc/dtc.mk +0 -0
index 7fde0dc968..35ac0b332b 100644

package/dtc/dtc.mk define HOST_DTC_BUILD_CMDS · line 74

Quoted 8 lines
package/dtc/dtc.mk +1 -1
@@ -68,7 +68,7 @@ define HOST_DTC_BUILD_CMDS
  endef
 
  define HOST_DTC_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install-bin install-lib
  endef
 
  $(eval $(generic-package))

Regards,

Titouan

#2 lore raw

PATCH 1/1 package/dtc: do not install headers for the host version

In reply to unixmania at gmail.com

Carlos, All,

On 2019-11-02 09:29 -0300, unixmania at gmail.com spake thusly:

Quoted 3 lines

From: Carlos Santos <[email protected]>

None of the packages that depend on host-dtc need the headers and they

That's not the case with host-qemu, with system emulation enabled:

    $ cat defconfig
    BR2_arm=y
    BR2_cortex_a7=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_INIT_NONE=y
    BR2_SYSTEM_BIN_SH_NONE=y
    # BR2_PACKAGE_BUSYBOX is not set
    # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
    # BR2_TARGET_ROOTFS_TAR is not set
    BR2_PACKAGE_HOST_QEMU=y
    BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
    $ make >build.log 2>&1
    $ grep 'fdt support'

With master:
fdt support system

With your patch:
fdt support git

So this patch means that host-qemu now uses its bundled copy rather than the one installed by host-dtc.

Now, whether we prefer that to the current mess, let's see...

Regards,
Yann E. MORIN.

Quoted 43 lines

interfere with the build of the kernel, as in beaglebone:

2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts
2019-11-01T22:23:16 /usr/bin/make -f ./scripts/Makefile.build obj=scripts/dtc need-builtin=
2019-11-01T22:23:16 (cat /dev/null; ) > scripts/dtc/modules.order
2019-11-01T22:23:16 /usr/bin/gcc -O2 -I/work/beaglebone/host/include -L/work/beaglebone/host/lib -Wl,-rpath,/work/beaglebone/host/lib -Wp,-MD,scripts/dtc/libfdt/.fdt_ro.o.d -Wall -Wmissing-prototypes -Wstrict-p>
2019-11-01T22:23:16 scripts/dtc/libfdt/fdt_ro.c:92:10: error: redefinition of ?fdt_get_max_phandle?
2019-11-01T22:23:16 uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 In file included from scripts/dtc/libfdt/fdt_ro.c:54:
2019-11-01T22:23:16 /work/beaglebone/host/include/libfdt.h:384:24: note: previous definition of ?fdt_get_max_phandle? was here
2019-11-01T22:23:16 static inline uint32_t fdt_get_max_phandle(const void *fdt)
2019-11-01T22:23:16 ^~~~~~~~~~~~~~~~~~~
2019-11-01T22:23:16 make[4]: *** [scripts/Makefile.host:107: scripts/dtc/libfdt/fdt_ro.o] Error 1
2019-11-01T22:23:16 make[3]: *** [scripts/Makefile.build:544: scripts/dtc] Error 2
2019-11-01T22:23:16 make[2]: *** [Makefile:1066: scripts] Error 2
2019-11-01T22:23:16 make[1]: *** [package/pkg-generic.mk:241: /work/beaglebone/build/linux-4dae378bbe721277b08699d1d88ffae12acc9b09/.stamp_built] Error 2
---
 package/dtc/dtc.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dtc/dtc.mk +1 -1
index 7fde0dc968..35ac0b332b 100644
@@ -68,7 +68,7 @@ define HOST_DTC_BUILD_CMDS
 endef
 
 define HOST_DTC_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install-bin install-lib
 endef
 
 $(eval $(generic-package))
Signature · 6 lines
2.18.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/dtc: do not install headers for the host version

Quoted 29 lines · Yann E. MORIN

Carlos, All,

On 2019-11-02 09:29 -0300, unixmania at gmail.com spake thusly:

Quoted 3 lines

From: Carlos Santos <[email protected]>

None of the packages that depend on host-dtc need the headers and they

That's not the case with host-qemu, with system emulation enabled:

    $ cat defconfig
    BR2_arm=y
    BR2_cortex_a7=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_INIT_NONE=y
    BR2_SYSTEM_BIN_SH_NONE=y
    # BR2_PACKAGE_BUSYBOX is not set
    # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
    # BR2_TARGET_ROOTFS_TAR is not set
    BR2_PACKAGE_HOST_QEMU=y
    BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
    $ make >build.log 2>&1
    $ grep 'fdt support'

With master:
fdt support system

Quoted 7 lines

With your patch:
fdt support git

So this patch means that host-qemu now uses its bundled copy rather than the one installed by host-dtc.

Now, whether we prefer that to the current mess, let's see...

The bundled dtc code is not so old (v1.4.7) and is probably the one with which qemu is tested so I don't think it wold be a real problem.

Titouan Christophe (in CC) was looking for an alternate approach, disabling the compilation of the dtc shipped with the Kernel when host-dtc is selected. Let's wait for the results.

Signature · 1 line
Carlos Santos <[email protected]>
#4 lore raw

PATCH 1/1 package/dtc: do not install headers for the host version

In reply to unixmania at gmail.com

Carlos, All,

On 2019-11-02 09:29 -0300, unixmania at gmail.com spake thusly:

Quoted 1 line

From: Carlos Santos <[email protected]>

[--SNIP--]

package/dtc/dtc.mk define HOST_DTC_BUILD_CMDS · line 71

Quoted 3 lines

define HOST_DTC_INSTALL_CMDS

package/dtc/dtc.mk +1 -1
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install-bin install-lib

Besides the fact that some host packages do require the headers (as explained in my previous reply), there is a more profound issue here:
what is even the point in installing the library if its headers are not installed?

Either the library is used, in which case we have to also install the headers, or the library is not used, in which case we should just install the program(s).

But the library is used by external programs, like host-qemu, and maybe also by programs in br2-external trees.

So, I'm even less convinced by this change now than I was yesterday...

Regards,
Yann E. MORIN.

Quoted 10 lines

endef

$(eval $(generic-package))

Signature · 6 lines
2.18.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'