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

Fix pgsql linker cpp #216

Closed

Conversation

jingjingxyk
Copy link
Contributor

当pgsql 依赖 icu 时 需要链接 stdc++

@DubbleClick
Copy link
Contributor

also need to patch the libxml-2.0.pc required libraries to change the order, I integrated this into #214

@crazywhalecc
Copy link
Owner

crazywhalecc commented Oct 3, 2023

postgresql library 在依赖 icu 时,编译 postgresql 自身库时候也会走 linker 吗?我记得如果只生成库不生成二进制的话是不会在编译库时候走 linker 的。如果是这样,我觉得可以加一个 cpp-library = true 类似的东西,将一部分 C++ 的依赖转移到 lib.json 中。但如果是自己要生成二进制,那就没办法了,只能这么 patch 一下。

@crazywhalecc crazywhalecc added bug Something isn't working kind/dependency Issues related to dependencies labels Oct 3, 2023
@jingjingxyk
Copy link
Contributor Author

生成的二进制文件是这个: pg_config

@DubbleClick
Copy link
Contributor

DubbleClick commented Oct 3, 2023

postgresql library 在依赖 icu 时,编译 postgresql 自身库时候也会走 linker 吗?我记得如果只生成库不生成二进制的话是不会在编译库时候走 linker 的。如果是这样,我觉得可以加一个 cpp-library = true 类似的东西,将一部分 C++ 的依赖转移到 lib.json 中。但如果是自己要生成二进制,那就没办法了,只能这么 patch 一下。

Yes, when you compile php with phsql + icu it links these parts. When you only use intl (icu) and build the embed SAPI, a program using the embed API must link with -lstdc++ itself.

Edit: it's just a matter of linking libs in the correct order. Or we use -Wl,--start-group and -Wl,--end-group to enable checking libs in both ways.

@jingjingxyk
Copy link
Contributor Author

@crazywhalecc
Copy link
Owner

已在 #231 中解决。

@jingjingxyk jingjingxyk deleted the fix_pgsql_linker_cpp branch November 29, 2023 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/dependency Issues related to dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants