summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2017-08-02 16:15:06 +1000
committerSteve Hay <steve.m.hay@googlemail.com>2018-03-12 13:06:36 +0000
commit1e4ebce09b6f4055f05bb265cdb3777377e82e1c (patch)
tree7cd0abc9095988eb849a6a27dad1741b9cb1f817
parent7c8883553693f50ae9cab1390a49fbc01f206be7 (diff)
downloadperl-1e4ebce09b6f4055f05bb265cdb3777377e82e1c.tar.gz
(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. (cherry picked from commit fa2e45943e2b6ce22cf70dba5b47afe73c8c7c80)
-rw-r--r--perl.c8
-rw-r--r--pp.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/perl.c b/perl.c
index 829a7abf80..384b2944c5 100644
--- a/perl.c
+++ b/perl.c
@@ -286,6 +286,14 @@ perl_construct(pTHXx)
PL_localpatches = local_patches; /* For possible -v */
#endif
+#if defined(LIBM_LIB_VERSION)
+ /*
+ * Some BSDs and Cygwin default to POSIX math instead of IEEE.
+ * This switches them over to IEEE.
+ */
+ _LIB_VERSION = _IEEE_;
+#endif
+
#ifdef HAVE_INTERP_INTERN
sys_intern_init();
#endif
diff --git a/pp.c b/pp.c
index 1d09a1ff48..fbba3bd185 100644
--- a/pp.c
+++ b/pp.c
@@ -39,14 +39,6 @@
extern Pid_t getpid (void);
#endif
-/*
- * Some BSDs and Cygwin default to POSIX math instead of IEEE.
- * This switches them over to IEEE.
- */
-#if defined(LIBM_LIB_VERSION)
- _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
-#endif
-
static const STRLEN small_mu_len = sizeof(GREEK_SMALL_LETTER_MU_UTF8) - 1;
static const STRLEN capital_iota_len = sizeof(GREEK_CAPITAL_LETTER_IOTA_UTF8) - 1;