Skip to content

Commit

Permalink
don't pass CFLAGS to underlying compiler
Browse files Browse the repository at this point in the history
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
  • Loading branch information
Konrad Stepniak committed Jan 31, 2025
1 parent 876bc11 commit b8885e4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
30 changes: 30 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, zombienet }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = pkgs.pkgsBuildHost.rust-bin.stable.latest.default;
buildInputs = with pkgs; [
rustToolchain
];
in
with pkgs;
{
devShells.default = mkShell {
inherit buildInputs;
};
}
);
}
17 changes: 3 additions & 14 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,10 @@ fn main() {
println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);
return;
}
// Disable -Wextra warnings - jemalloc doesn't compile free of warnings with
// it enabled: https://github.com/jemalloc/jemalloc/issues/1196
let compiler = cc::Build::new().extra_warnings(false).get_compiler();
let cflags = compiler
.args()
.iter()
.map(|s| s.to_str().unwrap())
.collect::<Vec<_>>()
.join(" ");
info!("CC={:?}", compiler.path());
info!("CFLAGS={:?}", cflags);

let compiler = cc::Build::new().get_compiler();
info!("CC={:?}", compiler.path());

assert!(out_dir.exists(), "OUT_DIR does not exist");
let jemalloc_repo_dir = PathBuf::from("jemalloc");
info!("JEMALLOC_REPO_DIR={:?}", jemalloc_repo_dir);
Expand Down Expand Up @@ -190,9 +182,6 @@ fn main() {
)
.current_dir(&build_dir)
.env("CC", compiler.path())
.env("CFLAGS", cflags.clone())
.env("LDFLAGS", cflags.clone())
.env("CPPFLAGS", cflags)
.arg(format!("--with-version={je_version}"))
.arg("--disable-cxx")
.arg("--enable-doc=no")
Expand Down

0 comments on commit b8885e4

Please sign in to comment.