Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 912797 - dev-db/mysql-8.0.32-r2: ld.lld: error: undefined symbol: absl::lts_20230802::base_internal::SpinLockWait(std::atomic<unsigned int>*, int, absl::lts_20230802::base_internal::SpinLockWaitTransition const*, absl::lts_20230802::base_internal::SchedulingMode)
Summary: dev-db/mysql-8.0.32-r2: ld.lld: error: undefined symbol: absl::lts_20230802::...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 912819
  Show dependency tree
 
Reported: 2023-08-22 02:34 UTC by Alfred Wingate
Modified: 2023-10-14 11:03 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-db/mysql-8.0.32-r2 build.log (dev-db:mysql-8.0.32-r2:20230822-023025.log,685.71 KB, text/plain)
2023-08-22 02:35 UTC, Alfred Wingate
Details
emerge --info (emerge_info.txt,21.07 KB, text/plain)
2023-08-22 02:35 UTC, Alfred Wingate
Details
dev-db/mysql-8.0.32-r2 build.log with lto (dev-db:mysql-8.0.32-r2:20230822-003528.log,464.45 KB, text/plain)
2023-08-22 02:42 UTC, Alfred Wingate
Details
build.log (build.log,690.19 KB, text/plain)
2023-08-22 11:45 UTC, Leonid Kopylov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wingate 2023-08-22 02:34:20 UTC
dev-libs/protobuf-23.3-r1 gets this issue, downgrading dev-libs/protobuf to 21.9 or 21.12 gets around it.

ld.lld: error: undefined symbol: absl::lts_20230802::base_internal::SpinLockWait(std::atomic<unsigned int>*, int, absl::lts_20230802::base_internal::SpinLockWaitTransition const*, absl::lts_20230802::base_internal::SchedulingMode)
>>> referenced by call_once.h:176 (/usr/include/absl/base/call_once.h:176)
>>>               CMakeFiles/xprotocol_plugin.dir/message_field_chain.cc.o:(void absl::lts_20230802::base_internal::CallOnceImpl<void (*)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*>(std::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (*&&)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*&&))

ld.lld: error: undefined symbol: AbslInternalSpinLockWake_lts_20230802
>>> referenced by spinlock_wait.h:85 (/usr/include/absl/base/internal/spinlock_wait.h:85)
>>>               CMakeFiles/xprotocol_plugin.dir/message_field_chain.cc.o:(void absl::lts_20230802::base_internal::CallOnceImpl<void (*)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*>(std::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (*&&)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*&&))
collect2: error: ld returned 1 exit status


Reproducible: Always

Steps to Reproduce:
1. emerge dev-libs/protobuf-23.3-r1 and dev-db/mysql-8.0.32-r2
Actual Results:  
It fails

Expected Results:  
It succeeds
Comment 1 Alfred Wingate 2023-08-22 02:35:09 UTC
Created attachment 868439 [details]
dev-db/mysql-8.0.32-r2 build.log
Comment 2 Alfred Wingate 2023-08-22 02:35:27 UTC
Created attachment 868440 [details]
emerge --info
Comment 3 Alfred Wingate 2023-08-22 02:41:54 UTC
Initially compiled with LTO which got a different error but from the same missing symbol.

/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libprotoc.so: undefined reference to symbol '_ZN4absl12lts_2023080213base_internal12SpinLockWaitEPSt6atomicIjEiPKNS1_22SpinLockWaitTransitionENS1
_14SchedulingModeE'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libabsl_spinlock_wait.so.2308.0.0: error adding symbols: DSO missing from command line


Just an interesting note that mysql opportunistically uses lld if lto isnt enabled. Plausibly this could be explicit or add it to BDEPEND?

# Use lld for Clang if available and not explicitly disabled.
# Also works for gcc on Debian/Ubuntu. Do 'apt install lld'.
# LTO build fails with lld, so turn it off by default.
IF(LINUX AND NOT WITH_LTO AND NOT CMAKE_COMPILER_FLAG_WITH_LTO)
  OPTION(USE_LD_LLD "Use llvm lld linker" ON)
ELSE()
  OPTION(USE_LD_LLD "Use llvm lld linker" OFF)
ENDIF()

IF(USE_LD_LLD)
  CMAKE_PUSH_CHECK_STATE(RESET)

  # RPM builds on Fedora use -specs files.
  # This may cause the test for -fuse-ld=lld to succeed, when it should fail.
  SET(SAVE_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
  SET(SAVE_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
  STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*"  ""
    CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
  STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*"  ""
    CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

  SET(CMAKE_REQUIRED_LIBRARIES "-fuse-ld=lld")
  CHECK_C_SOURCE_COMPILES("int main() {}" C_LD_LLD_RESULT)
  CHECK_CXX_SOURCE_COMPILES("int main() {}" CXX_LD_LLD_RESULT)
  IF(C_LD_LLD_RESULT AND CXX_LD_LLD_RESULT)
    FOREACH(flag
        CMAKE_C_LINK_FLAGS
        CMAKE_CXX_LINK_FLAGS
        CMAKE_EXE_LINKER_FLAGS
        CMAKE_MODULE_LINKER_FLAGS
        CMAKE_SHARED_LINKER_FLAGS
        )
      STRING_APPEND(${flag} " -fuse-ld=lld")
    ENDFOREACH()
  ENDIF()
  SET(CMAKE_C_FLAGS ${SAVE_CMAKE_C_FLAGS})
  SET(CMAKE_CXX_FLAGS ${SAVE_CMAKE_CXX_FLAGS})
  CMAKE_POP_CHECK_STATE()
ENDIF()
Comment 4 Alfred Wingate 2023-08-22 02:42:45 UTC
Created attachment 868441 [details]
dev-db/mysql-8.0.32-r2 build.log with lto
Comment 5 Leonid Kopylov 2023-08-22 11:45:36 UTC
Created attachment 868492 [details]
build.log
Comment 6 Leonid Kopylov 2023-08-22 11:46:38 UTC
same here, downgrading to dev-libs/protobuf-21.12 allows dev-db/mysql installation
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-22 11:56:34 UTC
For now, we may want to switch to bundled protobuf: the ebuild right now has '-DWITH_PROTOBUF=system'.
Comment 8 Leonid Kopylov 2023-08-25 07:36:41 UTC
same with dev-libs/protobuf-23.3-r2
Comment 9 Jan Breig 2023-09-08 11:03:16 UTC
(In reply to Sam James from comment #7)
> For now, we may want to switch to bundled protobuf: the ebuild right now has
> '-DWITH_PROTOBUF=system'.

The build works for me with a custom ebuild that uses bundled protobuf
`-DWITH_PROTOBUF=bundled`
Comment 10 Leonid Kopylov 2023-09-09 16:38:45 UTC
(In reply to Jan Breig from comment #9)
> (In reply to Sam James from comment #7)
> > For now, we may want to switch to bundled protobuf: the ebuild right now has
> > '-DWITH_PROTOBUF=system'.
> 
> The build works for me with a custom ebuild that uses bundled protobuf
> `-DWITH_PROTOBUF=bundled`

can confirm works also for me
Comment 11 Guilherme Amadio gentoo-dev 2023-09-11 08:51:58 UTC
(In reply to Leonid Kopylov from comment #10)
> (In reply to Jan Breig from comment #9)
> > (In reply to Sam James from comment #7)
> > The build works for me with a custom ebuild that uses bundled protobuf
> > `-DWITH_PROTOBUF=bundled`
> 
> can confirm works also for me

Just FYI, you don't need a custom ebuild, just using

$ env MYCMAKEARGS="-DWITH_PROTOBUF=bundled" emerge mysql

should work as well.
Comment 12 Niels Dettenbach 2023-10-13 10:16:35 UTC
(In reply to Guilherme Amadio from comment #11)
> $ env MYCMAKEARGS="-DWITH_PROTOBUF=bundled" emerge mysql
> 
> should work as well.

can confirm as well (on ARM64).


niels.
Comment 13 Leonid Kopylov 2023-10-13 10:17:47 UTC
for me it works only with gcc:12 (still being hit by https://bugs.gentoo.org/905209)
Comment 14 Larry the Git Cow gentoo-dev 2023-10-14 08:34:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc244bfc220f48b2d7fb240e3b1517a47ba63d08

commit dc244bfc220f48b2d7fb240e3b1517a47ba63d08
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2023-09-08 00:56:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-14 08:30:47 +0000

    dev-db/mysql: add 8.0.34
    
    Spent time getting tests to pass as well. I can verify that USE="cjk cracklib numa perl profiling router server"
    pass with gcc-13. I had some testing with other flags as well and didn't see issues other than
    USE="debug" with having failing tests last I checked.
    
    Opted out of fixing some stuff as they would fit better with 8.1 like removing and updating deprecated configurations.
    
    Closes: https://bugs.gentoo.org/895256
    Closes: https://bugs.gentoo.org/912797
    Closes: https://bugs.gentoo.org/905209
    Closes: https://bugs.gentoo.org/891369
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/32749
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-db/mysql/Manifest            |    2 +
 dev-db/mysql/mysql-8.0.34.ebuild | 1220 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 1222 insertions(+)