Bug #5395


Build on Solaris 11.2 chokes on __ATTR_DEPRECATED

Added by Gary Mills over 8 years ago. Updated about 8 years ago.

tools - gate/build tools
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:


Building illumos on a Solaris 11.2 server results in many errors like this:

syntax error before or at: __ATTR_DEPRECATED

The problem occurs when header files included from the illumos source are mixed with header files from the build host. Both gcc and the Studio compiler choke on that symbol.

A fix is to add this line near the end of usr/src/uts/common/sys/ccompile.h:

#define __ATTR_DEPRECATED /* ignore */

There may be better solutions, but this one works.

Actions #1

Updated by Rich Lowe over 8 years ago

  • Status changed from New to Feedback

Building on real Solaris systems is totally not something we support.

That said, mixing our headers and build system headers is, a lot of the time, a bug. We shouldn't do that. Build-time tools need to be using system headers, delivered objects need to be using proto headers.

You should be looking for what mixes headers up and why.

Actions #2

Updated by Gary Mills over 8 years ago

The first error was this one:

"/usr/include/unistd.h", line 531: syntax error before or at: __ATTR_DEPRECATED
/usr/include/unistd.h:531:26: error: expected declaration specifiers before '__ATTR_DEPRECATED'
/usr/include/unistd.h:534:13: error: storage class specified for parameter 'vhangup'

It happened for this compile because the `-I' directories were all for the illumos source. The build looked like this:

+ /usr/gcc/4.8/bin/gcc -fident -finline -fno-inline-functions
-c -o elfsignlib.o
-mcpu=v8 -mno-v8plus

For some reason, it got unistd.h from the build host. The same problem happens in other places too.

Actions #3

Updated by Rich Lowe over 8 years ago


That's elfsign deliberately (and not particularly sanely, or safely) mixing host and build headers, while building the tools elfsign (which we never actually use, and I thought someone was going to remove...)

Do you have a list of the other places, too? It'd be worth recording at least what they are. (I'm betting elfdump is one, since I've broken the build on older build machines there before, for the same basic reason...)

Actions #4

Updated by Gary Mills over 8 years ago

There are several hundred syntax errors in a build that mention __ATTR_DEPRECATED . I can get a list of source files, but it won't be complete and won't be entirely accurate.

Actions #5

Updated by Rich Lowe over 8 years ago

Oh, man.

I didn't think it would be nearly that bad.

Actions #6

Updated by Gordon Ross about 8 years ago

FYI elfdump no longer mixes build host and target build headers (after #5106 is fixed).


Also available in: Atom PDF