如何链接指定glibc

发布于 2025-01-12 04:10:43 字数 373 浏览 3 评论 0原文

我有一个 cmake 项目需要与 glibc-2.33 链接。由于系统 glibc 是低版本,并且不建议在系统中安装新的 glibc,因此我在 http://web.yl.is.su-tokyo.ac.jp/~tosh/kml/how_to_build_and_use_glibc.html 进入自定义路径。但我不知道如何添加 cmake 语句,以便我可以将项目与 glibc-2.33 链接(应该是链接器和所有库)。也许有人可以给我一些建议。谢谢

I have a cmake project that need to be linked with glibc-2.33. As system glibc is low version and install new glibc to system is not recommended, I build and install glibc-2.33 following with #2 in http://web.yl.is.s.u-tokyo.ac.jp/~tosh/kml/how_to_build_and_use_glibc.html into a custom path. but I'm not sure how to add cmake sentence so that I can link the project with glibc-2.33 (should be linker and all libraries). Maybe someone can give me some advice. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我一向站在原地 2025-01-19 04:10:43

但我不知道如何添加 cmake 语句,以便我可以将项目与 glibc-2.33 链接(应该是链接器和所有库)。

您引用的示例不需要您链接到新的GLIBC,而是使用“显式加载程序调用” - /path/to/ld.so /path/to/binary 运行时

如果您确实想链接到新的 GLIBC,请参阅此答案。抱歉,我不知道如何使用 cmake 执行此操作。

but I'm not sure how to add cmake sentence so that I can link the project with glibc-2.33 (should be linker and all libraries).

The example you referenced doesn't require you to link against the new GLIBC, and instead uses "explicit loader invocation" -- /path/to/ld.so /path/to/binary at runtime.

If you do want to link against the new GLIBC, see this answer. Sorry I don't know how to do this with cmake.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文