glibc: expose enableCET as overridable argument, default "permissive"
this should be a gentler way to introduce CET-compiled binaries into general usage
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
, withLinuxHeaders ? false
|
||||
, profilingLibraries ? false
|
||||
, withGd ? false
|
||||
, enableCET ? false
|
||||
, extraBuildInputs ? []
|
||||
, extraNativeBuildInputs ? []
|
||||
, ...
|
||||
@@ -154,9 +155,9 @@ stdenv.mkDerivation ({
|
||||
# and on aarch64 with binutils 2.30 or later.
|
||||
# https://sourceware.org/glibc/wiki/PortStatus
|
||||
"--enable-static-pie"
|
||||
] ++ lib.optionals stdenv.hostPlatform.isx86_64 [
|
||||
] ++ lib.optionals (enableCET != false) [
|
||||
# Enable Intel Control-flow Enforcement Technology (CET) support
|
||||
"--enable-cet"
|
||||
"--enable-cet${if builtins.isString enableCET then "=${enableCET}" else ""}"
|
||||
] ++ lib.optionals withLinuxHeaders [
|
||||
"--enable-kernel=3.10.0" # RHEL 7 and derivatives, seems oldest still supported kernel
|
||||
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
@@ -208,7 +209,7 @@ stdenv.mkDerivation ({
|
||||
passthru = { inherit version; minorRelease = version; };
|
||||
}
|
||||
|
||||
// (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" "makeFlags" ]) //
|
||||
// (removeAttrs args [ "withLinuxHeaders" "withGd" "enableCET" "postInstall" "makeFlags" ]) //
|
||||
|
||||
{
|
||||
src = fetchurl {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
, withLinuxHeaders ? true
|
||||
, profilingLibraries ? false
|
||||
, withGd ? false
|
||||
, enableCET ? if stdenv.hostPlatform.isx86_64 then "permissive" else false
|
||||
, pkgsBuildBuild
|
||||
, libgcc
|
||||
}:
|
||||
@@ -15,7 +16,7 @@ let
|
||||
in
|
||||
|
||||
(callPackage ./common.nix { inherit stdenv; } {
|
||||
inherit withLinuxHeaders withGd profilingLibraries;
|
||||
inherit withLinuxHeaders withGd profilingLibraries enableCET;
|
||||
pname = "glibc" + lib.optionalString withGd "-gd" + lib.optionalString (stdenv.cc.isGNU && libgcc==null) "-nolibgcc";
|
||||
}).overrideAttrs(previousAttrs: {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user