[
https://issues.apache.org/jira/browse/STDCXX-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570898#action_12570898
]
Martin Sebor commented on STDCXX-737:
-------------------------------------
I don't see the duplicate {{_RWSTD_NO_EXTERN_FUNCTION_TEMPLATE}} macro in a
config.h generated for 4.2.0:
{noformat}
$ cat -n ../include/config.h | grep EXTERN_FUNCTION_TEMPLATE
408 #define _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
{noformat}
but I do see two invocations of the compiler for the test:
{noformat}
$ cat -n ../include/config.log | grep EXTERN_FUNCTION_TEMPLATE
791 gcc -D_RWSTDDEBUG -pthread -I. -pedantic -nostdinc++ -g -W -Wall
-Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align -c
/home/sebor/stdcxx-4.2.0/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp -o
EXTERN_FUNCTION_TEMPLATE.o
792
/home/sebor/stdcxx-4.2.0/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp:54: error:
ISO C++ forbids the use of 'extern' on explicit instantiations
832 gcc -D_RWSTDDEBUG -pthread -I. -pedantic -nostdinc++ -g -W -Wall
-Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align -c
/home/sebor/stdcxx-4.2.0/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp -o
EXTERN_FUNCTION_TEMPLATE.o
833
/home/sebor/stdcxx-4.2.0/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp:54: error:
ISO C++ forbids the use of 'extern' on explicit instantiations
{noformat}
> Configure tests might be compiled twice.
> ----------------------------------------
>
> Key: STDCXX-737
> URL: https://issues.apache.org/jira/browse/STDCXX-737
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
> Environment: unix
> Reporter: Farid Zaripov
> Assignee: Martin Sebor
>
> From
> http://www.nabble.com/forum/Permalink.jtp?root=15579207&post=15593021&page=y :
> I made this change in GNUmakefile because the
> EXTERN_FUNCTION_TEMPLATE.cpp
> config test has compiled twice on my gcc/Linux:
> 1) first it was not linked with extern_function_template_imp.o and due
> to this
> the macro _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE is defined in config.h
> config.log:
> ---------
> ...
> gcc -D_RWSTDDEBUG -pthread -I. -pedantic -nostdinc++ -g -W -Wall
> -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long
> -Wcast-align -c
> /usr/src/trunk/etc/config/src/extern_function_template_imp.cpp -o
> extern_function_template_imp.o
> gcc -D_RWSTDDEBUG -pthread -I. -pedantic -nostdinc++ -g -W -Wall
> -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long
> -Wcast-align -c
> /usr/src/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp -o
> EXTERN_FUNCTION_TEMPLATE.o
> gcc EXTERN_FUNCTION_TEMPLATE.o -pthread -lm -lsupc++ -o
> EXTERN_FUNCTION_TEMPLATE
> EXTERN_FUNCTION_TEMPLATE.o(.text+0x26): In function `main':
> /usr/src/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp:47: undefined
> reference to `S<int> foobar<int>(S<int>)'
> collect2: ld returned 1 exit status
> ...
> ---------
> config.h:
> ---------
> ...
> // #define _RWSTD_NO_extern_function_template_imp
> #define _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
> ...
> ---------
> 2) second it was linked with extern_function_template_imp.o and the
> config.h contains the second entry, where
> _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE define is commented
> config.log:
> ---------
> ...gcc -D_RWSTDDEBUG -pthread -I. -pedantic -nostdinc++ -g -W -Wall
> -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long
> -Wcast-align -c
> /usr/src/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp -o
> EXTERN_FUNCTION_TEMPLATE.o
> gcc EXTERN_FUNCTION_TEMPLATE.o -pthread extern_function_template_imp.o
> -lm -lsupc++ -o EXTERN_FUNCTION_TEMPLATE
> ./EXTERN_FUNCTION_TEMPLATE
> ...
> ---------
> config.h:
> ---------
> ...
> // #define _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
> ...
> ---------
> As a result the _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE macro is defined
> while gcc supports the extern function templates.
> The first compilation is come from "%.o: %.cpp" rule, and the second -
> from "config:" rule.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.