devel/gdb fails to build with clang on current (see error at the end of the report). Solution: USE_GCC=any should probably be added to the ports makefile. Build errors are: [...] In file included from ./cp-demangle.c:128: ./../include/libiberty.h:110:38: error: expected function body after function declarator extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); ^ ./../include/libiberty.h:121:45: error: expected function body after function declarator extern const char *lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); [...] const char *tempbase) ATTRIBUTE_RETURNS_NONNULL; ^ 17 errors generated. gmake[4]: *** [cp-demangle.o] Error 1 gmake[4]: Leaving directory `/tmp/usr/ports/devel/gdb/work/gdb-7.8/libiberty' gmake[3]: *** [all-libiberty] Error 2 gmake[3]: Leaving directory `/tmp/usr/ports/devel/gdb/work/gdb-7.8' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/tmp/usr/ports/devel/gdb/work/gdb-7.8' *** Error code 1
Maintainer CC'd
I'm not able to reproduce the error. I've successfully built gdb on current r271779, on amd64, without any error. I need more information: the port's configuration, the make.conf (if you are using something specific), the output of cc --version and cpp --version.
# uname -a FreeBSD noxon.firefly 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r271365: Wed Sep 10 12:13:15 CEST # cc --version FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd11.0 Thread model: posix # cpp --version FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd11.0 # cat /etc/make.conf <empty> Port-configuration ist GDB_LINK,THREADS,TUI,PORT_READLINE enabled, rest disabled. Full buildlog: http://paste.kde.org/plg4mmpsf I am able to build it on another machine which is at r270781.
It seems that something in the preprocessing phase of your build gets wrong, but I still cannot reproduce your error (I cannot revers my CURRENT) The macro ATTRIBUTE_RETURNS_NONNULL should be defined as an empty string. You could find that definition in include/ansidecl.h I suggest: * clang-cpp'ing this http://paste.kde.org/p02trki1d * update the CURRENT to r271779 (llvm/clang receives again some love) * MAKE_JOBS_UNSAFE=yes (I don't expect any luck, only if you have time) The first point is the most important one. It tests the clang-cpp (the clang preprocessor) against the GCC_VERSION macro. The macro ATTRIBUTE_RETURNS_NONNULL has to be an empty string. On my system I get: warning: ATTRIBUTE_RETURNS_NONNULL not defined warning: GCC_VERSION smaller than 4009 as expected.
# 1 "test.cpp" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 165 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "test.cpp" 2 test.cpp:2:2: warning: ATTRIBUTE_RETURNS_NONNULL not defined [-W#warnings] #warning ATTRIBUTE_RETURNS_NONNULL not defined ^ test.cpp:6:2: warning: GCC_VERSION smaller than 4009 [-W#warnings] #warning GCC_VERSION smaller than 4009 ^ 2 warnings generated. I'm now at todays sources. Build output with MAKE_JOBS_UNSAFE defined: http://paste.kde.org/prehng9qs
There was a stale ansidecl.h on my system which caused the error.
I was asking exactly that. The error is caused, moreover, because the include path order gives higher priority to /usr/local/include than ../include. I'll try to fix that, to avoid future conflicts. thanks for the report