clux/muslrust

ring and rocket fails to link on >xenial or stretch

clux opened this issue · 3 comments

clux commented

ring complains about relocations of their C objects even though i've tried forking and adding fPIC.

zesty/stretch validate this (think they link with -pie), and thus we can't upgrade from xenial yet.

clux commented

bionic also fails to link latest rocket because of ring:

  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen0.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen1.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen10.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen11.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen12.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen13.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen14.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen15.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen2.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen3.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen4.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen5.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen6.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen7.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen8.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.rocket_codegen9.rcgu.o" "-o" "/volume/target/debug/deps/librocket_codegen-88aa9866e3734d6e.so" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.crate.metadata.rcgu.o" "/volume/target/debug/deps/rocket_codegen-88aa9866e3734d6e.crate.allocator.rcgu.o" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/volume/target/debug/deps" "-L" "/volume/target/debug/build/ring-bfb7485a1958978f/out" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/librocket-74bb06e2087e261c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libisatty-0e4856dcc16393bd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libordermap-e47955ad7f20620d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libsmallvec-e7d822259149fb61.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libbase64-86602bc6536229c0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libmemchr-1785e33c15c3957a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libcookie-ea9c9a5e7374841b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libuntrusted-fa29d8dcb418b296.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liblazy_static-73bf6432e1cad2e2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libstate-94b0d0df4be62961.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libtoml-155d6cfa30d59996.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libserde-861c316b61e9ca7f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libhyper-c46c83e4163c5e99.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libmime-3439ec5ade4e1e2d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liblanguage_tags-e0d9b447c0c006c0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libtypeable-becea457de1958f5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libtraitobject-cf6bb093452b8e83.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libnum_cpus-54f1b059d66d27bd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libhttparse-07c878211648ec4b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libunicase-3090ce844b65f789.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liburl-d13ffadea870be9c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libpercent_encoding-586f420d547529f0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libidna-69a0829d0f22f544.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libunicode_normalization-787ef0b4bfa7d439.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libunicode_bidi-d6bda55077e3d887.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libmatches-253e8a06eb30f942.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libtime-ca32defef0200ac7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liblibc-937ca03b9dac64cf.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libbase64-474aefb1751697e1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libsafemem-e5aba53a48166cd8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libbyteorder-b260c20594fa9dd0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libyansi-db1af55d917aa31a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libpear-c1ff9633b8be33a8.rlib" "-Wl,--no-whole-archive" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-l" "rustc_plugin-69a3f5521c013328" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_metadata-ca6822472e158f92" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc-247e86773d872dc5" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "test-b97169218306e560" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "term-8d2c8ece622ccb12" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "graphviz-4d64b7b7e3a41937" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax_ext-d0195b25637aa56b" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "proc_macro-f01326a906a322b4" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "fmt_macros-d604dacc44fe339d" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax-fd17734880d28b72" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_target-abe1a46597cf397b" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_errors-18078231f70c7797" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax_pos-f104bb4828af9536" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "arena-ed3270c8e405ef11" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_data_structures-454fb8ff18e2d00f" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_cratesio_shim-69ecc19e7d66dd35" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "serialize-bebb36fd682209b7" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liblog-18a65be0b6f0cd04.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/liblog-229629816f145e42.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.YAJZXydnAB2U/libcfg_if-36682b24771d0ef1.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-l" "std-f4d242af1617f48c" "-Wl,--end-group" "-Wl,-Bstatic" "/tmp/rustc.YAJZXydnAB2U/libcompiler_builtins-183a31824d10e315.rlib" "-Wl,-Bdynamic" "-l" "util" "-l" "util" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-shared"
  = note: /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(constant_time_test.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(exponentiation.o): relocation R_X86_64_32 against `.rodata.__func__.2270' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(generic.o): relocation R_X86_64_32 against `.rodata.__func__.1961' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(montgomery.o): relocation R_X86_64_32 against `.rodata.__func__.2239' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(montgomery_inv.o): relocation R_X86_64_32 against `.rodata.__func__.1941' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(mul.o): relocation R_X86_64_32 against `.rodata.__func__.2031' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(e_aes.o): relocation R_X86_64_32 against hidden symbol `GFp_aesni_set_encrypt_key' can not be used when making a shared object
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(curve25519.o): relocation R_X86_64_32 against `.rodata.zero.2616' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(ecp_nistz.o): relocation R_X86_64_32 against `.rodata.__func__.1932' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.__func__.2059' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(gfp_p384.o): relocation R_X86_64_32 against `.rodata.__func__.2072' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(limbs.o): relocation R_X86_64_32 against `.rodata.__func__.1910' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/x86_64-linux-gnu-ld: /tmp/rustc.YAJZXydnAB2U/libring-dd6b4b9061ed0a41.rlib(gcm.o): relocation R_X86_64_32S against hidden symbol `GFp_aesni_ctr32_encrypt_blocks' can not be used when making a shared object
          /usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
          collect2: error: ld returned 1 exit status
clux commented

Tried bumping to theri latest rc 0.5.0-rc.1 to see how the situation is today:

     Running `rustc --crate-name rocketcrate src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=1502bbfe864a18d6 -C extra-filename=-1502bbfe864a18d6 --out-dir /home/clux/repos/muslrust/test/rocketcrate/target/debug/deps -C incremental=/home/clux/repos/muslrust/test/rocketcrate/target/debug/incremental -L dependency=/home/clux/repos/muslrust/test/rocketcrate/target/debug/deps --extern rocket=/home/clux/repos/muslrust/test/rocketcrate/target/debug/deps/librocket-219d0ebcc64f1aaa.rlib`
error: could not compile `rocketcrate`

Caused by:
  process didn't exit successfully: `rustc --crate-name rocketcrate src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=1502bbfe864a18d6 -C extra-filename=-1502bbfe864a18d6 --out-dir /home/clux/repos/muslrust/test/rocketcrate/target/debug/deps -C incremental=/home/clux/repos/muslrust/test/rocketcrate/target/debug/incremental -L dependency=/home/clux/repos/muslrust/test/rocketcrate/target/debug/deps --extern rocket=/home/clux/repos/muslrust/test/rocketcrate/target/debug/deps/librocket-219d0ebcc64f1aaa.rlib` (exit status: 1)

An even more obtuse error. Going to keep leaving rocket tests out, but have bumped the code at least.

clux commented

ok, had a go at upgrading today and rocket just doesn't compile at all.
they are still in rc (rc2 now) and their example program on their webpage does not compile with that rc..

going to remove rocket from CI because it's not the main framework people really want to jump on (compared to actix or even axum) despite its amazing early progress.

removing this also unblocks upgrades.
have been able to build against 22.04 LTS ubuntu (jammy) and everything else seems to work fine.