[CONC-133] Centos 6 32 bits: Release build error: my_context.c:454: Error: CFI instruction used without previous .cfi_startproc Created: 2015-06-16  Updated: 2018-09-04  Resolved: 2018-02-20

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.1
Fix Version/s: 2.3.6

Type: Bug Priority: Major
Reporter: Thomas Riccardi Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Centos 6.6 32 bits


Issue Links:
Relates
relates to MDEV-17127 compiling mariadb-10.3.9 report error Open
relates to MDEV-9802 [PATCH] Build fails on SmartOS and gc... Open

 Description   

cmake -DCMAKE_BUILD_TYPE=Release on Centos 6 32 bits:

[ 44%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/my_context.c.o
/home/3rdParty-build/src/mariadb-connector-c-2.1.0-src/libmariadb/my_context.c: Assembler messages:
/home/3rdParty-build/src/mariadb-connector-c-2.1.0-src/libmariadb/my_context.c:454: Error: CFI instruction used without previous .cfi_startproc
make[2]: *** [libmariadb/CMakeFiles/mariadb_obj.dir/my_context.c.o] Error 1

With debug symbols it works:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo

(It also works on 64 bits).

This was also encountered by https://github.com/mscdex/node-mariasql/issues/18



 Comments   
Comment by Georg Richter [ 2015-09-08 ]

Can't repeat on CentOS6 i386.

gcc --version
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Comment by Thomas Riccardi [ 2015-09-08 ]

I still reproduce the issue with Centos 6.7 i686:

$ cat /etc/redhat-release 
CentOS release 6.7 (Final)
$ uname -a
Linux the-hostname 2.6.32-431.el6.i686 #1 SMP Fri Nov 22 00:26:36 UTC 2013 i686 i686 i386 GNU/Linux

mariadb-connector-c-2.1.0
cmake -DCMAKE_BUILD_TYPE=Release ..

$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Comment by Thomas Riccardi [ 2015-09-08 ]

I also tested with a vagrant box:

vagrant init box-cutter/centos67-i386
vagrant up --provider virtualbox
vagrant ssh
sudo yum groupinstall 'Development Tools'
sudo yum install cmake openssl-devel
wget --trust-server-names https://downloads.mariadb.org/interstitial/connector-c-2.1.0/source-tgz/mariadb-connector-c-2.1.0-src.tar.gz/from/http%3A//mirror6.layerjet.com/mariadb
tar xzf mariadb-connector-c-2.1.0-src.tar.gz
cd mariadb-connector-c-2.1.0-src
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Result:

[ 39%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/my_context.c.o
/home/vagrant/mariadb-connector-c-2.1.0-src/libmariadb/my_context.c: Assembler messages:
/home/vagrant/mariadb-connector-c-2.1.0-src/libmariadb/my_context.c:454: Error: CFI instruction used without previous .cfi_startproc
make[2]: *** [libmariadb/CMakeFiles/mariadb_obj.dir/my_context.c.o] Error 1
make[1]: *** [libmariadb/CMakeFiles/mariadb_obj.dir/all] Error 2
make: *** [all] Error 2

Comment by Georg Richter [ 2017-05-22 ]

This is a gcc bug when cross compiling with -m32. Upgrading to gcc 4.8.2 solves the problem.

Comment by Eric Curtin [ 2018-02-20 ]

Ah, it's a gcc bug, good to know

Comment by Eric Curtin [ 2018-02-20 ]

Pity RH don't provide compiler upgrades for gcc on i686, although they do on x86_64

Comment by Eric Curtin [ 2018-02-20 ]

This is not a cross compiling bug, happens when you compile on i686 centos 6 machine... This should be re-opened

Comment by Georg Richter [ 2018-02-20 ]

The fix was not back ported to C/C 2.3:

https://github.com/MariaDB/mariadb-connector-c/blob/master/libmariadb/CMakeLists.txt#L155

Comment by Eric Curtin [ 2018-02-20 ]

I see this in version 3.0.3

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