Permalink
Browse files

Merge branch 'master' of github.com:rurban/perl-compiler

  • Loading branch information...
2 parents 956fbdf + 6c17d8a commit bd099307a6398927ebca1c94bb9906b9301c23b5 @rurban committed May 22, 2012
Showing with 83 additions and 19 deletions.
  1. +68 −4 lib/B/C.pm
  2. +5 −5 log.modules-5.012004-nt
  3. +5 −5 log.modules-5.014002-nt
  4. +5 −5 log.modules-5.014002d
View
@@ -2572,7 +2572,7 @@ sub B::PVMG::save_magic {
# stored by some PMOP *pm = cLOGOP->op_other (pp_ctl.c) in C.xs
my $pmop = $Regexp{$rx};
if (!$pmop) {
- warn "C.xs Warning: PMOP missing for QR\n";
+ warn "Warning: C.xs PMOP missing for QR\n";
} else {
my ($resym, $relen);
if ($PERL56) {
@@ -6194,11 +6194,25 @@ execution speed of your program but may improve the start-up time.
Depending on the environment in which your program runs this may be
either a help or a hindrance.
+The compiler detects all immediate objects in the main (or optionally other)
+package, and then in a second pass tries to verify if all not by the compiler
+itself loaded packages are used by the program. This is done in a loop until
+no new packages are found. These package detection passes are not fool proof,
+since there are either too many unneeded compiled packages with its
+sub-dependencies (i.e. too big executable size) or some packages are missed,
+e.g. C<eval "require $name;">. Nevertheless are all detected functions, objects
+and methods compiled.
+
+You can tune these steps with the options C<-u> (I<used>) and C<-U>
+(I<unused>). Not statically detected packages will be loaded then at run-time
+at the client environment, with the compile-time @INC path. Note that fully
+self-contained executables should include all at the client needed packages.
+
=head1 OPTIONS
If there are any non-option arguments, they are taken to be
-names of objects to be saved (probably doesn't work properly yet).
-Without extra arguments, it saves the main program.
+names of objects (packages, functions, scalars) to be saved.
+Without extra arguments, it saves the main program, i.e. %main::
=over 4
@@ -6551,6 +6565,56 @@ help make use of this compiler.
perl -MO=C,-v,-DcA,-l2048 bar.pl > /dev/null
+=head1 CAVEAT
+
+With 5.6 it is not possible to use the __DATA__ filehandle, because
+compatible access via PerlIO::scalar was added with 5.8.1
+
+It is generally not possible to restore all of the compiled BEGIN-time state.
+Esp. problematic are non-standard filehandles (i.e. fd>2), process ids,
+environment specific knowledge, because only with the compiler BEGIN blocks
+are not executed in the client environment.
+
+The compiler produces some warnings, which might need source code changes
+or changed compiler options.
+
+=over
+
+=item Warning: Problem with require "$name" - $INC{file.pm}
+
+Dynamic load of $name did not add the expected %INC key.
+
+=item Warning: C.xs PMOP missing for QR
+
+In an initial C.xs runloop all QR regex ops are stored, so that they
+can matched later to PMOPs.
+
+=item Warning: DynaLoader broken with 5.15.2-5.15.3.
+
+[perl #100138] DynaLoader symbols were XS_INTERNAL. Strict linking
+could not resolve it. Usually libperl was patched to overcome this
+for these two versions.
+Setting the environment variable NO_DL_WARN=1 omits this warning.
+
+=item Warning: __DATA__ handle $fullname not stored. Need -O2 or -fsave-data.
+
+Since processing the __DATA__ filehandle involves some overhead, requiring
+PerlIO::scalar with all its dependencies, you must use -O2 or -fsave-data.
+
+=item Warning: Write BEGIN-block $fullname to FileHandle $iotype \&$fd
+
+Critical problem. This must be fixed in the source.
+
+=item Warning: Read BEGIN-block $fullname from FileHandle $iotype \&$fd
+
+Critical problem. This must be fixed in the source.
+
+=item Warning: -o argument ignored with -c
+
+-c does only check, but not accumulate C output lines.
+
+=back
+
=head1 BUGS
Current status: A few known bugs.
@@ -6563,7 +6627,7 @@ Current status: A few known bugs.
&XSLoader::load sometimes missing
reading from __DATA__ handles (15) non-threaded
handling npP magic for shared threaded variables (41-43)
- destruction of variables in END blocks
+ destruction of shared strings in end of scope and END blocks
=head1 AUTHOR
@@ -1,4 +1,4 @@
-# B::C::VERSION = 1.43 ceead94 2012-04-30 | implement -c for B::C and B::CC - fixes issue 99
+# B::C::VERSION = 1.43 1049b74 2012-05-03 | status_upd: protect against an empty list
# perlversion = 5.012004-nt
# path = /usr/local/bin/perl5.12.4-nt
# platform = linux 64bit non-threaded
@@ -99,11 +99,11 @@ pass DateTime::TimeZone
pass DateTime::Locale
pass DateTime
pass IO::String
-fail AppConfig
+pass AppConfig
pass UNIVERSAL::require
pass Template::Stash
# 100 / 100 modules tested with B-C-1.43 - perl-5.012004-nt
-# pass 98 / 100 (98.0%)
-# fail 2 / 100 (2.0%)
-# todo 2 / 2 (100.0%)
+# pass 99 / 100 (99.0%)
+# fail 1 / 100 (1.0%)
+# todo 2 / 1 (200.0%)
# skip 0 / 100 (0.0% not installed)
@@ -1,4 +1,4 @@
-# B::C::VERSION = 1.43 ceead94 2012-04-30 | implement -c for B::C and B::CC - fixes issue 99
+# B::C::VERSION = 1.43 1049b74 2012-05-03 | status_upd: protect against an empty list
# perlversion = 5.014002-nt
# path = /usr/local/bin/perl5.14.2-nt
# platform = linux 64bit non-threaded
@@ -52,7 +52,7 @@ pass Sub::Install
pass Attribute::Handlers
pass Data::OptList
pass Sub::Exporter
-pass Test::NoWarnings #TODO print() on unopened filehandle $Testout
+fail Test::NoWarnings #TODO print() on unopened filehandle $Testout
pass version
pass Params::Validate
pass Sub::Name
@@ -103,7 +103,7 @@ pass AppConfig
pass UNIVERSAL::require
pass Template::Stash
# 100 / 100 modules tested with B-C-1.43 - perl-5.014002-nt
-# pass 100 / 100 (100.0%)
-# fail 0 / 100 (0.0%)
-# todo 2 / 0 ()
+# pass 99 / 100 (99.0%)
+# fail 1 / 100 (1.0%)
+# todo 2 / 1 (200.0%)
# skip 0 / 100 (0.0% not installed)
View
@@ -1,4 +1,4 @@
-# B::C::VERSION = 1.43 ceead94 2012-04-30 | implement -c for B::C and B::CC - fixes issue 99
+# B::C::VERSION = 1.43 1049b74 2012-05-03 | status_upd: protect against an empty list
# perlversion = 5.014002d
# path = /usr/local/bin/perl5.14.2d
# platform = linux 64bit threaded debug
@@ -96,14 +96,14 @@ pass YAML
pass MooseX::Types
pass Class::Singleton
pass DateTime::TimeZone
-pass DateTime::Locale
+fail DateTime::Locale
pass DateTime
pass IO::String
pass AppConfig
pass UNIVERSAL::require
pass Template::Stash
# 100 / 100 modules tested with B-C-1.43 - perl-5.014002d
-# pass 99 / 100 (99.0%)
-# fail 1 / 100 (1.0%)
-# todo 2 / 1 (200.0%)
+# pass 98 / 100 (98.0%)
+# fail 2 / 100 (2.0%)
+# todo 2 / 2 (100.0%)
# skip 0 / 100 (0.0% not installed)

0 comments on commit bd09930

Please sign in to comment.