Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909366 - sys-apps/dtc-1.7.0: Meson build fail with USE=static-libs
Summary: sys-apps/dtc-1.7.0: Meson build fail with USE=static-libs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-06-29 08:31 UTC by Ivan J.
Modified: 2025-05-06 17:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge.info (file_909366.txt,19.18 KB, text/plain)
2023-06-29 08:32 UTC, Ivan J.
Details
build.log (file_909366.txt,3.75 KB, text/plain)
2023-06-29 08:33 UTC, Ivan J.
Details
meson-log.txt (file_909366.txt,16.03 KB, text/plain)
2023-06-29 08:33 UTC, Ivan J.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan J. 2023-06-29 08:31:37 UTC
The package fails to compile with USE=static-libs with:

libfdt/meson.build:37:11: 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]
emerge.info
Comment 3 Ivan J. 2023-06-29 08:33:32 UTC
Created attachment 864803 [details]
build.log
Comment 4 Ivan J. 2023-06-29 08:33:49 UTC
Created attachment 864804 [details]
meson-log.txt
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)
 		-Dtools=true
 		-Dvalgrind=disabled # only used for some tests
 		$(meson_feature python)
 		$(meson_feature yaml)
 	)
 
+	use static-libs && emesonargs+=( -Dstatic-build=true )
+
 	meson_src_configure
 }
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):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0428966db63c13fc0142f0500e5c44895793eb37

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

    sys-apps/dtc: fix static build
    
    Closes: https://bugs.gentoo.org/909366
    Thanks-to: Jason A. Donenfeld <zx2c4@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/dtc/dtc-1.7.0.ebuild | 4 +++-
 sys-apps/dtc/dtc-9999.ebuild  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
Comment 9 Larry the Git Cow gentoo-dev 2025-05-06 17:41:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=719e0d13b5f3914483c6d531c7f7abe69baba601

commit 719e0d13b5f3914483c6d531c7f7abe69baba601
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2025-05-06 16:50:20 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2025-05-06 17:40:29 +0000

    sys-apps/dtc: fix USE=static-libs to control static libs
    
    ... as opposed to passing an upstream option to enable building
    executables with `LDFLAGS="-static"`, while still installing the static
    libs.
    
    Bug: https://bugs.gentoo.org/909366
    Closes: https://bugs.gentoo.org/907940
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 sys-apps/dtc/{dtc-1.7.2-r1.ebuild => dtc-1.7.2-r2.ebuild} | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4aca471832025475b501896d8c778b0b4489ae5

commit f4aca471832025475b501896d8c778b0b4489ae5
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2025-05-06 16:38:41 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2025-05-06 17:40:28 +0000

    Revert "sys-apps/dtc: fix static build"
    
    This reverts commit 0428966db63c13fc0142f0500e5c44895793eb37.
    
    At least, revert it in live. The entire commit was totally bogus. The
    build option in question just determined whether to build using
    LDFLAGS="-static". Upstream didn't support building without static libs
    at all, until
    
    https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=dd1b3e532d228ed75d34480ee539f71b76a4fa89
    
    so the correct solution to support USE=static-libs was always, rm the
    file after the fact.
    
    But now that it is correctly supported in live we can go back to the
    original intention.
    
    Bug: https://bugs.gentoo.org/907940
    Bug: https://bugs.gentoo.org/909366
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 sys-apps/dtc/dtc-9999.ebuild | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)