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.
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'
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
Created attachment 354392 [details, diff] sample patch for glib-2.36.3-r1.ebuild
As this only affects clang, I would include it. Feel free to commit in a week if nobody disagree
Patch looks good. However if gcc is going to fix this, maybe the could have that "fix" applied to all compilers, right ?
+ 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) +