[MDEV-17868] mysqltest fails to link with system PCRE libraries Created: 2018-11-28 Updated: 2019-01-24 Resolved: 2019-01-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling |
| Affects Version/s: | 10.2.15, 10.2.19 |
| Fix Version/s: | 10.1.38, 10.0.38, 10.2.22, 10.3.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Chris Ross | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux |
||
| Attachments: |
|
| Description |
|
We have a custom linux environment. The system PCRE was recently updated to 8.42, and mariadb now detects that it has a pcre_stack_guard and tries to use it. However, when building clients/mysqltest, it fails to link saying:
I have found that changing the order of the pcre and pcreposix libraries will resolve this issue. As pcreposix clearly needs pcre, I think the order specified in client/CMakeLists.txt is wrong. pcreposix should be specified before pcre, so the linker knows to load needed symbols from prce. (I don't know why this fails with our system libpcre, and doesn't fail when linking against the bundled pcre. If there is another solution for us at the system level, feel free to suggest). |
| Comments |
| Comment by Chris Ross [ 2018-12-03 ] | ||||||||||||
|
Anyone have any thoughts on this? I was hoping to hear feedback from someone in the mariadb dev process. Thanks. | ||||||||||||
| Comment by Sergei Golubchik [ 2018-12-05 ] | ||||||||||||
|
could you show the complete line used for linking? The one that fails. Run make VERBOSE=1 to see it | ||||||||||||
| Comment by Chris Ross [ 2018-12-05 ] | ||||||||||||
|
Sure. Here ya go
| ||||||||||||
| Comment by Chris Ross [ 2018-12-05 ] | ||||||||||||
|
I realized upon pasting that that it's a cross-compile to i386. I'd earlier checked that the same situation exists in both ways we compile it, here is the native x86_64 link error as well.
| ||||||||||||
| Comment by Sergei Golubchik [ 2018-12-07 ] | ||||||||||||
|
Okay. Looks plausible. In my builds, libpcre and libpcreposix are dynamic libraries, so the dynamic linker knows that libpcreposix needs libpcre and the order doesn't really matter. If I build with the bundled pcre, it builds only static libpcre.a and libpcreposix.a libraries, but in this case CMake knows that libpcreposix needs libpcre and it always appends libpcre.a to the linker line whenever it sees libpcreposix.a there. Clearly, when one has system static pcre libraries, neither from the above can help, and the linker complains. | ||||||||||||
| Comment by Chris Ross [ 2019-01-03 ] | ||||||||||||
|
Hello. Is there any timeline for getting this changed in the trees? Specifically, I'll need to know which releases have this change, so that I can remove the local patch that I've put into our internal build system. Thanks. |