in reply to Re^3: Undefined subroutine on ARM but not i686
in thread Undefined subroutine on ARM but not i686

No additional output is produced when I changed both of the eval($fcn) commands near 774.

One thing to note is that to get this to actually export the functions, I had to copy the export block from the SHA.pm module like below, otherwise, I would get errors when trying to import the function names.
@EXPORT_OK = qw( hmac_sha1 hmac_sha1_base64 hmac_sha1_hex hmac_sha224 hmac_sha224_base64 hmac_sha224_hex hmac_sha256 hmac_sha256_base64 hmac_sha256_hex hmac_sha384 hmac_sha384_base64 hmac_sha384_hex hmac_sha512 hmac_sha512_base64 hmac_sha512_hex sha1 sha1_base64 sha1_hex sha224 sha224_base64 sha224_hex sha256 sha256_base64 sha256_hex sha384 sha384_base64 sha384_hex sha512 sha512_base64 sha512_hex);
With this block commented out, printing out the export list gives no output.

Replies are listed 'Best First'.
Re^5: Undefined subroutine on ARM but not i686
by ikegami (Patriarch) on Jun 02, 2009 at 00:07 UTC

    Your module is more modified than you stated. It's not possible to continue without seeing it.

      I hope it's not a problem to put this much code in.

      Here is the Digest::SHA::PurePerl module I am using. The only modifications are the two things I mentioned in this thread: adding the exports to get it to actually export the functions, and removing the dump / load functions and use FileHandle include.

      Everything I removed is still there, but commented out.

Re^5: Undefined subroutine on ARM but not i686
by ikegami (Patriarch) on Jun 02, 2009 at 17:48 UTC

    Works fine for me, even without the @EXPORT_OK change. You'll need to find out why the loop that starts with for $alg (1, 224, 256, 384, 512) doesn't get executed for you.

    Start by making sure you are loading the module you think you are loading. You can do so using

    use Cwd qw( realpath ); print(realpath($INC{'Digest/SHA/PurePerl.pm'}), "\n");

    If you are indeed executing the module you think you are executing, you've probably got a very serious problem with your Perl build.

      I decided to unroll that loop to some extent and manually create one of the functions, sha256, as follows:
      sub sha256 { my $state = _shaopen('256') or return; for (@_) { _shawrite($_, length($_) << 3, $state) } _shafinish($state); _sha($state); } push(@EXPORT_OK, 'sha256');

      For whatever reason, this works fine, but the generation of the function and export does not.

      I'll report back if I figure out exactly why this is happening, but for now I am content with having it work with the functions I need hard-coded in.
      It is loading the correct perl module, as that command shows the location I expected.

      Perhaps it is an issue with my perl build. I don't have a whole lot of options as far as building perl. I am using a target that cannot fit a toolchain on it, so everything needs to be cross-compiled using buildroot. I tried everything I could to build a full version of perl for it, but without any success.