Discussion:
error: expected declaration specifiers before 'ATTRIBUTE_RETURNS_NONNULL'
Shaun Jackman
2014-08-28 19:39:29 UTC
Permalink
I'm seeing a strange error when compiling gcc --with-sysroot. So far
I've successfully (I think) installed the linux headers and compiled
and installed binutils and glibc for this sysroot. I'm working on GCC
now.

libiberty.h:110:38: error: expected declaration specifiers before
'ATTRIBUTE_RETURNS_NONNULL'

The configure line is as follows. Any thoughts? Here's the gist of
four log files:
https://gist.github.com/sjackman/cdc4961f0d6751d7e1c0

config.log configure.log libiberty-config.log make.log

Cheers,
Shaun

../configure --with-sysroot=/home/sjackman/.linuxbrew
--prefix=/Cellar/xgcc/4.9.1
--with-native-system-header-dir=/opt/xglibc/include
--with-build-time-tools=/opt/xbinutils/bin
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9
--with-gmp=/home/sjackman/.linuxbrew/opt/gmp
--with-mpfr=/home/sjackman/.linuxbrew/opt/mpfr
--with-mpc=/home/sjackman/.linuxbrew/opt/libmpc
--with-cloog=/home/sjackman/.linuxbrew/opt/cloog
--with-isl=/home/sjackman/.linuxbrew/opt/isl --with-system-zlib
--enable-libstdcxx-time=yes --enable-stage1-checking
--enable-checking=release --enable-lto --disable-werror
--with-pkgversion='Homebrew xgcc 4.9.1' --without-multilib
--with-bugurl='https://github.com/Homebrew/homebrew/issues'
--enable-plugin --disable-nls --disable-multilib

Cheers,
Shaun

/home/sjackman/.linuxbrew/bin/gcc-4.9 -c -DHAVE_CONFIG_H -g
-I/home/sjackman/.linuxbrew/opt/xglibc/include
-I/home/sjackman/.linuxbrew/opt/xbinutils/include
-isystem/home/sjackman/.linuxbrew/include -I.
-I../../libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat
-Wstrict-prototypes -pedantic -fpic ../../libiberty/cp-demangle.c -o
pic/cp-demangle.o; \
else true; fi
In file included from ../../libiberty/cp-demangle.c:128:0:
../../libiberty/../include/libiberty.h: In function 'basename':
../../libiberty/../include/libiberty.h:110:38: error: expected
declaration specifiers before 'ATTRIBUTE_RETURNS_NONNULL'
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
Shaun Jackman
2014-08-28 20:49:57 UTC
Permalink
The version numbers are:

gcc 4.9.1
binutils 2.24
glibc 2.19
linux headers 3.15.9

Cheers,
Shaun
http://sjackman.ca
Post by Shaun Jackman
I'm seeing a strange error when compiling gcc --with-sysroot. So far
I've successfully (I think) installed the linux headers and compiled
and installed binutils and glibc for this sysroot. I'm working on GCC
now.
libiberty.h:110:38: error: expected declaration specifiers before
'ATTRIBUTE_RETURNS_NONNULL'
The configure line is as follows. Any thoughts? Here's the gist of
https://gist.github.com/sjackman/cdc4961f0d6751d7e1c0
config.log configure.log libiberty-config.log make.log
Cheers,
Shaun
../configure --with-sysroot=/home/sjackman/.linuxbrew
--prefix=/Cellar/xgcc/4.9.1
--with-native-system-header-dir=/opt/xglibc/include
--with-build-time-tools=/opt/xbinutils/bin
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9
--with-gmp=/home/sjackman/.linuxbrew/opt/gmp
--with-mpfr=/home/sjackman/.linuxbrew/opt/mpfr
--with-mpc=/home/sjackman/.linuxbrew/opt/libmpc
--with-cloog=/home/sjackman/.linuxbrew/opt/cloog
--with-isl=/home/sjackman/.linuxbrew/opt/isl --with-system-zlib
--enable-libstdcxx-time=yes --enable-stage1-checking
--enable-checking=release --enable-lto --disable-werror
--with-pkgversion='Homebrew xgcc 4.9.1' --without-multilib
--with-bugurl='https://github.com/Homebrew/homebrew/issues'
--enable-plugin --disable-nls --disable-multilib
Cheers,
Shaun
/home/sjackman/.linuxbrew/bin/gcc-4.9 -c -DHAVE_CONFIG_H -g
-I/home/sjackman/.linuxbrew/opt/xglibc/include
-I/home/sjackman/.linuxbrew/opt/xbinutils/include
-isystem/home/sjackman/.linuxbrew/include -I.
-I../../libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat
-Wstrict-prototypes -pedantic -fpic ../../libiberty/cp-demangle.c -o
pic/cp-demangle.o; \
else true; fi
../../libiberty/../include/libiberty.h:110:38: error: expected
declaration specifiers before 'ATTRIBUTE_RETURNS_NONNULL'
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
Marc Glisse
2014-08-28 22:12:43 UTC
Permalink
Post by Shaun Jackman
I'm seeing a strange error when compiling gcc --with-sysroot. So far
I've successfully (I think) installed the linux headers and compiled
and installed binutils and glibc for this sysroot. I'm working on GCC
now.
libiberty.h:110:38: error: expected declaration specifiers before
'ATTRIBUTE_RETURNS_NONNULL'
Looks like binutils (?) is bringing its own slightly older version of
ansidecl.h, and sadly gcc puts that -I flag before the one that would let
it find its own ansidecl.h. Some workarounds could be (pick only one):
* download a more recent binutils (a snapshot if there is no release)
* replace the ansidecl.h installed by binutils by the one you can find in
the gcc sources
* temporarily rename the ansidecl.h installed by binutils
--
Marc Glisse
Shaun Jackman
2014-08-29 19:32:56 UTC
Permalink
Post by Marc Glisse
Post by Shaun Jackman
I'm seeing a strange error when compiling gcc --with-sysroot. So far
I've successfully (I think) installed the linux headers and compiled
and installed binutils and glibc for this sysroot. I'm working on GCC
now.
libiberty.h:110:38: error: expected declaration specifiers before
'ATTRIBUTE_RETURNS_NONNULL'
Looks like binutils (?) is bringing its own slightly older version of
ansidecl.h, and sadly gcc puts that -I flag before the one that would let it
* download a more recent binutils (a snapshot if there is no release)
* replace the ansidecl.h installed by binutils by the one you can find in
the gcc sources
* temporarily rename the ansidecl.h installed by binutils
--
Marc Glisse
I opted for #3 `temporarily rename the ansidecl.h installed by
binutils`, and it worked nicely. Thanks for your help, Marc.

Cheers,
Shaun

Loading...