[MDEV-20233] Linking issue on Redhat 6 Created: 2019-08-01  Updated: 2021-04-26  Resolved: 2021-04-26

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Platform RedHat
Affects Version/s: 10.3.17
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Matthew Goebel Assignee: Marko Mäkelä
Resolution: Won't Fix Votes: 2
Labels: regression
Environment:

Redhat 6 64bit


Attachments: HTML File maria     File rdtsc.patch    
Issue Links:
Problem/Incident
is caused by MDEV-19845 Adaptive spin loops Closed

 Description   

cmake . \
	-DMYSQL_DATADIR=/home/mysqldat \
	-DCMAKE_INSTALL_PREFIX=/usr/local \
	-DWITH_INNOBASE_STORAGE_ENGINE=on \
	-DWITH_ARCHIVE_STORAGE_ENGINE=on \
	-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
	-DWITH_LIBWRAP=on

on redhat 6 results in the following : 10.3.16 compiled just fine...

[ 16%] Building C object unittest/mysys/CMakeFiles/lf-t.dir/lf-t.c.o
Linking CXX executable lf-t
../../mysys/libmysys.a(my_cpu.c.o): In function `my_cpu_init':
/usr/local/src/mariadb-10.3.17/mysys/my_cpu.c:86: undefined reference to `__rdtsc'
/usr/local/src/mariadb-10.3.17/mysys/my_cpu.c:88: undefined reference to `__rdtsc'
/usr/local/src/mariadb-10.3.17/mysys/my_cpu.c:90: undefined reference to `__rdtsc'
collect2: ld returned 1 exit status
make[2]: *** [unittest/mysys/lf-t] Error 1
make[1]: *** [unittest/mysys/CMakeFiles/lf-t.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Kentaro Hayashi [ 2019-08-02 ]

It was occurred on CentOS 6 (64bit), too. It seems that CentOS 6 (32bit) is not affected.

I'm NOT sure but I guess MDEV-19845: Fix the build on some x86 targets is related.

Comment by Sergey Kokhan [ 2019-08-05 ]

Faced with the same problem and it is because that CentOS 6 and RedHat 6 x86-64 using gcc-4.4.
gcc-4.4 does not have support for rdtsc in x86intrin.h. It was added since gcc-4.5.

This patch helped me solve the problem. rdtsc.patch

--- ./a/mysys/my_cpu.c<>2019-07-27 20:18:31.000000000 -0400
+++ ./b/mysys/my_cpu.c<>2019-08-05 07:16:48.780583139 -0400
@@ -31,6 +31,8 @@ unsigned my_cpu_relax_multiplier = 200;
 instead of being inlined. Let us fall back to my_timer_cycles(), which
 internally invokes rdtsc. */
 #  include <my_rdtsc.h>
+# elif GCC_VERSION < 4005
+#  include <my_rdtsc.h>
 # else
 #  include <x86intrin.h>
 #  define my_timer_cycles __rdtsc

Comment by Marko Mäkelä [ 2020-08-08 ]

Sorry, I did not notice the report until now. This ought to have been caused by MDEV-19845.

If I understand correctly, the 10.4 and later series should be unaffected, because it will require GCC 4.8.5 or later, for sufficient C++11 support.

However, is this fix still needed? Red Hat Enterprise Linux 6 should reach its End of Life (EOL) on November 30, 2020. I am a bit reluctant to add tweaks for very old compilers.

Comment by Matthew Goebel [ 2020-08-10 ]

Hey,

I don't seem to be able to log into the ticket, and probably lost my
password for this setup.

We have migrated off of Redhat Enterprise 6 so ahead and do whatever you
need to do with this.

Thanks,
Matt


Matthew Goebel : m <goebel@emunix.emich.edu>goebel@emich.edu : Unix Jockey
@ EMU : Hail Eris
Neo-Student, Net Lurker, Donut consumer, and procrastinating medher...
"Always with the negative waves, Moriarty" - Oddball
"Comfort the troubled, and trouble the comfortable." - Dietrich Bonhoeffer

Comment by Marko Mäkelä [ 2021-04-26 ]

I am closing this, because RHEL 6 (and CentOS 6) have reached their End of Life. It could be possible to work around this by installing a newer compiler on that system. That is what we do in order to be able to build tarballs of MariaDB 10.5 or 10.6 on our CI system.

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