Skip to content

Commit

Permalink
(perl #131786) avoid a duplicate symbol error on _LIB_VERSION
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tonycoz committed Aug 10, 2017
1 parent 1be62ab commit fa2e459
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions perl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fa2e459

Please sign in to comment.