[cmake] [macOS] building the shared library does not set `install_name`
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c, cmake
- 领域
- build-system
调研方向
先比较 CMake 共享库配置与 lib/Makefile 中 macOS 安装名称设置(issue 链接到第 78–83 行)。按照提供的 CMake 构建和安装步骤重现差异,然后使用 otool -D 检查库 ID。完成标准是:使用 CMake 构建的库在 macOS 上具有预期的安装名称行为。
由索引模型根据 Issue 内容生成。
描述
Description
[!NOTE]
This issue applies only to macOS.
When building libzstd shared lib with GNU Make, by default, it sets the install_name for the lib as seen at
https://github.com/meta/zstd/blob/98e7b6ac7a08d9cea44aa7b0f6328e064259e625/lib/Makefile#L78-L83
On the other hand, building libzstd shared lib with CMake, it does not.
Expected behavior
Since make is the main build system for libzstd, CMake should also follow the behavior and set the install_name for the shared lib as well.
Reproduction
-
Clone the repository:
git clone https://github.com/meta/zstd -
Change directory to
zstddir:cd zstd -
Build:
make PREFIX=/opt/libzstd-make -
Install:
sudo make PREFIX=/opt/libzstd-make install -
Print the
install_nameid:otool -D /opt/libzstd-make/lib/libzstd.1.6.0.dylib -
Configure with CMake:
cmake \ -DCMAKE_BUILD_TYPE=Release \ --install-prefix /opt/libzstd-cmake \ -S . \ -B /tmp/build-libzstd -
Build with CMake:
cmake --build /tmp/build-libzstd --config Release -
Install with CMake:
sudo cmake --install /tmp/build-libzstd --config Release -
Print the
install_nameid:otool -D /opt/libzstd-cmake/lib/libzstd.1.6.0.dylib -
Check the output of step (5.) is
/opt/libzstd-make/lib/libzstd.1.dylibwhile the output of step (9.) is@rpath/libzstd.1.dylib
[!TIP]
In case there is interest, I already fixed it locally and I can submit a PR for the fix.
- 主要语言
- C
- 星标
- 28.1k
- 派生
- 2.7k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
facebook/zstd 的其他 Issue
-
ZSTD_decompressStream accepts a Compressed_Block with Block_Size 0 that ZSTD_decompress rejects可能已有人在做 @Artyx71 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 83/100
-
One-shot decoding refuses some skippable frames可能已有人在做 @ceedot-rock 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
`ZSTD_getDictID_fromFrame` returns a skippable frame's magic variant as its dictionary ID可能已有人在做 @b84330808 于 13 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
-
cover.c does not build on OpenHarmony: qsort_r is exported but not declared (musl)可能已有人在做 @bfs2021 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 66/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
openziti/ziti-sdk-c#1254 ·
维护者通常 1 天内回复
-
http_fetch tests: the two no-child rows fail, not skip, where a task's children file does not exist可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area:http kind:gate-defect
难度 2/5 1-3 小时 新手友好度 82/100
InauguralSystems/EigenScript#2397 ·
维护者通常 1 天内回复
-
Add SECURITY.md未关闭enhancement
难度 1/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
modem: ppp: CMUX DLCI receive buffer overruns on large downlink packets可能已有人在做 @pedrohqr 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
zephyrproject-rtos/zephyr#126195 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
ly05010419/MacNativeGames#2271 ·
维护者通常 1 天内回复