lestrrat/Digest-MurmurHash3 — pull request #1 by smly (2014-06-11 00:34:11+00:00)
Title: Compile issue caused by linking the code with gcc

Hi lestrrat,

I found a compile issue caused by linking the code with gcc instead of g++.
It would compile fine, but fail to load at startup,
unable to locate symbol `__gxx_personality_v0`.
To resolve the issue, I explicitly added `-lstdc++` to the link flags.
I guess this PR will improve portability.

The build log (without this patch applied):
(same case of http://cpantesters.org/cpan/report/ae31c58a-d484-11e3-a04e-1d26e0bfc7aa).

```
$ cpanm -L extlibs/centos6 Digest::MurmurHash3
--> Working on Digest::MurmurHash3
Fetching http://www.cpan.org/authors/id/D/DM/DMAKI/Digest-MurmurHash3-0.02.tar.gz ... OK

(snip)

Building and testing Digest-MurmurHash3-0.02
cp lib/Digest/MurmurHash3.pm blib/lib/Digest/MurmurHash3.pm
cc -c "-I." "-I." -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c++ -O2 -DVERSION=\"0.02\" -DXS_VERSION=\"0.02\" -o src/MurmurHash3.o -fPIC "-I/opt/perlbrew/perls/perl-5.12.2/lib/5.12.2/x86_64-linux/CORE" -DUSE_PPPORT -DHAVE_64BITINT src/MurmurHash3.cpp
/opt/perlbrew/perls/perl-5.12.2/bin/perl "-Iinc" /opt/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/ExtUtils/xsubpp -typemap /opt/perlbrew/perls/perl-5.12.2/lib/5.12.2/ExtUtils/typemap src/perl-murmurhash3.xs > src/perl-murmurhash3.xsc && mv src/perl-murmurhash3.xsc src/perl-murmurhash3.c
cc -c "-I." "-I." -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c++ -O2 -DVERSION=\"0.02\" -DXS_VERSION=\"0.02\" -o src/perl-murmurhash3.o -fPIC "-I/opt/perlbrew/perls/perl-5.12.2/lib/5.12.2/x86_64-linux/CORE" -DUSE_PPPORT -DHAVE_64BITINT src/perl-murmurhash3.c
Running Mkbootstrap for Digest::MurmurHash3 ()
chmod 644 MurmurHash3.bs
rm -f blib/arch/auto/Digest/MurmurHash3/MurmurHash3.so
cc -shared -O2 -L/usr/local/lib -fstack-protector src/MurmurHash3.o src/perl-murmurhash3.o -o blib/arch/auto/Digest/MurmurHash3/MurmurHash3.so \
\

chmod 755 blib/arch/auto/Digest/MurmurHash3/MurmurHash3.so
cp MurmurHash3.bs blib/arch/auto/Digest/MurmurHash3/MurmurHash3.bs
chmod 644 blib/arch/auto/Digest/MurmurHash3/MurmurHash3.bs
PERL_DL_NONLAZY=1 /opt/perlbrew/perls/perl-5.12.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t

# Failed test 'use Digest::MurmurHash3;'
# at t/001_basic.t line 7.
# Tried to use 'Digest::MurmurHash3'.
# Error: Can't load '/home/smly/.cpanm/work/1402389752.27122/Digest-MurmurHash3-0.02/blib/arch/auto/Digest/MurmurHash3/MurmurHash3.so' for module Digest::MurmurHash3: /home/smly/.cpanm/work/1402389752.27122/Digest-MurmurHash3-0.02/blib/arch/auto/Digest/MurmurHash3/MurmurHash3.so: undefined symbol: __gxx_personality_v0 at /opt/perlbrew/perls/perl-5.12.2/lib/5.12.2/x86_64-linux/DynaLoader.pm line 200.
(snip)
```

With the patch applied:

```
$ cpanm -L extlibs/centos6 .
--> Working on .
==> Found dependencies: ExtUtils::ParseXS
--> Working on ExtUtils::ParseXS
Fetching http://www.cpan.org/authors/id/S/SM/SMUELLER/ExtUtils-ParseXS-3.24.tar.gz ... OK
Configuring ExtUtils-ParseXS-3.24 ... OK
Building and testing ExtUtils-ParseXS-3.24 ... OK
Successfully installed ExtUtils-ParseXS-3.24 (upgraded from 2.21)
Configuring Digest-MurmurHash3-0.02 ... OK
Building and testing Digest-MurmurHash3-0.02 ... OK
Successfully installed Digest-MurmurHash3-0.02
2 distributions installed
```

Sincerely,
smly