Skip to content

Commit

Permalink
Merge bitcoin#27326: guix: combine and document enable_werror
Browse files Browse the repository at this point in the history
4becee3 guix: combine and document enable_werror (fanquake)

Pull request description:

  Combine into `hardened-glibc`.
  Document why we don't use `--disable-werror` directly.

  https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
  > By default, the GNU C Library is built with -Werror. If you wish
  > to build without this option (for example, if building with a
  > newer version of GCC than this version of the GNU C Library was
  > tested with, so new warnings cause the build with -Werror to fail),
  > you can configure with --disable-werror.

ACKs for top commit:
  hebasto:
    ACK 4becee3, the diff is correct.
  TheCharlatan:
    ACK 4becee3

Tree-SHA512: 8724415f51b4d72d40c4e797faf52c93a81147fb629332b9388ffd7f113f2b16db3b7496bf3063dd978ac629fd5bde3ec7df4f1ff1ed714cb56f316a9334d119
  • Loading branch information
fanquake authored and PastaPastaPasta committed Jan 24, 2024
1 parent 1568a5d commit 933c4f5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ chain for " target " development."))
#:key
(base-gcc-for-libc base-gcc)
(base-kernel-headers base-linux-kernel-headers)
(base-libc (hardened-glibc (make-glibc-without-werror glibc-2.28)))
(base-libc (hardened-glibc glibc-2.28))
(base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc))))
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building Dash Core release binaries."
Expand Down Expand Up @@ -495,15 +495,16 @@ and endian independent.")
inspecting signatures in Mach-O binaries.")
(license license:expat))))

(define (make-glibc-without-werror glibc)
(package-with-extra-configure-variable glibc "enable_werror" "no"))

;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
;; We don't use --disable-werror directly, as that would be passed through to bash,
;; and cause it's build to fail.
(define (hardened-glibc glibc)
(package-with-extra-configure-variable (
package-with-extra-configure-variable glibc
"--enable-stack-protector" "strong")
"--enable-bind-now" "yes"))
package-with-extra-configure-variable (
package-with-extra-configure-variable glibc
"enable_werror" "no")
"--enable-stack-protector" "strong")
"--enable-bind-now" "yes"))

(define-public glibc-2.28
(package
Expand Down

0 comments on commit 933c4f5

Please sign in to comment.