BurntSushi / memchr

Optimized string search routines for Rust.
The Unlicense
873 stars 99 forks source link

Error when building `memchr` with custom rustflags `-static` #97

Closed AsafFisher closed 2 years ago

AsafFisher commented 2 years ago
error: failed to run custom build command for `memchr v2.4.1`

Caused by:
  could not execute process `/mnt/c/Users/asaff/Documents/Dev/Github/tool/target/debug/build/memchr-b9330b1f01949571/build-script-build` (never executed)

Caused by:
  No such file or directory (os error 2)

config:

[build]
rustflags = ["-C", "link-arg=-nostdlib", "-C", "link-arg=-static", "-C", "relocation-model=pic"]

When compiling only with link-arg=-nostdlib I get the follwoing crash:

error: failed to run custom build command for `memchr v2.4.1`

Caused by:
  process didn't exit successfully: `/mnt/c/Users/asaff/Documents/Dev/Github/tool/target/debug/build/memchr-b9330b1f01949571/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
BurntSushi commented 2 years ago

This doesn't look like an issue with memchr specifically? I don't really know what you're doing, nor do I understand the flags you're passing, so I think you're on your own. But like, it's not clear to me that this isn't an environment issue or a rustc issue. If there's a fix that you find that can be applied to memchr, then we can consider that.

BurntSushi commented 2 years ago

Closing due to inactivity. And it's not clear that this is a problem with memchr specifically. (It probably isn't.)