Skip to content

Build failure with Protobuf 22+ in Linux #544

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

Closed
wants to merge 2 commits into from

Conversation

gordonwwang
Copy link

@gordonwwang gordonwwang commented May 24, 2024

This is a re-opened PR (original PR:#504)

1. Problem:

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.

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.so.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

In fact, it should be:

-labsl_spinlock_wait -lstdc++ -lgcc_s -lc -ldl 

2. How to reproduce:

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

3. Advice on this legacy question

In 2023.10, the Release Note of mysql-8.0.35 claimed to have fixed the problem.
But I found that this issue still exists on Linux environments and seems to be fixed only on MacOS environments.

Building with WITH_PROTOBUF=system failed with Protobuf 22 or newer due to Protobuf 22 adding the Abseil dependency.  

In 2023.11, I proposed a fix on Linux, and PR was shut down by robots and not adopted.(PR link:https://github.com/mysql/mysql-server/pull/504)

It's 2024.05, and I find that this problem persists even now. Neither mysql-8.0.36 nor 8.0.37 fixed this issue.

As a Linux distribution operating system maintainer, I want mysql to be better and used by more people, so I am very concerned about this issue and hope mysql can fix this problem.

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

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@gordonwwang
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=115163 for updates.
Thanks

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.

2 participants