https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61875
Bug ID: 61875 Summary: ATRIBUTE_NONNULL macro error Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: parkch98 at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org When I tried to build below flags, I found a error to build gcc. CFLAGS='-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE' \ CXXFLAGS='-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE' \ XCFLAGS='-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE' \ TCFLAGS='-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE' \ GCJFLAGS='-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE ' \ ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --disable-bootstrap --enable-languages=c,c++,objc,fortran,obj-c++,go --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.9 --enable-ssp --disable-libssp --disable-libvtv --disable-plugin --with-bugurl=http://bugs.tizen.org/ --with-pkgversion=Tizen --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-4.9 --without-system-libunwind --with-arch-32=i586 --with-tune=generic --disable-multilib --build=x86_64-tizen-linux --host=x86_64-tizen-linux make STAGE1_CFLAGS=-g 'BOOT_CFLAGS=-O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE' -j8 -l16 ================================================================= The error is : libtool: compile: /opt/opensource/gcc/build/./gcc/xgcc -shared-libgcc -B/opt/opensource/gcc/build/./gcc -nostdinc++ -L/opt/opensource/gcc/build/x86_64-tizen-linux/libstdc++-v3/src -L/opt/opensource/gcc/build/x86_64-tizen-linux/libstdc++-v3/src/.libs -L/opt/opensource/gcc/build/x86_64-tizen-linux/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-tizen-linux/bin/ -B/usr/x86_64-tizen-linux/lib/ -isystem /usr/x86_64-tizen-linux/include -isystem /usr/x86_64-tizen-linux/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I../../../../libsanitizer/sanitizer_common -I.. -I ../../../../libsanitizer/include -isystem ../../../../libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-tizen-linux -I../../../../libsanitizer/../libstdc++-v3/libsupc++ -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I ../../../../libsanitizer/../libbacktrace -I ../libbacktrace -I ../../../../libsanitizer/../include -include ../../../../libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -g2 -feliminate-unused-debug-types -pipe -fexceptions --param=ssp-buffer-size=32 -Wformat -Wformat-security -fmessage-length=0 -march=corei7 -msse4.2 -mtune=corei7-avx -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -fipa-cp-clone -U_FORTIFY_SOURCE -D_GNU_SOURCE -MT sanitizer_symbolizer_libbacktrace.lo -MD -MP -MF .deps/sanitizer_symbolizer_libbacktrace.Tpo -c ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -fPIC -DPIC -o .libs/sanitizer_symbolizer_libbacktrace.o In file included from ../../../../libsanitizer/../include/libiberty.h:43:0, from ../../../../libsanitizer/../include/demangle.h:33, from ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:25: ../../../../libsanitizer/../include/ansidecl.h:171:64: error: declaration of ‘int asprintf(char**, const char*, ...)’ has a different exception specifier # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) ^ ../../../../libsanitizer/../include/ansidecl.h:200:80: note: in expansion of macro ‘ATTRIBUTE_NONNULL’ #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) ^ ../../../../libsanitizer/../include/ansidecl.h:202:28: note: in expansion of macro ‘ATTRIBUTE_PRINTF’ #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) ^ ../../../../libsanitizer/../include/libiberty.h:619:50: note: in expansion of macro ‘ATTRIBUTE_PRINTF_2’ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; ^ In file included from ../../../../libsanitizer/../libbacktrace/backtrace.h:37:0, from ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:22: /usr/include/stdio.h:405:12: error: from previous declaration ‘int asprintf(char**, const char*, ...) throw ()’ extern int asprintf (char **__restrict __ptr, ^ In file included from ../../../../libsanitizer/../include/libiberty.h:43:0, from ../../../../libsanitizer/../include/demangle.h:33, from ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:25: ../../../../libsanitizer/../include/ansidecl.h:171:64: error: declaration of ‘int vasprintf(char**, const char*, __va_list_tag*)’ has a different exception specifier # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) ^ ../../../../libsanitizer/../include/ansidecl.h:200:80: note: in expansion of macro ‘ATTRIBUTE_NONNULL’ #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) ^ ../../../../libsanitizer/../include/libiberty.h:626:55: note: in expansion of macro ‘ATTRIBUTE_PRINTF’ extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0); ^ In file included from ../../../../libsanitizer/../libbacktrace/backtrace.h:37:0, from ../../../../libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:22: /usr/include/stdio.h:399:12: error: from previous declaration ‘int vasprintf(char**, const char*, __va_list_tag*) throw ()’ extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, ^ make[4]: *** [sanitizer_symbolizer_libbacktrace.lo] Error 1 make[4]: Leaving directory `/opt/opensource/gcc/build/x86_64-tizen-linux/libsanitizer/sanitizer_common' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/opt/opensource/gcc/build/x86_64-tizen-linux/libsanitizer' make[2]: *** [all] Error 2 make[2]: Leaving directory `/opt/opensource/gcc/build/x86_64-tizen-linux/libsanitizer' make[1]: *** [all-target-libsanitizer] Error 2 make[1]: Leaving directory `/opt/opensource/gcc/build' make: *** [all] Error 2 make: INTERNAL: Exiting with 10 jobserver tokens available; should be 8! ========================================= I think "-fipa-cp-clone" option cause the problem.