From d2f4d2e3b50c6669b14c8797aca675a825b77a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 11 Sep 2021 16:23:09 +0200 Subject: [PATCH] also build with clang --- flake.nix | 15 +++++++++------ patchelf.nix | 8 ++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 patchelf.nix diff --git a/flake.nix b/flake.nix index 0f9dc0e..7ce2224 100644 --- a/flake.nix +++ b/flake.nix @@ -23,18 +23,13 @@ { overlay = final: prev: { - patchelf-new = final.stdenv.mkDerivation { - pname = "patchelf"; + patchelf-new = final.callPackage ./patchelf.nix { inherit version; src = self; - nativeBuildInputs = [ final.autoreconfHook ]; - doCheck = true; }; - }; hydraJobs = { - tarball = pkgs.releaseTools.sourceTarball rec { name = "patchelf-tarball"; @@ -58,7 +53,13 @@ build = forAllSystems (system: nixpkgsFor.${system}.patchelf-new); build-sanitized = forAllSystems (system: nixpkgsFor.${system}.patchelf-new.overrideAttrs (old: { configureFlags = [ "--with-asan " "--with-ubsan" ]; + # -Wno-unused-command-line-argument is for clang, which does not like + # our cc wrapper arguments + CFLAGS = "-Werror -Wno-unused-command-line-argument"; })); + build-sanitized-clang = forAllSystems (system: self.hydraJobs.build-sanitized.${system}.override { + stdenv = pkgs.libcxxStdenv; + }); release = pkgs.releaseTools.aggregate { name = "patchelf-${self.hydraJobs.tarball.version}"; @@ -68,6 +69,8 @@ self.hydraJobs.build.i686-linux self.hydraJobs.build-sanitized.x86_64-linux self.hydraJobs.build-sanitized.i686-linux + self.hydraJobs.build-sanitized-clang.x86_64-linux + self.hydraJobs.build-sanitized-clang.i686-linux ]; meta.description = "Release-critical builds"; }; diff --git a/patchelf.nix b/patchelf.nix new file mode 100644 index 0000000..fdeba6b --- /dev/null +++ b/patchelf.nix @@ -0,0 +1,8 @@ +{ stdenv, autoreconfHook, version, src }: + +stdenv.mkDerivation { + pname = "patchelf"; + inherit version src; + nativeBuildInputs = [ autoreconfHook ]; + doCheck = true; +}