Fix for compiling on Solaris

Bill Rushmore bill.rushmore at oracle.com
Fri Feb 27 11:11:35 PST 2015


Eric,

The Solaris linker's equivalent is (sorry I didn't realize this earlier):

-Wl,-z -Wl,discard-unused=sections

We can use -ffunction-section/-fdata-sections with Solaris' GCC. We also 
need to pass -falign-functions=8.

I will rework the patch with these changes, test it, and then resend.

Bill

On 2/27/2015 10:27 AM, Eric Christopher wrote:
> Hi Bill,
>
> Will the sun linker gc the sections itself then? or do we need to 
> avoid using -ffunction-section/-fdata-sections as well?
>
> -eric
>
> On Fri, Feb 27, 2015 at 10:09 AM bill rushmore 
> <bill.rushmore at oracle.com <mailto:bill.rushmore at oracle.com>> wrote:
>
>     I have a very simple patch for Makefile.rules that solves the
>     problem of
>     trying to build on Solaris.  The issue is that Solaris' gcc uses the
>     Solaris linker and that linker doesn't have the --gc-sections flag.
>     This patch fixes Bug 18517.
>
>     Bill Rushmore
>     _______________________________________________
>     llvm-commits mailing list
>     llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150227/3c84be22/attachment.html>


More information about the llvm-commits mailing list