Oops, I should have learned my lesson.  Well, here it is again.  I think my
original email 6 days ago was good though.

--David

On Mon, May 1, 2017 at 11:47 AM, Ruben Van Boxem <vanboxem.ru...@gmail.com>
wrote:

> Your attachment was eaten by the Sourceforge cookie monster :)
>
>
>
> 2017-05-01 18:55 GMT+02:00 David Grayson <davidegray...@gmail.com>:
>
> > I sent a patch to this list 6 days ago that fixes a problem with the way
> we
> > use the selectany attribute.  If you're getting multiple definition
> errors
> > for GUIDs, this will probably fix it.  I'll attach it again.
> >
> > --David
> >
> > On Mon, May 1, 2017 at 9:34 AM, Mateusz Mikuła <mati...@gmail.com>
> wrote:
> >
> > > Symbols in libuuid.a are definitely duplicated, tested on MSYS2,
> Ubuntu,
> > > Arch:
> > >
> > > nm '/usr/x86_64-w64-mingw32/lib/libuuid.a' | grep FileProtocol
> > > 0000000000000000 R CLSID_FileProtocol
> > > 0000000000000000 r .rdata$CLSID_FileProtocol
> > > 00000000000000f0 R CLSID_FileProtocol
> > >
> > > Here is disassembly of first duplicated symbol from Ubuntu:
> > > https://paste.ubuntu.com/24493619/
> > >
> > >
> > > 2017-05-01 18:03 GMT+02:00 Liu Hao <lh_mo...@126.com>:
> > >
> > > > On 2017/5/1 21:27, Tomay wrote:
> > > > > The following UUIDs are defined in both *uuid.c* and *extra-uuid.c*
> > > > source
> > > > > files, whitch leads to linking errors with duplicate symbols when
> > using
> > > > > *libuuid.a*
> > > > >
> > > > In my opinion it is practically incorrect, but you shouldn't get
> linker
> > > > errors because the macro `INITGUID` is defined in both files hence
> each
> > > > GUID definition is marked with the `selectany` attribute (see
> > definition
> > > > of the macro `DEFINE_GUID` in [guiddef.h]).
> > > >
> > > > --
> > > > Best regards,
> > > > LH_Mouse
> > > >
> > > >
> > > > ------------------------------------------------------------
> > > > ------------------
> > > > Check out the vibrant tech community on one of the world's most
> > > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > > > _______________________________________________
> > > > Mingw-w64-public mailing list
> > > > Mingw-w64-public@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> > > >
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Mingw-w64-public mailing list
> > > Mingw-w64-public@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> > >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Mingw-w64-public mailing list
> > Mingw-w64-public@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
> >
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
From 7ce782720ce2190442bd835518ebc63e246b0050 Mon Sep 17 00:00:00 2001
From: David Grayson <davidegray...@gmail.com>
Date: Tue, 25 Apr 2017 07:41:45 -0700
Subject: [PATCH] guiddef.h: Use __declspec(selectany) on GUID declarations.

If __declspec(selectany) is not used on the prototype but later used
on a definition, GCC seems to ignore it, and you can get
multiple-definition errors at link time.

That situation can arise in code like Microsoft's usbview utility that
has multiple translation units including the following headers in this
order:  windows.h, initguid.h, winioctl.h.
---
 mingw-w64-headers/include/guiddef.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-headers/include/guiddef.h 
b/mingw-w64-headers/include/guiddef.h
index 8d0af1ed..6c9444cf 100644
--- a/mingw-w64-headers/include/guiddef.h
+++ b/mingw-w64-headers/include/guiddef.h
@@ -55,13 +55,13 @@ __extension__ template<typename T> const GUID 
&__mingw_uuidof();
 #ifdef __cplusplus
 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID 
DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
 #else
 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID 
DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
 #endif
 #else
-#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID 
name
+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID 
DECLSPEC_SELECTANY name
 #endif
 
 #define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID (name, l, w1, w2, 0xc0, 0, 
0, 0, 0, 0, 0, 0x46)
 
 #ifndef _GUIDDEF_H_
 #define _GUIDDEF_H_
-- 
2.12.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to