[Mesa-dev] [PATCH 44/48] meson: add windows specific linker flags

Dylan Baker dylan at pnwbakers.com
Thu Jun 14 21:20:38 UTC 2018


Quoting Jose Fonseca (2018-06-14 14:02:39)
> On 12/06/18 17:50, Dylan Baker wrote:
> > Quoting Eric Engestrom (2018-06-12 04:38:04)
> >> On Monday, 2018-06-11 15:56:11 -0700, Dylan Baker wrote:
> >>> ---
> >>>   meson.build | 21 +++++++++++++++++++++
> >>>   1 file changed, 21 insertions(+)
> >>>
> >>> diff --git a/meson.build b/meson.build
> >>> index a244694fd4a..e1b3afbe688 100644
> >>> --- a/meson.build
> >>> +++ b/meson.build
> >>> @@ -847,6 +847,27 @@ else
> >>>     endforeach
> >>>   endif
> >>>   
> >>> +# set linker arguments
> >>> +if host_machine.system() == 'windows'
> >>> +  if cc.get_id() == 'msvc'
> >>> +    add_project_link_arguments(
> >>> +      '/fixed:no',
> >>> +      '/incremental:no',
> >>> +      '/dynamicbase',
> >>> +      '/nxcompat',
> >>> +      language : ['c', 'cpp'],
> >>> +    )
> >>> +  else
> >>> +    add_project_link_arguments(
> >>> +      '-Wl,--nxcompat',
> >>> +      '-Wl,--dynamicbase',
> >>> +      '-static-libgcc',
> >>> +      '-static-libstdc++',
> >>> +      language : ['c', 'cpp'],
> >>
> >> probably harmless, but it feels like libgcc and libstdc++ should be
> >> only added to c, respectively cpp, not both.
> > 
> > cpp needs -static-libgcc if the target has both C and C++ code, right?
> > 
> > I copied this from scons/gallium.py.
> > 
> > Brian or Jose, I don't know what the right think to do is here, do one of you
> > guys?
> > 
> > Dylan
> > 
> 
> I'm not entirely sure.
> 
> The thing is, one should always use /usr/bin/c++ for linking whenever 
> there's a C++ dependency, even if the main program is just C.
> 
> I'd go for both, just in case.  At any rate, I doubt it harms.
> 
> Jose

Okay, then I think I'll just stick to both as I couldn't find anything when I
googled it.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180614/6099580c/attachment.sig>


More information about the mesa-dev mailing list