[OpenAFS-devel] Re: Building OpenAFS on SmartOS

Andrew Deason adeason@sinenomine.net
Sat, 3 May 2014 20:41:36 -0500


On Sat, 3 May 2014 15:01:26 -0400
Coy Hile <coy.hile@coyhile.com> wrote:

> Firstly, is there any guide or best practice for converting a makefile
> between supporting the Studio compilers and gcc?  So far, I’ve figured
> out that -KPIC in CFLAGS becomes -fPIC, and that there’s no -mt option
> to gcc.  

-mt becomes -pthread, essentially. For anything else, look at what Linux
(or almost any other platform) uses for compiling the same file; or just
ask.

> The second is perhaps of more use; what is the consensus about doing
> the changes to autoconf’d bits to support gcc if on SmartOS?  Would
> case statements for “joyent” in uname -v output be the best way to
> differentiate between SmartOS and everybody else who still uses
> studio?  If I can get the first question sorted, I can certainly get
> something that will work; the question is whether a local patch that I
> keep around in my own repos, or if it’s something the larger community
> would like to see contributed back.

We'd definitely want it contributed back in the tree. It's the same
sysname, right? That is, binaries for it would still generally run on
Solaris.

What I think would be okay for now is: have some "gcc" or "sunwspro"
flag/setting, and default it to gcc for the uname "joyent" case as
above, and sunwspro for everywhere else.

Ideally we should just use whichever is available for userspace. And for
the kernel, if there's any way of reliably determining which we're
supposed to use for kernel modules, use that (as in, probing directly
for the format of certain object files, or something in a header or
something, instead of detecting smartOS vs Solaris vs whatever). But
having a global setting for everything is an improvement, and enough to
get it working for now.

-- 
Andrew Deason
adeason@sinenomine.net