Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 478338 - dev-libs/glib-2.36.3-r1: build fails using clang-3.3
Summary: dev-libs/glib-2.36.3-r1: build fails using clang-3.3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks: systemwide-clang freebsd-clang-3.1
  Show dependency tree
 
Reported: 2013-07-27 10:13 UTC by Yuta SATOH
Modified: 2013-09-29 10:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
sample patch for glib-2.36.3-r1.ebuild (478338.patch,505 bytes, patch)
2013-07-28 09:22 UTC, Yuta SATOH
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2013-07-27 10:13:31 UTC
The following message is displayed and fails to compile.


libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -O2 -pipe -c ggettext.c  -fPIC -DPIC -o .libs/libglib_2_0_la-ggettext.o
gfileutils.c:1023:16:/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -I.. -I../glib -I../glib -I..  -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs  -O2 -pipe  -c -o libglib_2_0_la-ghmac.lo `test -f 'ghmac.c' || echo './'`ghmac.c
 error: format string is not a string literal [-Werror,-Wformat-nonliteral]
               format_string, display_name, g_strerror (saved_errno));
               ^~~~~~~~~~~~~
1 error generated.
gmake[4]: *** [libglib_2_0_la-gfileutils.lo] Error 1
gmake[4]: *** Waiting for unfinished jobs....
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -O2 -pipe -c ghmac.c  -fPIC -DPIC -o .libs/libglib_2_0_la-ghmac.o
gmake[4]: Leaving directory `/var/tmp/portage/dev-libs/glib-2.36.3-r1/work/glib-2.36.3/glib'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/var/tmp/portage/dev-libs/glib-2.36.3-r1/work/glib-2.36.3/glib'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/var/tmp/portage/dev-libs/glib-2.36.3-r1/work/glib-2.36.3/glib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/var/tmp/portage/dev-libs/glib-2.36.3-r1/work/glib-2.36.3'
gmake: *** [all] Error 2
 * ERROR: dev-libs/glib-2.36.3-r1 failed (compile phase):
 *   emake failed


Reproducible: Always

Steps to Reproduce:
1. CC=clang CXX=clang++ emerge dev-libs/glib
2.
3.
Comment 1 Yuta SATOH 2013-07-27 10:20:42 UTC
Better log, setting MAKEOPTS=-j1

libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -O2 -pipe -c gfileutils.c  -fPIC -DPIC -o .libs/libglib_2_0_la-gfileutils.o
gfileutils.c:1023:16: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
               format_string, display_name, g_strerror (saved_errno));
               ^~~~~~~~~~~~~
1 error generated.
gmake[4]: *** [libglib_2_0_la-gfileutils.lo] Error 1
gmake[4]: Leaving directory `/var/tmp/portage/dev-libs/glib-2.36.3-r1/work/glib-2.36.3/glib'
Comment 2 Yuta SATOH 2013-07-27 16:44:13 UTC
I've confirmed that can be compiled in the following way.

CC=clang CXX=clang++ CFLAGS="-O2 -pipe -Wno-format-nonliteral" \
CXXFLAGS="-O2 -pipe -Wno-format-nonliteral" emerge dev-libs/glib
Comment 3 Yuta SATOH 2013-07-28 09:22:46 UTC
Created attachment 354392 [details, diff]
sample patch for glib-2.36.3-r1.ebuild
Comment 4 Pacho Ramos gentoo-dev 2013-07-28 11:36:49 UTC
As this only affects clang, I would include it. Feel free to commit in a week if nobody disagree
Comment 5 Gilles Dartiguelongue gentoo-dev 2013-07-29 21:25:21 UTC
Patch looks good. However if gcc is going to fix this, maybe the could have that "fix" applied to all compilers, right ?
Comment 6 Pacho Ramos gentoo-dev 2013-09-29 10:40:04 UTC
+  29 Sep 2013; Pacho Ramos <pacho@gentoo.org> glib-2.36.4-r1.ebuild:
+  Support compilation in clang until upstream solves this, upstream bug #691608
+  (#478338 by Yuta SATOH)
+