Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect $Config{ccflags} #5

Closed
wants to merge 1 commit into from
Closed

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Mar 15, 2017

Current Makefile.PL does not respect perl's ccflags and that leads to broken builds on some systems. This is the fix.

$Config{ccflags} must be passed to all XS compiler invocations
because they define ABI. Not doing so can lead to mismatched shared
library ABI as can bee seen on 32-bit perl with enabled 64-bit file
offsets (-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64):

armv7hl-redhat-linux-gnueabi-gcc -c   -I/usr/include/pkgconf -DMY_PKGCONF_VERSION=1.3.0 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16  -mfloat-abi=hard   -DVERSION=\"0.06\" -DXS_VERSION=\"0.06\" -fPIC "-I/usr/lib/perl5/CORE"   LibPkgConf.c
[...]
make test
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- LibPkgConf.bs blib/arch/auto/PkgConfig/LibPkgConf/LibPkgConf.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
LibPkgConf.c: loadable library and perl binaries are mismatched (got handshake key 0x8e00080, needed 0x9000080)
t/00_diag.t ...
Dubious, test returned 1 (wstat 256, 0x100)

This patch fixes Makefile.PL to respect ccflags value provided by perl.
plicease added a commit that referenced this pull request Mar 15, 2017
@plicease
Copy link
Member

I agree those flags should be in there, but I would like to put the pkgconf flags first because $Config{ccflags} could (and does on my freebsd) have -I/usr/local/include, which has a different version of pkgconf than what is provided by Alien::pkgconf, which also causes brokenness.

Does that sound reasonable?

plicease added a commit that referenced this pull request Mar 15, 2017
@ppisar
Copy link
Contributor Author

ppisar commented Mar 15, 2017 via email

@plicease
Copy link
Member

Great! I have released 0.07, which I believe should address this issue. Thank you for reporting it, I suspect some of the cpantester failures are due to this.

@plicease plicease closed this Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants