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

启用soname时程序无法正确加载动态库 #4776

Closed
xu-h opened this issue Feb 26, 2024 · 5 comments
Closed

启用soname时程序无法正确加载动态库 #4776

xu-h opened this issue Feb 26, 2024 · 5 comments
Labels
Milestone

Comments

@xu-h
Copy link

xu-h commented Feb 26, 2024

Xmake 版本

v2.8.7+HEAD.da27927

操作系统版本和架构

Ubuntu 22.04, Windows 11 WSL2

描述问题

测试用例 shared_library_with_soname 编译正常

执行时提示 error while loading shared libraries: @rpath/libfoo.so.1: cannot open shared object file: No such file or directory

linker.sonametarget:add("shflags", "-Wl,-soname,@rpath/" .. soname, {force = true}) 是否应删除 @rpath前缀?

期待的结果

程序能够正常执行。

工程配置

shared_library_with_soname

附加信息和错误日志

@xu-h xu-h added the bug label Feb 26, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: The program cannot load the dynamic library correctly when soname is enabled.

Xmake version

v2.8.7+HEAD.da27927

Operating system version and architecture

Ubuntu 22.04, Windows 11 WSL2

Describe the problem

Test case shared_library_with_soname compiles normally

When executing, it prompts error while loading shared libraries: @rpath/libfoo.so.1: cannot open shared object file: No such file or directory

In linker.soname target:add("shflags", "-Wl,-soname,@rpath/" .. soname, {force = true}) Should the @rpath prefix be removed?

Expected results

The program can be executed normally.

Project configuration

shared_library_with_soname

Additional information and error logs

None

waruqi added a commit that referenced this issue Feb 27, 2024
@waruqi
Copy link
Member

waruqi commented Feb 27, 2024

再试试,xmake update -s dev

@waruqi waruqi added this to the v2.8.8 milestone Feb 27, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Try again, xmake update -s dev

@xu-h
Copy link
Author

xu-h commented Feb 27, 2024

已修复。辛苦。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It has been fixed. Hard.

@waruqi waruqi closed this as completed Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants