Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use a custom strip path? #111

Closed
Dreamacro opened this issue Mar 14, 2023 · 6 comments
Closed

Is it possible to use a custom strip path? #111

Dreamacro opened this issue Mar 14, 2023 · 6 comments

Comments

@Dreamacro
Copy link

Because the strip in SDKROOT sucks, it will fail to strip when building aarch64-apple-darwin/x86_64-apple-darwin. llvm-strip works well.

warning: stripping debug info with `strip` failed: exit status: 1
  |
  = note: /Library/Developer/CommandLineTools/usr/bin/strip: fatal error: file not in an order that can be processed (function starts data out of place): /Users/dreamacro/Dev/projects/****/target/x86_64-apple-darwin/release/deps/ctl-274200c28898526f

I tried to use TARGET_STRIP=llvm-strip cargo zigbuild --release --target universal2-apple-darwin but it doesn't work, is this possible?

@messense
Copy link
Member

strip command is controlled by rustc, so you should raise an issue in rust-lang/rust instead.

@messense messense closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
@Dreamacro
Copy link
Author

But the warning only appears in zigbuild.

cargo build --release --target x86_64-apple-darwin works well and have been strip.

cargo zigbuild --release --target x86_64-apple-darwin emit strip warning and binary not strip

@messense
Copy link
Member

Probably because your default sdk is from CLT not Xcode, xcrun --show-sdk-path --sdk macosx should give some hints.

And if cargo build works for you, then you don't need to use cargo zigbuild for this target, right?

@Dreamacro
Copy link
Author

Yes, I just used CLT. The reason I want to use zigbuild is that universal2-apple-darwin, which is easier than merging manually.

@messense
Copy link
Member

Maybe you can try SDKROOT="" cargo zigbuild to opt out of using the CLT SDK, but I'm not sure if it works.

@Dreamacro
Copy link
Author

Maybe you can try SDKROOT="" cargo zigbuild to opt out of using the CLT SDK, but I'm not sure if it works.

It doesn't work. But thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants