Building module Encode::Detect on solaris 10 platform



Hello:

I have built perl 5.10.0 on a SPARC Solaris 10 platform with the
Sun Studio 12 C compiler. I would like now to build the module
Encode::Detect which comes with C++ source files in the src/ sub-
directory. The usual

perl Makefile.PL
make

does not work, as the compiler called in is the C one (/opt/SUNWspro/
bin/cc).

When I enforce the usage of the Studio 12 C++ compiler doing

perl Makefile.PL CC=/opt/SUNWspro/bin/CC LD=/opt/SUNWspro/bin/CC
make

I get a flurry of errors from <proto.h> in the perl 5.10.0/lib/sun4-
solaris/CORE directory when compiling lib/Encode/Detect/Detector.c :

error mesages with Sun Studio 12 C++ <<<<<<<<<<<<<<<<

/opt/SUNWspro/bin/CC -Isrc -I/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE -DXS_VERSION="1.00" -DVERSION="1.00" -KPIC -Iinclude -c -xtarget=native -I/usr/sfw/include -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -o lib/Encode/Detect/Detector.o lib/Encode/Detect/Detector.c
CC: Warning: -xarch=native has been explicitly specified, or implicitly specified by a macro option, -xarch=native on this architecture implies -xarch=sparcvis2 which generates code that does not run on pre UltraSPARC III processors
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 36: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 39: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 42: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 45: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 48: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 74: Warning: attribute __malloc__ is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 78: Warning: attribute __malloc__ is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 82: Warning: attribute __malloc__ is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 97: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 106: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 107: Error: "{" expected instead of "(".
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 107: Error: The function "nonnull" must have a prototype.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 109: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 110: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 112: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 115: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 116: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 117: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 118: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 119: Error: "," expected instead of "(".
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 121: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 122: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 123: Error: "," expected instead of "(".
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 124: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 124: Error: There must be an identifier to declare.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 126: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 127: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 129: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 130: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 132: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 134: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 136: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 137: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 139: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 141: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 143: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 145: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 147: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 148: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 150: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 152: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 154: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 156: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 158: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 159: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 161: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 162: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 163: Error: "," expected instead of "(".
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 165: Error: Linkage specifications are allowed only at file level.
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 166: Warning: attribute nonnull is unsupported and will be skipped..
"/usr/local/perl5/5.10.0/lib/sun4-solaris/CORE/proto.h", line 167: Error: "," expected instead of "(".
Compilation aborted, too many Error messages.
error building lib/Encode/Detect/Detector.o from 'lib/Encode/Detect/Detector.c' at /usr/local/perl5/5.10.0/lib/ExtUtils/CBuilder/Base.pm line 109.
*** Error code 2
make: Fatal error: Command failed for target `all'

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On the other hand, when I resort to using "gcc -x c++" as compiler,
all source files are compiled, but then "make test" fails:

error messages with gcc -x c++ <<<<<<<<<<<<<<<<<<<<<<<<<

/usr/local/perl5/bin/perl Build --makefile_env_macros 1 test
t/base........
# Failed test 'use Encode::Detect::Detector;'
# at t/base.t line 5.
# Tried to use 'Encode::Detect::Detector'.
# Error: Can't load '/root/Encode-Detect-1.00/blib/arch/auto/Encode/Detect/Detector/Detector.so' for module Encode::Detect::Detector: ld.so.1: perl: fatal: relocation error: file /root/Encode-Detect-1.00/blib/arch/auto/Encode/Detect/Detector/Detector.so: symbol __gxx_personality_v0: referenced symbol not found at /usr/local/perl5/5.10.0/lib/sun4-solaris/DynaLoader.pm line 203.
# at (eval 3) line 2
# Compilation failed in require at (eval 3) line 2.
# BEGIN failed--compilation aborted at t/base.t line 5.
t/base........NOK 1/0Can't locate auto/Encode/Detect/Detector/new.al in @INC (@INC contains: /root/Encode-Detect-1.00/blib/lib /root/Encode-Detect-1.00/blib/arch /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0 /usr/local/perl5/vendor_perl/5.10.0/sun4-solaris /usr/local/perl5/vendor_perl/5.10.0 /usr/local/perl5/vendor_perl /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4 /usr/perl5/vendor_perl/5.8.4 . /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0 /usr/local/perl5/vendor_perl/5.10.0/sun4-solaris /usr/local/perl5/vendor_perl/5.10.0 /usr/local/perl5/vendor_perl /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4 /usr/perl5/vendor_perl/5.8.4 .) at t/base.t line 9
# Looks like you failed 1 test of 1.
# Looks like your test died just after 1.
t/base........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
t/encoding....Can't locate Data/Dump.pm in @INC (@INC contains: /root/Encode-Detect-1.00/blib/lib /root/Encode-Detect-1.00/blib/arch /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0 /usr/local/perl5/vendor_perl/5.10.0/sun4-solaris /usr/local/perl5/vendor_perl/5.10.0 /usr/local/perl5/vendor_perl /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4 /usr/perl5/vendor_perl/5.8.4 . /usr/local/perl5/5.10.0/lib/sun4-solaris /usr/local/perl5/5.10.0/lib /usr/local/perl5/site_perl/5.10.0/sun4-solaris /usr/local/perl5/site_perl/5.10.0 /usr/local/perl5/vendor_perl/5.10.0/sun4-solaris /usr/local/perl5/vendor_perl/5.10.0 /usr/local/perl5/vendor_perl /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4 /usr/perl5/vendor_perl/5.8.4 .) at t/encoding.t line 4.
BEGIN failed--compilation aborted at t/encoding.t line 4.
# Looks like your test died before it could output anything.
t/encoding....dubious
Test returned status 255 (wstat 65280, 0xff00)
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/base.t 255 65280 1 1 1
t/encoding.t 255 65280 ?? ?? ??
Failed 2/2 test scripts. 1/1 subtests failed.
Files=2, Tests=1, 1 wallclock secs ( 0.20 cusr + 0.06 csys = 0.26 CPU)
Failed 2/2 test programs. 1/1 subtests failed.
*** Error code 255
make: Fatal error: Command failed for target `test'

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I would really appreciate someone's input on how to build that module
in my current environment.
--
,
/)
// Guy Paulus (Sys Admin)
(/ BATir Dept., CP-194/2
_/ ______ Universite Libre de Bruxelles
) ( (-----( 50 av. F. D. Roosevelt
/INK\ \ \ B-1050 Brussels
\___/ \ \ Phone: +32(2)650 3652
jgs _)_____) Fax: +32(2)650 2789
`------`
.