使用Nix通过jemallocator编译jemalloc时,在创建共享库时无法使用重定位R_X86_64_32

问题描述

我正在尝试使用(jemallocator = "0.3.2")。我遇到了这种尝试在带有nix环境的Linux上进行构建的问题(我发现了一个类似的未解决的问题:https://github.com/NixOS/nixpkgs/issues/81197):

../jemalloc/src/malloc_io.c:581:5: note: in expansion of macro 'GET_ARG_NUMERIC'
  581 |     GET_ARG_NUMERIC(val,'p');
      |     ^~~~~~~~~~~~~~~
x86_64-unkNown-linux-musl-ar: `u' modifier ignored since `D' is the default (see `U')
/nix/store/b5cs9wypqyij45qn6nwrlxdm4hvnfc3i-x86_64-unkNown-linux-musl-binutils-2.31.1/bin/x86_64-unkNown-linux-musl-ld: /nix/store/vy9bz2k0qc1vj5p5wkk86vc79yf0bwcl-x86_64-unkNown-linux-musl-stage-final-gcc-debug-9.2.0/lib/gcc/x86_64-unkNown-linux-musl/9.2.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/b5cs9wypqyij45qn6nwrlxdm4hvnfc3i-x86_64-unkNown-linux-musl-binutils-2.31.1/bin/x86_64-unkNown-linux-musl-ld: /nix/store/vy9bz2k0qc1vj5p5wkk86vc79yf0bwcl-x86_64-unkNown-linux-musl-stage-final-gcc-debug-9.2.0/lib/gcc/x86_64-unkNown-linux-musl/9.2.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
/nix/store/b5cs9wypqyij45qn6nwrlxdm4hvnfc3i-x86_64-unkNown-linux-musl-binutils-2.31.1/bin/x86_64-unkNown-linux-musl-ld: final link Failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile:387: lib/libjemalloc.so.2] Error 1
make: *** Waiting for unfinished jobs....
thread 'main' panicked at 'command did not execute successfully: "make" "srcroot=../jemalloc/" "-j" "16"
expected success,got: exit code: 2',build.rs:392:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

builder for '/nix/store/kgs2bcmaf4d45dclpn1b4zn6xx8wp3vz-crate-jemalloc-sys-0.3.2-x86_64-unkNown-linux-musl.drv' Failed with exit code 101

有什么我可以尝试的吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)