lightdm fails to build with gcc-4.7

Reported by Yves-Alexis Perez on 2012-05-15
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Undecided
Matt Fischer

Bug Description

Hey,

it seems that lightdm (1.2 at least) doesn't build with gcc-4.7:

gcc -DHAVE_CONFIG_H -I. -I../.. -D_FORTIFY_SOURCE=2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c -o Xvnc-Xvnc.o `test -f 'Xvnc.c' || echo './'`Xvnc.c
In file included from /usr/include/unistd.h:1160:0,
                 from libsystem.c:8:
libsystem.c: In function 'pam_setcred':
/usr/include/x86_64-linux-gnu/bits/unistd.h:266:31: error: inlining failed in call to always_inline 'getgroups': function not inlinable
libsystem.c:879:27: error: called from here
In file included from /usr/include/unistd.h:1160:0,
                 from libsystem.c:8:
/usr/include/x86_64-linux-gnu/bits/unistd.h:266:31: error: inlining failed in call to always_inline 'getgroups': function not inlinable
libsystem.c:881:27: error: called from here
make[4]: *** [libsystem_la-libsystem.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/tmp/buildd/lightdm-1.2.2/tests/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/buildd/lightdm-1.2.2/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/buildd/lightdm-1.2.2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/buildd/lightdm-1.2.2'
dh_auto_build: make -j6 returned exit code 2

Related branches

Yves-Alexis Perez (corsac) wrote :

It seems that getgroups() is redefined inside libsystem.c and not inlined there.

Matt Fischer (mfisch) wrote :

Confirmed. It is failing to build in my quantal chroot.

Changed in lightdm:
status: New → Confirmed
Daniel Johnson (il-basso-buffo) wrote :

As a stopgap workaround, you can build successfully with --disable-testing, but that doesn't solve the real problem.

Matt Fischer (mfisch) on 2012-06-09
Changed in lightdm:
status: Confirmed → In Progress
assignee: nobody → Matt Fischer (mfisch)
Matt Fischer (mfisch) wrote :

Works fine on i386.

Matt Fischer (mfisch) on 2012-06-12
summary: - fails to build with gcc-4.7
+ lightdm fails to build with gcc-4.7 on amd64
Matt Fischer (mfisch) on 2012-06-12
summary: - lightdm fails to build with gcc-4.7 on amd64
+ lightdm fails to build with gcc-4.7
Matt Fischer (mfisch) wrote :

I tried to repro this today and here are my results:

lp:~ubuntu-desktop/lightdm/ubuntu/
quantal - real h/w - amd64 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)
quantal - real h/w - i386 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)
quantal - pbuilder - i386 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)

lp:lightdm (trunk)
quantal - real h/w - amd64 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)
quantal - real h/w - i386 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)
quantal - pbuilder - i386 - builds fine: gcc version 4.7.0 (Ubuntu/Linaro 4.7.0-13ubuntu1)

Therefore I am marking this invalid unless someone wants to re-open it. I know that gcc changed since this was filed, as did trunk for lightdm, and I assume some combo fixes this.

Changed in lightdm:
status: In Progress → Invalid
Yves-Alexis Perez (corsac) wrote :

Yes, it seems the bug was in fact in gcc-4.7.

Hwoarang (hwoarang) wrote :

It still fails with gcc-4.7.1 so it does not seem to be a problem with gcc

Matt Fischer (mfisch) wrote :

Can you please post your compile logs?

Hwoarang (hwoarang) wrote :

Sure, here it is (note that I am building lightdm-1.2.2 not trunk). So I think this bug should remain open until a new release of lightdm is out and verified it works with gcc-4.7.X

make[2]: Entering directory `/var/tmp/portage/x11-misc/lightdm-1.2.2-r1/work/lightdm-1.2.2/tests'
Making all in src
make[3]: Entering directory `/var/tmp/portage/x11-misc/lightdm-1.2.2-r1/work/lightdm-1.2.2/tests/src'
  CC libsystem_la-libsystem.lo
  CC dbus_env-dbus-env.o
  CC test_runner-test-runner.o
  CC X-X.o
  CC X-x-authority.o
  CC X-x-common.o
  CC X-x-server.o
  CC X-xdmcp-client.o
In file included from /usr/include/unistd.h:1171:0,
                 from libsystem.c:8:
libsystem.c: In function 'pam_setcred':
/usr/include/bits/unistd.h:266:1: error: inlining failed in call to always_inline 'getgroups': function not inlinable
libsystem.c:879:27: error: called from here
In file included from /usr/include/unistd.h:1171:0,
                 from libsystem.c:8:
/usr/include/bits/unistd.h:266:1: error: inlining failed in call to always_inline 'getgroups': function not inlinable
libsystem.c:881:27: error: called from here
make[3]: *** [libsystem_la-libsystem.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/x11-misc/lightdm-1.2.2-r1/work/lightdm-1.2.2/tests/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/x11-misc/lightdm-1.2.2-r1/work/lightdm-1.2.2/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-misc/lightdm-1.2.2-r1/work/lightdm-1.2.2'
make: *** [all] Error 2

---gcc version ---

 Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.1/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.7.1/work/gcc-4.7.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check --with-cloog-include=/usr/include/cloog-ppl --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.7.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.7.1 p1.0, pie-0.5.3'
Thread model: posix
gcc version 4.7.1 (Gentoo 4.7.1 p1.0, pie-0.5.3)

Hwoarang (hwoarang) wrote :

Please also see https://bugs.gentoo.org/show_bug.cgi?id=412369 for proposed solutions

Matt Fischer (mfisch) wrote :

Okay, I've re-opened it. I don't have any spare time right now to watch this one so I've unassigned myself. If you see that a later release does fix this, please re-close.

Changed in lightdm:
status: Invalid → New
assignee: Matt Fischer (mfisch) → nobody
Matt Fischer (mfisch) wrote :

This dupe has a suggested fix. I'll see if I can repro it again.

Matt Fischer (mfisch) wrote :

I can repro this again. I don't know why it magically worked last week, I was on a different system, but that shouldn't have mattered. I'll work on a fix.

Changed in lightdm:
status: New → In Progress
assignee: nobody → Matt Fischer (mfisch)
Matt Fischer (mfisch) wrote :

The proposed Gentoo fix does not solve this because the getgroups() calls in src/test-session.c will be calling the real getgroups and not the libsystem that the tests build.

We could change both places, but I am also working other alternatives.

Matt Fischer (mfisch) wrote :

After discussing with Robert, the proposed fix is simply to remove the #include of unistd.h inside test/src/libsystem.c.

Matt Fischer (mfisch) on 2012-07-28
Changed in lightdm:
status: In Progress → Fix Committed
Robert Ancell (robert-ancell) wrote :

Fixed in 1.3.2

Changed in lightdm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
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.