Skip to content

Commit fa2e459

Browse files
committed
(perl #131786) avoid a duplicate symbol error on _LIB_VERSION
For -flto -mieee-fp builds, the _LIB_VERSION definition in perl.c and in libieee conflict, causing a build failure. The test we perform in Configure checks only that such a variable exists (and is declared), it doesn't check that we can *define* such a variable, which the code in pp.c tried to do. So rather than trying to define the variable, just initialize it during our normal interpreter initialization.
1 parent 1be62ab commit fa2e459

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

perl.c

+8
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ perl_construct(pTHXx)
286286
PL_localpatches = local_patches; /* For possible -v */
287287
#endif
288288

289+
#if defined(LIBM_LIB_VERSION)
290+
/*
291+
* Some BSDs and Cygwin default to POSIX math instead of IEEE.
292+
* This switches them over to IEEE.
293+
*/
294+
_LIB_VERSION = _IEEE_;
295+
#endif
296+
289297
#ifdef HAVE_INTERP_INTERN
290298
sys_intern_init();
291299
#endif

pp.c

-8
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
extern Pid_t getpid (void);
4040
#endif
4141

42-
/*
43-
* Some BSDs and Cygwin default to POSIX math instead of IEEE.
44-
* This switches them over to IEEE.
45-
*/
46-
#if defined(LIBM_LIB_VERSION)
47-
_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
48-
#endif
49-
5042
static const STRLEN small_mu_len = sizeof(GREEK_SMALL_LETTER_MU_UTF8) - 1;
5143
static const STRLEN capital_iota_len = sizeof(GREEK_CAPITAL_LETTER_IOTA_UTF8) - 1;
5244

0 commit comments

Comments
 (0)