summaryrefslogtreecommitdiff
path: root/gnu/packages/boost.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2025-11-29 10:21:53 +0100
committerAndreas Enge <andreas@enge.fr>2025-11-29 17:15:04 +0100
commit5270da7968689f53b8e3c4e5f4bebf47af426914 (patch)
treee9d4185190c4d5672feb2766525c6e9ab029e8db /gnu/packages/boost.scm
parent2efb4f3bd48abac4a44b3f434bc8b269032d7619 (diff)
gnu: boost: Fix build on non-x86_64 non-mingw32.
* gnu/packages/boost.scm (boost)[arguments]<#:make-flags>: Fix build. (boost-1.83)[arguments]<#:make-flags>: Keep constant. Fixes: guix/guix#4541 Change-Id: I619eadeacd3b1bf1c8b2c537f445c7e74ceeb127 Signed-off-by: Andreas Enge <andreas@enge.fr>
Diffstat (limited to 'gnu/packages/boost.scm')
-rw-r--r--gnu/packages/boost.scm74
1 files changed, 69 insertions, 5 deletions
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 282bfce574c..bad7f79fda5 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -126,16 +126,54 @@
"binary-format=elf"
"target-os=linux"
#$@(cond
+ ((string-prefix? "x86_64" (%current-target-system))
+ #~()) ; Implies boost.stacktrace.from_exception=on
+ ;;; Note: With llvm's libc++, enabling that for
+ ;;; non-x86_64 non-mingw32 would be a bad idea.
+ ;;; libc++'s backtrace is not thread-safe and
+ ;;; would leak then.
+ ;;;
+ ;;; We disable it here completely. Alternatively,
+ ;;; we could disable it only if the user used
+ ;;; (package-with-c-toolchain ... clang) or
+ ;;; otherwise has libc++ in their dependencies.
+ ;;;
+ ;;; In the latter case, we would have to set
+ ;;; BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK
+ ;;; and that seems ill-advised (if a future
+ ;;; update broke it in other ways, we would
+ ;;; be blind to it).
+ ;;;
+ ;;; See also:
+ ;;; <https://codeberg.org/guix/guix/issues/4541>.
((string-prefix? "arm" (%current-target-system))
#~("abi=aapcs"
"address-model=32"
- "architecture=arm"))
+ "architecture=arm"
+ ;; See also:
+ ;; <https://codeberg.org/guix/guix/issues/4541>.
+ "boost.stacktrace.from_exception=off"))
((string-prefix? "aarch64" (%current-target-system))
#~("abi=aapcs"
"address-model=64"
- "architecture=arm"))
- (else #~())))
- #~()))
+ "architecture=arm"
+ ;; See also:
+ ;; <https://codeberg.org/guix/guix/issues/4541>.
+ "boost.stacktrace.from_exception=off"))
+ (else
+ ;; See also:
+ ;; <https://codeberg.org/guix/guix/issues/4541>.
+ #~("boost.stacktrace.from_exception=off"))))
+ ;; Not cross-compiling.
+ #~(#$@(cond
+ ((string-suffix? "mingw32" (%current-system))
+ #~()) ; Implies boost.stacktrace.from_exception=on
+ ((string-prefix? "x86_64" (%current-system))
+ #~()) ; Implies boost.stacktrace.from_exception=on
+ (else
+ ;; See also:
+ ;; <https://codeberg.org/guix/guix/issues/4541>.
+ #~("boost.stacktrace.from_exception=off"))))))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-shells
@@ -217,7 +255,33 @@ across a broad spectrum of applications.")
(patch-flags '("-p2"))
(sha256
(base32
- "13iviiwk1srpw9dmiwabkxv56v0pl0zggjp8zxy1419k5zzfsy34")))))))
+ "13iviiwk1srpw9dmiwabkxv56v0pl0zggjp8zxy1419k5zzfsy34"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments boost)
+ ((#:make-flags _ #f)
+ #~(list "threading=multi" "link=shared"
+ ;; Set the RUNPATH to $libdir so that the libs find each other.
+ (string-append "linkflags=-Wl,-rpath="
+ #$output "/lib")
+ #$@(if (%current-target-system)
+ #~("--user-config=user-config.jam"
+ ;; Python is not supported when cross-compiling.
+ "--without-python"
+ "binary-format=elf"
+ "target-os=linux"
+ #$@(cond
+ ((string-prefix? "arm" (%current-target-system))
+ #~("abi=aapcs"
+ "address-model=32"
+ "architecture=arm"))
+ ((string-prefix? "aarch64" (%current-target-system))
+ #~("abi=aapcs"
+ "address-model=64"
+ "architecture=arm"))
+ (else
+ #~())))
+ ;; Not cross-compiling.
+ #~()))))))))
(define-deprecated-package boost-with-python3
boost)