[MDEV-20432] error LNK2001: unresolved external symbol log_10_int on Windows Created: 2019-08-27  Updated: 2019-08-29  Resolved: 2019-08-29

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4.7
Fix Version/s: 10.4.8

Type: Bug Priority: Major
Reporter: Kentaro Hayashi Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows



 Description   

When building bundled MariaDB 10.4.7 with latest storage engine Mroonga http://mroonga.org/ , it causes "error LNK2001: unresolved external symbol log_10_int". [1]
It seems that it requires MYSQL_PLUGIN_IMPORT on Windows.

Here is the patch to fix this issue.

diff -ru mariadb-10.4.7.orig/include/my_time.h mariadb-10.4.7/include/my_time.h
— mariadb-10.4.7.orig/include/my_time.h 2019-07-30 20:32:14.000000000 +0900
+++ mariadb-10.4.7/include/my_time.h 2019-08-26 08:28:59.857378783 +0900
@@ -27,7 +27,7 @@

C_MODE_START

-extern ulonglong log_10_int[20];
+extern MYSQL_PLUGIN_IMPORT ulonglong log_10_int[20];
extern uchar days_in_month[];

#define MY_TIME_T_MAX LONG_MAX

[1] build logs on AppVeyor CI https://ci.appveyor.com/project/groonga/mroonga/builds/26925777/job/aneis43usly9jd6c#L5179



 Comments   
Comment by Vladislav Vaintroub [ 2019-08-27 ]

How do you build with Mroonga , if mroonga does not build on Windows, i.e it is disabled via CMake.
kenhys ?

Comment by Kentaro Hayashi [ 2019-08-28 ]

Here is the recipe to build latest one. https://github.com/mroonga/mroonga/blob/master/appveyor.yml

The brief instruction is the following:

1. remove storage/mroonga and replace it with latest cloned mroonga (https://github.com/mroonga/mroonga/blob/master/appveyor.yml#L51)
2. exec cmake .. -G "Visual Studio 14 2015 Win64" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF -DGRN_WITH_MRUBY=ON for configuration (https://github.com/mroonga/mroonga/blob/master/appveyor.yml#L90)
3. exec cmake --build . --config RelWithDebInfo (https://github.com/mroonga/mroonga/blob/master/appveyor.yml#L94)

Comment by Sergei Golubchik [ 2019-08-28 ]

why would mroonga need this symbol?

Comment by Kentaro Hayashi [ 2019-08-29 ]

In Mroonga, it seems that log_10_int is indirectly referenced. (maybe, not confident at all)

1. https://github.com/mroonga/mroonga/blob/master/ha_mroonga.cpp#L12494 uses Field_timestamp_hires
2. Field_timestamp_hires's constructor call sec_part_shift
which is defined https://github.com/MariaDB/server/blob/10.4/sql/field.h#L3253.
3. sec_part_shift uses log_10_int
https://github.com/MariaDB/server/blob/10.4/include/my_time.h#L221

Generated at Thu Feb 08 08:59:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.