Subject: | Makefile.PL overrides CCFLAGS |
Makefile.PL sets CCFLAGS like this:
CCFLAGS => '-Wall',
This effectively ignores default Perl compiler flags initialized from $Config{ccflags}. CCFLAGS can influence resulting executable ABI and hence make the module unloadable.
E.g. in my i686 machine it strips these default CCFLAGS "-D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" with Makefile.PL's "-Wall" and then the tests panic with this message:
VCardFast.c: loadable library and perl binaries are mismatched (got handshake key 0x7dc0080, needed 0x7ec0080).
Subject: | Text-VCardFast-0.09-Respect-default-CCFLAGS.patch |
From 4d51e834cae14457020184e165ce0541e043abc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 15 Nov 2016 17:39:27 +0100
Subject: [PATCH] Respect default CCFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
EU::MM's CCFLAGS variable is initialized from Perl's default
$Config{ccflags}. Ignoring the default value can make the resulting
binary module incomaptible with the perl.
This patch adds the local flags to the default flags instead of
replacing them.
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
Makefile.PL | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile.PL b/Makefile.PL
index d38bc85..e5a67b7 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,5 +1,6 @@
use 5.014002;
use ExtUtils::MakeMaker;
+use Config;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
@@ -19,5 +20,5 @@ WriteMakefile(
INC => '-I.', # e.g., '-I. -I/usr/include/other'
# Un-comment this if you add C files to link with later:
OBJECT => '$(O_FILES)', # link all the C files too
- CCFLAGS => '-Wall',
+ CCFLAGS => '-Wall ' . $Config{ccflags},
);
--
2.7.4