[PATCH] Enable building LTO on WIN32

Greg_Bedwell at sn.scee.net Greg_Bedwell at sn.scee.net
Mon Sep 30 06:31:54 PDT 2013


Hi,

> Instead of creating a .def file, can't we annotate the source with 
dllexport?
> 

I'm happy to make that change if that's the way that is generally 
preferred.  In general for Windows-only code I'd choose dllexport 
annotations over creating a .def file to keep the information 
contained/documented in the header.  My concern here was that the Makefile 
builds already use the lto.exports file as the canonical list of exported 
functions so by using that as the basis for the Windows DLL exports we've 
only got the information in a single place so there's no ongoing work to 
keep them in sync (beyond having to rerun CMake - a further improvement 
might be to see if we can move that process into build time rather than 
CMake time).

I'll go with whatever option is preferred.  Personally, for the above 
reason I prefer the def file approach in this case but I don't have a 
particularly strong opinion if the exported interface is expected to 
generally remain fairly stable.

Thanks,

-Greg


> On 27 September 2013 16:18,  <Greg_Bedwell at sn.scee.net> wrote:
> > Hi,
> >
> > I've attached a patch which enables building the LTO library (.lib and
> > .dll) and llvm-lto.exe on Windows with MSVC and Mingw as well as
> > re-enabling the associated test.  I've left the Cygwin behaviour 
disabled,
> > purely because I was unable to build LLVM in the first place using 
cygwin
> > and CMake despite spending many hours trying.  I don't see why there's 
any
> > reason why, in theory, this change won't also work for Cygwin but as 
I'm
> > unable to test it I've been conservative and left the behaviour 
disabled
> > in that case.  I've verified that the dll is exporting the correct 
symbols
> > specified in the .def file in both the MSVC and MinGW cases.
> >
> >
> >
> >
> > I'd be grateful for any feedback.  If it looks okay, please commit for 
me
> > as I don't yet have commit access.
> >
> > Thanks,
> >
> > --Greg Bedwell
> > SN Systems - Sony Computer Entertainment Group
> > http://www.snsys.com
> >
> >
> > **********************************************************************
> > This email and any files transmitted with it are confidential and 
intended
> > solely for the use of the individual or entity to whom they are 
addressed.
> > If you have received this email in error please notify 
postmaster at scee.net
> > This footnote also confirms that this email message has been checked 
for
> > all known viruses.
> > Sony Computer Entertainment Europe Limited
> > Registered Office: 10 Great Marlborough Street, London W1F 7LP, United
> > Kingdom
> > Registered in England: 3277793
> > **********************************************************************
> >
> > P Please consider the environment before printing this e-mail
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >


**********************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify postmaster at scee.net
This footnote also confirms that this email message has been checked for 
all known viruses.
Sony Computer Entertainment Europe Limited
Registered Office: 10 Great Marlborough Street, London W1F 7LP, United 
Kingdom
Registered in England: 3277793
**********************************************************************

P Please consider the environment before printing this e-mail



More information about the llvm-commits mailing list