# CPack strip doesn't work with llvm-strip on macOS

**URL:** https://discourse.cmake.org/t/cpack-strip-doesnt-work-with-llvm-strip-on-macos/7671
**Category:** Usage
**Tags:** os:macos
**Created:** [March 13, 2023, 10:20pm UTC](https://discourse.cmake.org/t/cpack-strip-doesnt-work-with-llvm-strip-on-macos/7671 "2023-03-13T22:20:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dbabokin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dbabokin/32/1930_2.png) [@dbabokin](https://discourse.cmake.org/u/dbabokin)
#### Post date: [March 13, 2023, 10:20pm UTC](https://discourse.cmake.org/t/cpack-strip-doesnt-work-with-llvm-strip-on-macos/7671/1 "2023-03-13T22:20:45Z")

</div>

I’m enabling CPACK\_STRIP\_FILES on macOS and I have manually built llvm toolchain in the path (same is reproducible with official LLVM build - [https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-x86\_64-apple-darwin21.0.tar.xz](https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz)) and CPack finds `llvm-strip` instead of `strip` (which can be picked up either at `/usr/bin/strip` or in the SDK). As a result, I have the following message when building the a package:  
`/Users/dybaboki/tmp/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin/llvm-strip: error: unknown argument '-u'`

Note that the build is “successful”, i.e. CPack ignores this error.

My questions are:

1. Is this behavior that `llvm-strip` is used rather than system/SDK `strip` expected / intended?
2. Is there a way to avoid `llvm-strip` and force `strip` to be used?

And I think it’s worth fixing CPack to treat `llvm-strip` differently, i.e. take into account that `-u` is not supported, as well as fail packaging if strip tool (whatever tool is used) fails, rather than ignore it.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 15, 2023, 1:11am UTC](https://discourse.cmake.org/t/cpack-strip-doesnt-work-with-llvm-strip-on-macos/7671/2 "2023-03-15T01:11:53Z")

</div>

Seems worth [a feature request](https://gitlab.kitware.com/cmake/cmake/-/issues) to me.

---

<div class="post-metadata">

### Author: ![dbabokin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dbabokin/32/1930_2.png) [@dbabokin](https://discourse.cmake.org/u/dbabokin)
#### Post date: [March 15, 2023, 5:32am UTC](https://discourse.cmake.org/t/cpack-strip-doesnt-work-with-llvm-strip-on-macos/7671/3 "2023-03-15T05:32:30Z")

</div>

I’ve created an issue: [https://gitlab.kitware.com/cmake/cmake/-/issues/24601](https://gitlab.kitware.com/cmake/cmake/-/issues/24601)

Also would be good to know what workarounds may be.
