mysql fails to build form source with Linaro and CodeSourcery toolchains

Bug #579909 reported by Konstantinos Margaritis
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Invalid
High
Unassigned
MySQL Server
Unknown
Unknown
mysql-5.1 (Ubuntu)
Fix Released
High
Loïc Minier
Maverick
Fix Released
High
Loïc Minier

Bug Description

# lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

Package version: mysql-dfsg-5.1_5.1.37-1ubuntu5.1

Rebuilding this on a pbuilder environment on armel (armv7l), platform Efika MX (i.MX515), the build fails, the build log is attached.

Related branches

Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :
Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :

It appears that my compiler is to blame -I used gcc from codesourcery 2009q3-67. I'll look into it more and I'll post back. I'd appreciate any ideas though.

Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :
Download full text (7.5 KiB)

I'm not sure it's the compiler, here's the point where it fails, first is my try, second is the try I found on a clean installed karmic on the efikamx:

set -ex; \
        for file in ../include/mysql/plugin.h ../include/mysql.h; do \
                 gcc -E -nostdinc -dI \
                          -I../include \
                          -I../include/mysql \
                          -I../sql \
                          -I./include \
                          -I./include/mysql \
                          -I./sql \
                                         $file 2>/dev/null | \
                          /bin/sed -e '/^# /d' \
                                    -e '/^[ ]*$/d' \
                                    -e '/^#pragma GCC set_debug_pwd/d' \
                                    -e '/^#ident/d' > \
                                               ./abi_check.out; \
                          /usr/bin/diff -w $file.pp ./abi_check.out; \
                          /bin/rm ./abi_check.out; \
        done
+ for file in ../include/mysql/plugin.h ../include/mysql.h
+ /bin/sed -e '/^# /d' -e '/^[ ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
+ gcc -E -nostdinc -dI -I../include -I../include/mysql -I../sql -I./include -I./include/mysql -I./sql ../include/mysql/plugin.h
+ /usr/bin/diff -w ../include/mysql/plugin.h.pp ./abi_check.out
+ /bin/rm ./abi_check.out
+ for file in ../include/mysql/plugin.h ../include/mysql.h
+ gcc -E -nostdinc -dI -I../include -I../include/mysql -I../sql -I./include -I./include/mysql -I./sql ../include/mysql.h
+ /bin/sed -e '/^# /d' -e '/^[ ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
+ /usr/bin/diff -w ../include/mysql.h.pp ./abi_check.out
2,674d1
< typedef char my_bool;
< typedef int my_socket; ...

Read more...

Revision history for this message
Chuck Short (zulcss) wrote :

Could you try the lucid version?

Thanks
chuck

Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :

I did, same result.

Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :

Ok, found a fix, in file Makefile.am, do_abi_check (near the end):

This code doesn't work:

for file in $(abi_headers); do \
                @CC@ -E -nostdinc -dI \
                         -I$(top_srcdir)/include \
                         -I$(top_srcdir)/include/mysql \
                         -I$(top_srcdir)/sql \
                         -I$(top_builddir)/include \
                         -I$(top_builddir)/include/mysql \
                         -I$(top_builddir)/sql \
                                        $$file 2>/dev/null | \
                         @SED@ -e '/^# /d' \
                                   -e '/^[ ]*$$/d' \
                                   -e '/^#pragma GCC set_debug_pwd/d' \
                                   -e '/^#ident/d' >$(top_builddir)/abi_check.out; \
                         @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
                         @RM@ $(top_builddir)/abi_check.out; \
       done

This however works:

for file in $(abi_headers); do \
                @CC@ -E -nostdinc -dI \
                          -I$(top_srcdir)/include \
                          -I$(top_srcdir)/include/mysql \
                          -I$(top_srcdir)/sql \
                          -I$(top_builddir)/include \
                          -I$(top_builddir)/include/mysql \
                          -I$(top_builddir)/sql \
                                         $$file 2>/dev/null | @SED@ -e '/^# /d' \
                                    -e '/^[ ]*$$/d' \
                                    -e '/^#pragma GCC set_debug_pwd/d' \
                                    -e '/^#ident/d' >$(top_builddir)/abi_check.out; \
                @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
                @RM@ $(top_builddir)/abi_check.out; \
        done

The difference? The | @SED (pipe) is on the same line in the working case, no idea why this shouldn't work.

Revision history for this message
Konstantinos Margaritis (markos-debian-org) wrote :

No, wasn't that after all.

Reverted it and it worked, it was the first line:

set -ex; \

removed the \ and it worked. Again no idea why that would break the script. But I retried that about a dozen times, and I'm positive that this was the line that made it break in the first place.

Revision history for this message
Chuck Short (zulcss) wrote :

Could you add a patch please?

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Triaged
Matthias Klose (doko)
Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Low → High
milestone: none → maverick-alpha-3
tags: added: armel toolchain
Revision history for this message
Loïc Minier (lool) wrote :

Konstantinos, removing the "\" after set -ex causes it to be interpreted as its own command, doing nothing, and means that the large shell snippet isn't run under "set -e" anymore, meaning that errors in intermediate get ignored.

In other words, this would fail in a make target:
set -e; false; true
but this would not:
false; true

The real issue is one of the shell commands failing.

Revision history for this message
Loïc Minier (lool) wrote :

The command which returns a non-zero exit code is the second "diff" run, the first one works well:
+ gcc -E -nostdinc -dI -I../include -I../include/mysql -I../sql -I./include -I./include/mysql -I./sql ../include/mysql/plugin.h
+ /bin/sed -e '/^# /d' -e '/^[ ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
+ /usr/bin/diff -w ../include/mysql/plugin.h.pp ./abi_check.out
+ /bin/rm ./abi_check.out
The second one does not:
+ /bin/sed -e '/^# /d' -e '/^[ ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
+ gcc -E -nostdinc -dI -I../include -I../include/mysql -I../sql -I./include -I./include/mysql -I./sql ../include/mysql.h
+ /usr/bin/diff -w ../include/mysql.h.pp ./abi_check.out
(diff output follows)

So probably gcc -E ... on ../include/mysql.h is not outputting anything, it would be good to find out what it's doing.

summary: - mysql fails to build form source on armel
+ mysql fails to build form source with Linaro and CodeSourcery toolchains
Changed in gcc-linaro:
status: New → Confirmed
Revision history for this message
Loïc Minier (lool) wrote :
Changed in gcc-linaro:
assignee: nobody → Paul Brook (paul-codesourcery)
Loïc Minier (lool)
Changed in gcc-linaro:
milestone: none → 4.4.2010.07
importance: Undecided → High
Revision history for this message
Paul Brook (paul-codesourcery) wrote :

This is upstream bug #51524. Also fails with vanilla GCC 4.5
Backport of upstream fix attached, tweaked to include GCC 4.4.
http://lists.mysql.com/commits/112967

Revision history for this message
Paul Brook (paul-codesourcery) wrote :

Trying again with the attachment...

Revision history for this message
Loïc Minier (lool) wrote :

NB: The MySQL folks reported http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44836 against upstream gcc to ask for a way to force cpp to continue even when headers are missing; this seems bogus though.

tags: added: patch
Revision history for this message
Loïc Minier (lool) wrote :

I sent a different fix to upstream which I intend to upload to Ubuntu, attached here.

It's not terribly pretty, but keeps the abi_check kind of working.

Changed in mysql-dfsg-5.1 (Ubuntu Maverick):
assignee: nobody → Loïc Minier (lool)
Revision history for this message
Loïc Minier (lool) wrote :

Not a gcc-linaro bug

Changed in gcc-linaro:
assignee: Paul Brook (paul-codesourcery) → nobody
status: Confirmed → Invalid
Revision history for this message
Loïc Minier (lool) wrote :

Source package was mysql-dfsg-5.1 in <= lucid and is mysql-5.1 in >= maverick; reassigning and closing since I uploaded:

mysql-5.1 (5.1.48-1ubuntu2) maverick; urgency=low

  * New patch 60_abi-check-includ; fix build failure in abi_check with newer
    GCCs which will exit with failure when an #include can't be found;
    LP: #579909.

affects: mysql-dfsg-5.1 (Ubuntu Maverick) → mysql-5.1 (Ubuntu Maverick)
Changed in mysql-5.1 (Ubuntu Maverick):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.