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

使用 -Wl,–whole-archive -Wl,–start-group 和 -Wl,–end-group -Wl,-no-whole-archive。 解决brotli 链接问题 #297

Closed
jingjingxyk opened this issue Jul 27, 2023 · 3 comments

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Jul 27, 2023

brotli 链接时,有链接顺序要求, 需要先链接 brotlicommon ,然后链接 brotlienc ,brotlidec

参考文档:

https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking

https://bbs.huaweicloud.com/blogs/373470

https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html

@jingjingxyk
Copy link
Contributor Author

上面的办法,试了又试,发现解决不了问题。

最后发现是编译bug : #298

@jingjingxyk
Copy link
Contributor Author

macos clang 不支持 -Wl,–whole-archive -Wl,–start-group 和 -Wl,–end-group -Wl,-no-whole-archive

@jingjingxyk
Copy link
Contributor Author

解决办法:

    $p->withExportVariable('FREETYPE2_CFLAGS', '$(pkg-config  --cflags --static  libbrotlicommon libbrotlidec libbrotlienc freetype2 zlib libpng)');
    $p->withExportVariable('FREETYPE2_LIBS', '$(pkg-config    --libs   --static  libbrotlicommon libbrotlidec libbrotlienc freetype2 zlib libpng)');

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

1 participant