[Maria-developers] what compiler should i use when building mariadb?
hello, we have been using gcc 4.4 to build mysql and mariadb successfully. however, when we tried to use gcc 4.7.1 to build mariadb-5.5.25, we hit this problem: /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c: Assembler messages: /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c:207: Error: CFI instruction used without previous .cfi_startproc what compiler do you use to build mariadb? thanks rich prohaska
Hi!
"Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> hello, Rich> we have been using gcc 4.4 to build mysql and mariadb successfully. Rich> however, when we tried to use gcc 4.7.1 to build mariadb-5.5.25, we Rich> hit this problem: Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c: Rich> Assembler messages: Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c:207: Rich> Error: CFI instruction used without previous .cfi_startproc Rich> what compiler do you use to build mariadb? We are using a lot of different compilers on a lot of different systems and compilers and on all tested ones, MariaDB compiles nicely. Don't know if we have gcc 4.7.1 on any system. I am using latest Open-SuSE myself and that comes with gcc 4.6.2 It looks like issue is that the new gcc has a different asm syntax than the old one :( Fix: Ensure that MY_CONTEXT_USE_UCONTEXT is defined when you compile MariaDB. You should be able to do that by slight modify the first ifdef in include/my_context.h to define MY_CONTEXT_USE_UCONTEXT if gcc 4.7 is used: Currenct code: ----------- #ifdef __WIN__ #define MY_CONTEXT_USE_WIN32_FIBERS 1 #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__x86_64__) #define MY_CONTEXT_USE_X86_64_GCC_ASM #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__) #define MY_CONTEXT_USE_I386_GCC_ASM #else #define MY_CONTEXT_USE_UCONTEXT #endif ------------ Regards, Monty
Hello, Yes, your suggestion to define MY_CONTEXT_USE_UCONTEXT when compiling a release build with gcc 4.7.1 worked. Interestingly, this patch was not required with gcc 4.7.1 debug build. BTW, there are a LOT of compiler warnings, one of which is: sql/log.h:480:3: warning: access declarations are deprecated in favour of using-declarations; suggestion: add the ‘using’ keyword [-Wdeprecated] On Fri, Aug 3, 2012 at 2:08 PM, Michael Widenius <monty@askmonty.org> wrote:
Hi!
"Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> hello, Rich> we have been using gcc 4.4 to build mysql and mariadb successfully. Rich> however, when we tried to use gcc 4.7.1 to build mariadb-5.5.25, we Rich> hit this problem:
Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c: Rich> Assembler messages: Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c:207: Rich> Error: CFI instruction used without previous .cfi_startproc
Rich> what compiler do you use to build mariadb?
We are using a lot of different compilers on a lot of different systems and compilers and on all tested ones, MariaDB compiles nicely.
Don't know if we have gcc 4.7.1 on any system. I am using latest Open-SuSE myself and that comes with gcc 4.6.2
It looks like issue is that the new gcc has a different asm syntax than the old one :(
Fix:
Ensure that MY_CONTEXT_USE_UCONTEXT is defined when you compile MariaDB. You should be able to do that by slight modify the first ifdef in include/my_context.h to define MY_CONTEXT_USE_UCONTEXT if gcc 4.7 is used:
Currenct code: ----------- #ifdef __WIN__ #define MY_CONTEXT_USE_WIN32_FIBERS 1 #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__x86_64__) #define MY_CONTEXT_USE_X86_64_GCC_ASM #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__) #define MY_CONTEXT_USE_I386_GCC_ASM #else #define MY_CONTEXT_USE_UCONTEXT #endif ------------
Regards, Monty
Hi!
"Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> Hello, Rich> Yes, your suggestion to define MY_CONTEXT_USE_UCONTEXT when compiling Rich> a release build with gcc 4.7.1 worked. Interestingly, this patch was Rich> not required with gcc 4.7.1 debug build. BTW, there are a LOT of Rich> compiler warnings, one of which is: Rich> sql/log.h:480:3: warning: access declarations are deprecated in favour Rich> of using-declarations; suggestion: add the ‘using’ keyword Rich> [-Wdeprecated] Never seen the above. I will try to fix it by changing the code for this line. The code is: public: MYSQL_LOG::generate_name; MYSQL_LOG::is_open; Changing these to: public: using MYSQL_LOG::generate_name; using MYSQL_LOG::is_open; Should fix the issue. If there is any other code that generates warnings in MariaDB, please try to fix them and give us a patch or just send me the warnings so that I can try to fix them! Regards, Monty
FYI: i rebuilt mariadb 5.5.25 on gcc 4.7.1 on our cauldron installation... no problems here...
Hi!
"Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> Hello, Rich> Yes, your suggestion to define MY_CONTEXT_USE_UCONTEXT when compiling Rich> a release build with gcc 4.7.1 worked. Interestingly, this patch was Rich> not required with gcc 4.7.1 debug build. BTW, there are a LOT of Rich> compiler warnings, one of which is:
Rich> sql/log.h:480:3: warning: access declarations are deprecated in favour Rich> of using-declarations; suggestion: add the âusingâ keyword Rich> [-Wdeprecated]
Never seen the above. I will try to fix it by changing the code for this line.
The code is:
public: MYSQL_LOG::generate_name; MYSQL_LOG::is_open;
Changing these to:
public: using MYSQL_LOG::generate_name; using MYSQL_LOG::is_open;
Should fix the issue.
If there is any other code that generates warnings in MariaDB, please try to fix them and give us a patch or just send me the warnings so that I can try to fix them!
Regards, Monty
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
"Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> hello, Rich> we have been using gcc 4.4 to build mysql and mariadb successfully. Rich> however, when we tried to use gcc 4.7.1 to build mariadb-5.5.25, we Rich> hit this problem:
Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c: Rich> Assembler messages: Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c:207: Rich> Error: CFI instruction used without previous .cfi_startproc
CFI is used to emit DWARF2 stack unwinding information. This is supposed to be used in gcc versions from 4.4 on. But from the error message, it seems that your GCC 4.7.1 did not emit such information. I was not able to reproduce the problem. I have GCC 4.7.1. I built like this: cmake -DWITH_EMBEDDED_SERVER=1 -DWITH_SSL=system .. && make -j8 -k I suspect that you are building in some special way that triggers this problem. Can you supply the full cmake and make commands you used to build to get this problem? Also it would be useful for me to get the full gcc command line used to build my_context.c when it fails like this (use `make VERBOSE=1`). And please provide full output of `gcc --version`. It would be nice to find out what makes this fail and get it fixed, so others will not get the same failures... - Kristian.
I suspect that we have a tool chain problem here at tokutek. We can build maria 5.5 with gcc 4.7.1 and binutils 2.22 on a centos 6.2 machine (we built gcc and binutils ourselves). We can not build it on a centos 5.8 machine with the same gcc 4.7.1 and binutils 2.22 (we also built gcc and binutils ourselves). So, we are doing additional experiments to find the root cause of this problem. Thanks for information about successful maria 5.5 builds with gcc 4.7.1. On Mon, Aug 6, 2012 at 7:46 AM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
> "Rich" == Rich Prohaska <prohaska@tokutek.com> writes:
Rich> hello, Rich> we have been using gcc 4.4 to build mysql and mariadb successfully. Rich> however, when we tried to use gcc 4.7.1 to build mariadb-5.5.25, we Rich> hit this problem:
Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c: Rich> Assembler messages: Rich> /home/tokubuild/build-tokudb-46462/mariadb-5.5.25-tokudb-46462-linux-x86_64-build/mariadb-5.5.25-tokudb-46462-src/mysys/my_context.c:207: Rich> Error: CFI instruction used without previous .cfi_startproc
CFI is used to emit DWARF2 stack unwinding information. This is supposed to be used in gcc versions from 4.4 on. But from the error message, it seems that your GCC 4.7.1 did not emit such information.
I was not able to reproduce the problem. I have GCC 4.7.1. I built like this:
cmake -DWITH_EMBEDDED_SERVER=1 -DWITH_SSL=system .. && make -j8 -k
I suspect that you are building in some special way that triggers this problem.
Can you supply the full cmake and make commands you used to build to get this problem?
Also it would be useful for me to get the full gcc command line used to build my_context.c when it fails like this (use `make VERBOSE=1`).
And please provide full output of `gcc --version`.
It would be nice to find out what makes this fail and get it fixed, so others will not get the same failures...
- Kristian.
Rich Prohaska <prohaska@tokutek.com> writes:
I suspect that we have a tool chain problem here at tokutek. We can build maria 5.5 with gcc 4.7.1 and binutils 2.22 on a centos 6.2 machine (we built gcc and binutils ourselves). We can not build it on a centos 5.8 machine with the same gcc 4.7.1 and binutils 2.22 (we also built gcc and binutils ourselves). So, we are doing additional experiments to find the root cause of this problem.
Aha, I see. One possible explanation is that some missing dependency caused your gcc/binutils build on the centos 5.8 to be configured without support for DWARF debug information. This could result in an error such as you saw. (But it is just a guess, and I may be completely wrong). - Kristian.
We did not build gcc 4.7.1 correctly. When we built gcc 4.7.1, we used the default assembler that ships in centos 5. We needed to build gcc 4.7.1 with a newer binutils, so we built binutils 2.22 and then built gcc 4.7.1 with the binutils 2.22 assembler and linker. This compiler now generates the CFI directives that are needed to compile mariadb. On Mon, Aug 6, 2012 at 3:44 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Rich Prohaska <prohaska@tokutek.com> writes:
I suspect that we have a tool chain problem here at tokutek. We can build maria 5.5 with gcc 4.7.1 and binutils 2.22 on a centos 6.2 machine (we built gcc and binutils ourselves). We can not build it on a centos 5.8 machine with the same gcc 4.7.1 and binutils 2.22 (we also built gcc and binutils ourselves). So, we are doing additional experiments to find the root cause of this problem.
Aha, I see.
One possible explanation is that some missing dependency caused your gcc/binutils build on the centos 5.8 to be configured without support for DWARF debug information. This could result in an error such as you saw. (But it is just a guess, and I may be completely wrong).
- Kristian.
Rich Prohaska <prohaska@tokutek.com> writes:
We did not build gcc 4.7.1 correctly. When we built gcc 4.7.1, we used the default assembler that ships in centos 5. We needed to build gcc 4.7.1 with a newer binutils, so we built binutils 2.22 and then built gcc 4.7.1 with the binutils 2.22 assembler and linker. This compiler now generates the CFI directives that are needed to compile mariadb.
Ok, that makes sense, thanks for updating me. I was thinking I could add a cmake config check that would detect a gcc that does not use CFI/dwarf, and omit the cfi_escape directive in this case. But I suppose it is not worth it when it only happens with an incorrectly built gcc? Missing dwarf information in the generated binaries seems likely to cause other problems as well... Thanks, - Kristian.
participants (4)
-
Kristian Nielsen
-
Maarten Vanraes
-
Michael Widenius
-
Rich Prohaska