Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759058 - dev-db/mysql-connector-c-8.0.22 fails to build if CFLAGS or CXXFLAGS are empty
Summary: dev-db/mysql-connector-c-8.0.22 fails to build if CFLAGS or CXXFLAGS are empty
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-08 14:41 UTC by Igor Franchuk
Modified: 2023-06-19 11:46 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Franchuk 2020-12-08 14:41:22 UTC
mysql-connector fails to build if either CFLAGS or CXXFLAGS are unset in a misleading way throwing 
CMake Error at CMakeLists.txt:879 (STRING):
  STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
CMake Error at CMakeLists.txt:881 (STRING):
  STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.


Reproducible: Always




I suggest to add a direct check weather CFLAGS/CXXFLAGS are empty before proceeding with configure and if they are - throw a meaningful message like CFLAGS are empty, please configure CFLAGS/CXXFLAGS
Comment 1 Jose Roberto 2023-06-19 11:38:35 UTC
I can confirm this REGEX problem with arm64, more specifically with 8.0.32-r1 ebuild. I fixed it by replacing 

  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})

with 

  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}")

Please note the added "". I hope someone benefit from this. Seeya.
Comment 2 Jose Roberto 2023-06-19 11:41:11 UTC
I have edited the file:
/var/tmp/portage/dev-db/mysql-connector-c-8.0.32-r1/work/mysql-8.0.32/CMakeLists.txt