public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44855] Static members not initialised in explicit template instances of library
[not found] <bug-44855-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-29 19:51 ` redi at gcc dot gnu.org
2011-03-29 20:26 ` redi at gcc dot gnu.org
2011-10-02 10:19 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-29 19:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-29 19:05:32 UTC ---
I can reproduce this on Fedora 13
using -fpic or -fPIC fixes it (as well as avoiding SELinux "permission denied"
errors when loading the shared object)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
[not found] <bug-44855-4@http.gcc.gnu.org/bugzilla/>
2011-03-29 19:51 ` [Bug c++/44855] Static members not initialised in explicit template instances of library redi at gcc dot gnu.org
@ 2011-03-29 20:26 ` redi at gcc dot gnu.org
2011-10-02 10:19 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-29 20:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-29 19:51:15 UTC ---
I should have read the code properly ... if you've suppressed implicit
instantiation in main.cpp and you want the explicit instantiation in a shared
object to be used I would expect that you need to *either* use -fpic so the
instantiation in the .so is used *or* declare the explicit instantiation by
uncommenting the "extern template" declaration.
So I think the behaviour you're seeing is normal
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
[not found] <bug-44855-4@http.gcc.gnu.org/bugzilla/>
2011-03-29 19:51 ` [Bug c++/44855] Static members not initialised in explicit template instances of library redi at gcc dot gnu.org
2011-03-29 20:26 ` redi at gcc dot gnu.org
@ 2011-10-02 10:19 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-02 10:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
CC|gcc-bugs at gcc dot gnu.org |
Resolution| |INVALID
--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-02 10:19:01 UTC ---
Closing.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
` (4 preceding siblings ...)
2010-07-25 2:14 ` pinskia at gcc dot gnu dot org
@ 2010-07-25 6:35 ` hlprasu at gmail dot com
5 siblings, 0 replies; 9+ messages in thread
From: hlprasu at gmail dot com @ 2010-07-25 6:35 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]
------- Comment #6 from hlprasu at gmail dot com 2010-07-25 06:35 -------
Subject: Re: Static members not initialised in explicit
template instances of library
Output of "gcc -v" is given below. I'm using Fedora 13 (with updates
till July 24, 2010). The error still persists.
===================
Using built-in specs.
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
===================
On 25 July 2010 07:43, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> ------- Comment #5 from pinskia at gcc dot gnu dot org  2010-07-25 02:13 -------
> Works for me on the trunk and in 4.3.2.
>
> Can you give the output of "gcc -v"?
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
` (3 preceding siblings ...)
2010-07-25 2:04 ` pinskia at gcc dot gnu dot org
@ 2010-07-25 2:14 ` pinskia at gcc dot gnu dot org
2010-07-25 6:35 ` hlprasu at gmail dot com
5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-25 2:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2010-07-25 02:13 -------
Works for me on the trunk and in 4.3.2.
Can you give the output of "gcc -v"?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
` (2 preceding siblings ...)
2010-07-07 9:30 ` hlprasu at gmail dot com
@ 2010-07-25 2:04 ` pinskia at gcc dot gnu dot org
2010-07-25 2:14 ` pinskia at gcc dot gnu dot org
2010-07-25 6:35 ` hlprasu at gmail dot com
5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-25 2:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2010-07-25 02:04 -------
Well for x86_64 we get an error:
/usr/bin/ld: testLib.o: relocation R_X86_64_32 against `a local symbol' can not
be used when making a shared object; recompile with -fPIC
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
2010-07-07 7:22 ` [Bug c++/44855] " hlprasu at gmail dot com
2010-07-07 9:18 ` redi at gcc dot gnu dot org
@ 2010-07-07 9:30 ` hlprasu at gmail dot com
2010-07-25 2:04 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: hlprasu at gmail dot com @ 2010-07-07 9:30 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
------- Comment #3 from hlprasu at gmail dot com 2010-07-07 09:30 -------
Subject: Re: Static members not initialised in explicit
template instances of library
But, as I know, no where is it mentioned to be necessary for static
member initialisation. Why should the compiler allow for such a subtle
error? Or is this documented somewhere?
Besides this issue, I've not faced any other problem in using shared
library by not using -fPIC. Could you please point out the necessary
implications that I am missing here?
On 7 July 2010 14:48, redi at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #2 from redi at gcc dot gnu dot org  2010-07-07 09:18 -------
> You need to use -fPIC for a shared object, so the version without that is not
> valid.
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
2010-07-07 7:22 ` [Bug c++/44855] " hlprasu at gmail dot com
@ 2010-07-07 9:18 ` redi at gcc dot gnu dot org
2010-07-07 9:30 ` hlprasu at gmail dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-07 9:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from redi at gcc dot gnu dot org 2010-07-07 09:18 -------
You need to use -fPIC for a shared object, so the version without that is not
valid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/44855] Static members not initialised in explicit template instances of library
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
@ 2010-07-07 7:22 ` hlprasu at gmail dot com
2010-07-07 9:18 ` redi at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: hlprasu at gmail dot com @ 2010-07-07 7:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hlprasu at gmail dot com 2010-07-07 07:22 -------
Created an attachment (id=21120)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21120&action=view)
The test case attached
To simplify the task of whomsoever who wants to see the behaviour, all the
files mentioned in my previous post is packaged in a tar.bz2 file attached
here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44855
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-10-02 10:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-44855-4@http.gcc.gnu.org/bugzilla/>
2011-03-29 19:51 ` [Bug c++/44855] Static members not initialised in explicit template instances of library redi at gcc dot gnu.org
2011-03-29 20:26 ` redi at gcc dot gnu.org
2011-10-02 10:19 ` paolo.carlini at oracle dot com
2010-07-07 7:17 [Bug c++/44855] New: " hlprasu at gmail dot com
2010-07-07 7:22 ` [Bug c++/44855] " hlprasu at gmail dot com
2010-07-07 9:18 ` redi at gcc dot gnu dot org
2010-07-07 9:30 ` hlprasu at gmail dot com
2010-07-25 2:04 ` pinskia at gcc dot gnu dot org
2010-07-25 2:14 ` pinskia at gcc dot gnu dot org
2010-07-25 6:35 ` hlprasu at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).