Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-16 Thread Arthur Norman
OTOH: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697#c20 Thank you again. On looking harder on gcc bugzilla I found a related case from mid 2017 that had not been looked at yet, so I have tried adding my report to that. And meanwhile in my own code I am using work-arounds! The prompt

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-15 Thread Brian Inglis
On 2019-11-15 20:35, Brian Inglis wrote: > On 2019-11-15 15:25, Arthur Norman wrote: >>> I notice that you are not independently compiling your source files and >>> have no >>> include guard in t.h. >>> Could I suggest that you add the include guard to t.h and retest. >>> If you still have an

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-15 Thread Brian Inglis
On 2019-11-15 15:25, Arthur Norman wrote: >> I notice that you are not independently compiling your source files and have >> no >> include guard in t.h. >> Could I suggest that you add the include guard to t.h and retest. >> If you still have an issue, try independently compiling your source

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-15 Thread Arthur Norman
I notice that you are not independently compiling your source files and have no include guard in t.h. Could I suggest that you add the include guard to t.h and retest. If you still have an issue, try independently compiling your source files, then linking them as a separate step, to see if that

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-15 Thread Brian Inglis
On 2019-11-15 00:55, Arthur Norman wrote: >> You appear to be running into a conflict with Cygwin managing Windows TLS, as >> Cygwin does its own messing around to support Unix/Linux/POSIX/g++ semantics >> for >> TLS and everything else under Windows. You should either use the supplied >> API,

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-14 Thread Arthur Norman
You appear to be running into a conflict with Cygwin managing Windows TLS, as Cygwin does its own messing around to support Unix/Linux/POSIX/g++ semantics for TLS and everything else under Windows. You should either use the supplied API, or write a Windows program that allows you to control TLS

Re: linker fails with multiple definitions after inline thread_local var within class

2019-11-14 Thread Brian Inglis
On 2019-11-14 11:23, Arthur Norman wrote: > When I run this on Ubuntu-x86_64, Macintosh(clang) or a Raspberry pi the code > links and when it runs it just prints 999 - which is the behaviour that I > expect. On both Cygwin and using x86_64-w64-mingw32-g++ (and i686) I get a > linker diagnostic of

linker fails with multiple definitions after inline thread_local var within class

2019-11-14 Thread Arthur Norman
#! /bin/bash # When I run this on Ubuntu-x86_64, Macintosh(clang) or a Raspberry pi # the code links and when it runs it just prints 999 - which is the behaviour # that I expect. On both Cygwin and using x86_64-w64-mingw32-g++ (and i686) # I get a linker diagnostic of the form # ./tltest.sh #