guix: combine glibc hardening options into hardened-glibc

This commit is contained in:
fanquake
2023-01-26 10:30:41 +00:00
parent c49f2b8eb5
commit d5d4b75840

View File

@@ -147,7 +147,7 @@ chain for " target " development."))
#:key #:key
(base-gcc-for-libc base-gcc) (base-gcc-for-libc base-gcc)
(base-kernel-headers base-linux-kernel-headers) (base-kernel-headers base-linux-kernel-headers)
(base-libc (make-glibc-with-stack-protector (make-glibc-with-bind-now (make-glibc-without-werror glibc-2.27)))) (base-libc (hardened-glibc (make-glibc-without-werror glibc-2.27)))
(base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc)))) (base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc))))
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values "Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building Bitcoin Core release binaries." desirable for building Bitcoin Core release binaries."
@@ -537,11 +537,12 @@ inspecting signatures in Mach-O binaries.")
(define (make-glibc-without-werror glibc) (define (make-glibc-without-werror glibc)
(package-with-extra-configure-variable glibc "enable_werror" "no")) (package-with-extra-configure-variable glibc "enable_werror" "no"))
(define (make-glibc-with-stack-protector glibc) ;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
(package-with-extra-configure-variable glibc "--enable-stack-protector" "all")) (define (hardened-glibc glibc)
(package-with-extra-configure-variable (
(define (make-glibc-with-bind-now glibc) package-with-extra-configure-variable glibc
(package-with-extra-configure-variable glibc "--enable-bind-now" "yes")) "--enable-stack-protector" "all")
"--enable-bind-now" "yes"))
(define-public glibc-2.27 (define-public glibc-2.27
(package (package