Project

General

Profile

Actions

Bug #5395

open

Build on Solaris 11.2 chokes on __ATTR_DEPRECATED

Added by Gary Mills over 6 years ago. Updated over 6 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
tools - gate/build tools
Start date:
2014-12-05
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

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 6 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 6 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
...
-I.../usr/src/lib/libelfsign/common
-I.../usr/src/uts/common
-I.../usr/src/lib/libkmf/include
-I.../usr/src/lib/libcryptoutil/common
-c -o elfsignlib.o
.../usr/src/lib/libelfsign/common/elfsignlib.c
-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 6 years ago

Yuck.

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 6 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 6 years ago

Oh, man.

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

Actions #6

Updated by Gordon Ross over 6 years ago

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

Actions

Also available in: Atom PDF