Subject: Re: [Boost-build] Problem with the Sun toolset and C compiles
From: Edward Diener (eldiener_at_[hidden])
Date: 2013-12-30 14:19:21
On 12/29/2013 08:11 AM, Vladimir Prus wrote:
> On 29.12.2013 10:45, Edward Diener wrote:
>> The problem I have uncovered is if the Sun toolset is being used and
>> one is compiling C, as opposed to C++, files with it. In this case the
>> toolset correctly invokes the Sun compiler using 'cc' rather than
>> 'CC'. Unfortunately when it invokes the 'cc' compiler it still passes the
>> -KPIC option to the compiler and this produces an error from the
>> compiler of:
>> cc: error: unrecognized command line option -KPIC
>> and the compilation fails.
>> Could this please be corrected in the Boost Build toolset for this
>> compiler so that invoking the C compiler does not pass this option ? If
>> necessary I will be glad to create a Trac item for this but I wanted
>> to bring it to the attention of Boost Build here.
> That does not sound right. If you don't pass this option when compiling
> C sources, then it will likely cause C sources to be not
> compiled as PIC code when building shared libraries, and that's a bad
> thing. It seems strange to me that this option is not accepted
> by a C compiler. Can you investigate why is so, and how do I make C
> compiler generate PIC on Sun?
This is my mistake. I was not giving the path to the Sun compiler and
'cc' was picking up gcc instead. Once I put the path to the compiler in
my user-config.jam file the compilation succeeded.
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk