Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 909366

Summary: sys-apps/dtc-1.7.0: Meson build fail with USE=static-libs
Product: Gentoo Linux Reporter: Ivan J. <parazyd>
Component: Current packagesAssignee: Luca Barbato <lu_zero>
Severity: normal CC: embedded, lu_zero, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Ivan J. 2023-06-29 08:31:37 UTC
The package fails to compile with USE=static-libs with:

libfdt/ ERROR: Tried to create target "fdt", but a target of that name already exists.

build.log and meson-log.txt attached.

Reproducible: Always

Steps to Reproduce:
1. emerge =sys-apps/dtc-1.7.0
Actual Results:  
The build fails.

Expected Results:  
The build should complete without errors.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-29 08:32:45 UTC
Please include the full build.log, meson-log.txt, amd emerge --info.
Comment 2 Ivan J. 2023-06-29 08:32:51 UTC
Created attachment 864802 [details]
Comment 3 Ivan J. 2023-06-29 08:33:32 UTC
Created attachment 864803 [details]
Comment 4 Ivan J. 2023-06-29 08:33:49 UTC
Created attachment 864804 [details]
Comment 5 Edward Kigwana 2023-06-29 14:43:26 UTC
I am also experiencing this exact build problem
Comment 6 Jason A. Donenfeld gentoo-dev 2023-09-23 00:15:30 UTC
Also seeing this since a while.
Comment 7 Jason A. Donenfeld gentoo-dev 2023-09-23 00:20:32 UTC
Here's a diff that'll fix it. @lu_zero - Lemme know if you want me to commit it.

diff --git a/sys-apps/dtc/dtc-1.7.0.ebuild b/sys-apps/dtc/dtc-1.7.0.ebuild
index a56040b060aa..4c213fb685de 100644
--- a/sys-apps/dtc/dtc-1.7.0.ebuild
+++ b/sys-apps/dtc/dtc-1.7.0.ebuild
@@ -63,12 +63,13 @@ src_prepare() {
 src_configure() {
 	local emesonargs=(
-		-Ddefault_library=$(usex static-libs both shared)
 		-Dvalgrind=disabled # only used for some tests
 		$(meson_feature python)
 		$(meson_feature yaml)
+	use static-libs && emesonargs+=( -Dstatic-build=true )
Comment 8 Larry the Git Cow gentoo-dev 2023-09-25 02:21:35 UTC
The bug has been closed via the following commit(s):

commit 0428966db63c13fc0142f0500e5c44895793eb37
Author:     Sam James <>
AuthorDate: 2023-09-25 02:19:33 +0000
Commit:     Sam James <>
CommitDate: 2023-09-25 02:19:33 +0000

    sys-apps/dtc: fix static build
    Thanks-to: Jason A. Donenfeld <>
    Signed-off-by: Sam James <>

 sys-apps/dtc/dtc-1.7.0.ebuild | 4 +++-
 sys-apps/dtc/dtc-9999.ebuild  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)