lightdm-1.9.15 fails to build with clang-3.4

Bug #1310257 reported by Jauhien Piatlicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Light Display Manager
Triaged
Medium
Unassigned
Gentoo Linux
Fix Released
Medium

Bug Description

Subj, build log on Gentoo GNU/Linux attached.

Revision history for this message
In , Austin English (austinenglish) wrote :
Download full text (6.0 KiB)

Created attachment 371304
emerge log

clang -fno-color-diagnostics -DHAVE_CONFIG_H -I. -I../.. -Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 -march=corei7 -g -pipe -c -o initctl-status.o `test -f 'status.c' || echo './'`status.c
status.c:87:30: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
    vsnprintf (status, 1024, format, ap);
                             ^~~~~~
1 error generated.
Makefile:1232: recipe for target 'initctl-status.o' failed

Reproducible: Always

Steps to Reproduce:
set CC=clang (see https://wiki.gentoo.org/wiki/Clang)
emerge -v =x11-misc/lightdm-1.8.5-r1
Actual Results:
emerge fails

Expected Results:
emerge succeeds

dev-light-2014013002 ~ # emerge --info
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.18-r1, 3.12.0-gentoo-devlight-1 x86_64)
=================================================================
System uname: Linux-3.12.0-gentoo-devlight-1-x86_64-Intel-R-_Core-TM-_i7_CPU_960_@_3.20GHz-with-gentoo-2.2
KiB Mem: 6106996 total, 1437380 free
KiB Swap: 11718652 total, 11355728 free
Timestamp of tree: Thu, 30 Jan 2014 20:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash: 4.2_p45-r1
dev-java/java-config: 2.2.0
dev-lang/python: 2.7.6, 3.3.3
dev-util/cmake: 2.8.12.2
dev-util/pkgconfig: 0.28
sys-apps/baselayout: 2.2
sys-apps/openrc: 0.12.4
sys-apps/sandbox: 2.6-r1
sys-devel/autoconf: 2.13, 2.69
sys-devel/automake: 1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils: 2.24-r2
sys-devel/gcc: 4.8.2
sys-devel/gcc-config: 1.8
sys-devel/libtool: 2.4.2
sys-devel/make: 4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc: 2.18-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=corei7 -g -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=corei7 -g -pipe"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/systemd/system /lib/systemd"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPT...

Read more...

Revision history for this message
In , Jauhien Piatlicki (piatlicki) wrote :

The same for =x11-misc/lightdm-1.9.15 and =sys-devel/clang-3.4-r100

Revision history for this message
Jauhien Piatlicki (piatlicki) wrote :
Revision history for this message
Jauhien Piatlicki (piatlicki) wrote :
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The problem is in logger.c:

void
logger_logv_default (Logger *self, GLogLevelFlags log_level, const gchar *format, va_list ap)
{
    ...
    tmp = g_vsnprintf (NULL, 0, format, ap_copy);
    ...
}

So clang doesn't know that "format" is a valid format string. To mark this in GCC we can use:
__attribute__ ((format_arg (3)))

clang supports format (printf, a, b) but not format_arg. So not sure how we mark this correctly...

Revision history for this message
In , Jauhien Piatlicki (piatlicki) wrote :

Upstream was informed: https://bugs.launchpad.net/lightdm/+bug/1310257

Please, somebody add this link to see also, as I do not have permissions to do it.

Changed in gentoo:
importance: Unknown → Wishlist
status: Unknown → New
Changed in lightdm:
status: New → Triaged
importance: Undecided → Medium
Changed in gentoo:
importance: Wishlist → Medium
status: New → Unknown
Revision history for this message
In , D-rammelt (d-rammelt) wrote :

lightdm-1.11.9 compiles with Clang. Tested on clang/llvm 3.5.0.

Revision history for this message
In , D-rammelt (d-rammelt) wrote :

Created attachment 384740
Fix logger.c compiling with Clang

diff -aur ./lightdm-1.8.5/src/logger.c ./lightdm-1.11.9/src/logger.c

Revision history for this message
In , D-rammelt (d-rammelt) wrote :

Created attachment 384770
disable tests

Tests must also be disabled in the ebuild as per 1.11.9

Revision history for this message
In , Jauhien (jauhien) wrote :

=x11-misc/lightdm-1.9.0 works for me also. This bug should be closed, when it will be unmasked.

Revision history for this message
In , Jauhien (jauhien) wrote :

1.11.9 I mean, wrong copy/paste

Revision history for this message
In , Jauhien (jauhien) wrote :

Please, close this bug as =x11-misc/lightdm-1.11.9 is unmasked already.

Revision history for this message
In , Austin English (austinenglish) wrote :

Closing.

Changed in gentoo:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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