Skip to content

Conversation

gordonwwang
Copy link

@gordonwwang gordonwwang commented Nov 10, 2023

Question 1:

In Linux, if you compile mysql-8.0.35 with protobuf 24.2, the error (Here is the full log:build.log):

/usr/bin/ld: /usr/lib64/libprotoc.so: undefined reference to symbol  '_ZN4absl12lts_2023080213base_internal12SpinLockWaitEPSt6atomicIjEiPKNS1_22SpinLockWaitTransitionENS1_14SchedulingModeE'
/usr/bin/ld: /usr/lib64/libabsl_spinlock_wait.so.2308.0.0: error adding symbols: DSO missing from command line.

According to the release notes of mysql-8.0.35, this issue should have been fixed in the current release, but this is not the case.

Building with WITH_PROTOBUF=system failed with Protobuf 22 or newer due to Protobuf 22 adding the Abseil dependency.  (Bug #111469, Bug #111623, Bug #35546459, Bug #35550389)

Reading the mysql source code, it seems that protobuf 22+ is only fixed on MacOS, so the problem still exists on Linux.

Question 2:

Run the FIND_OBJECT_DEPENDENCIES function to find dependent libraries. If the output of objdump is as follows:

NEEDED               libstdc++.so.6
NEEDED               libc.so.6
NEEDED ld-Linux-x86-64.2 

At this point, libc.so.6 can be processed normally and converted to "-lc";
However, "libstdc++.so.6" cannot be captured by the regular expression because it contains "++", so it cannot install the transposition "-lstdc++";
Although "ld-Linux-x86-64.2" can be captured by the regular expression, it is incorrectly converted to "-ld-Linux-x86-64", and the correct result should be "-ldl".

Function output error results are as follows:

-labsl_spinlock_wait -llibstdc -lgcc_s -lc -lld-linux-x86-64

I have to report this problem to mysql community, link: https://bugs.mysql.com/bug.php?id=113045

How to reproduce:

Environment: Linux x86-64 platform
Dependency: protobuf 24.2
Compile: Open -DWITH_PROTOBUF="system", then compile the mysql-8.0.35 code

My fix:

  1. In cmake/protobuf.cmake, add fixes related to IF(LINUX AND WITH_PROTOBUF STREQUAL "system" AND PB_MINOR_VERSION VERSION_GREATER 21)
  2. In cmake/fileutils.cmake, improve the FIND_OBJECT_DEPENDENCIES function in Linux.

gordonwwang added 2 commits November 10, 2023 23:12
Building with WITH_PROTOBUF=system failed with Protobuf 24.2 in Linux.
In cmake/protobuf.cmake, add fixes related to IF(LINUX AND WITH_PROTOBUF STREQUAL system AND PB_MINOR_VERSION VERSION_GREATER 21)

Signed-off-by: gordonwwang <gordonwwang@tencent.com>
Run the FIND_OBJECT_DEPENDENCIES function to find dependent libraries. If the output of objdump is as follows:
“
NEEDED               libstdc++.so.6
NEEDED               libc.so.6
NEEDED               ld-Linux-x86-64.2
"

At this point, libc.so.6 can be processed normally and converted to "-lc"; However, "libstdc++.so.6" cannot be captured by the regular expression because it contains "++", so it cannot install the transposition "-lstdc++"; Although "ld-Linux-x86-64.2" can be captured by the regular expression, it is incorrectly converted to "-ld-Linux-x86-64", and the correct result should be "-ldl".

Signed-off-by: gordonwwang <gordonwwang@tencent.com>
@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@gordonwwang
Copy link
Author

gordonwwang commented Nov 11, 2023

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/ Please make sure to include your MySQL bug system user (email) in the returned form. Thanks

Ok, I have signed OCA and it is consistent with MySQL bug system user.
Need to wait until the approval is successful.

@mysql-oca-bot
Copy link

Hi, there was no response to our request to sign an OCA or confirm the code is submitted under the terms of the OCA. As such this request will be closed.
Thanks

@gordonwwang
Copy link
Author

I have responded, but haven't heard anything back from mysql.
Strange bot

@mysql-admin
Copy link

Hi @gordonwwang,
Sorry for the above mix-up, but we can't find any record of receiving an OCA from you
Please email me with more details - omer.barnir@oracle.com

Thanks for contributing to MySQL
==Omer

@gordonwwang
Copy link
Author

Hi @gordonwwang, 你好 , Sorry for the above mix-up, but we can't find any record of receiving an OCA from you对于上述混淆,我们深表歉意,但我们找不到任何收到您发送的 OCA 的记录 Please email me with more details - omer.barnir@oracle.com 请给我发电子邮件提供更多详细信息 - omer.barnir@oracle.com

Thanks for contributing to MySQL感谢您对 MySQL 的贡献 ==Omer ==奥马尔

I signed oca again and sent an email to omer.barnir@oracle.com, hoping to get approval.

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

Successfully merging this pull request may close these issues.

3 participants