From a6024f8d7786664378dae8814997405c6f795f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 23 Aug 2012 12:29:03 +0200 Subject: make_preload: Don't fail if Perl's default file encoding is UTF-8 Setting Perl's default encoding for files to UTF-8, for example like this: PERL_UNICODE=DS make would crash the build with a message similar to: form size 1413 greater than size 1237 of module at utils/make_preload line 175, chunk 1. Tell Perl to interpret the data in BEAM files as binary by using the binmode() function. The binmode() function existed before Unicode support was added to Perl, which means that make_preload should work even in old versions of Perl. Noticed-by: Aaron Harnly --- erts/emulator/utils/make_preload | 1 + 1 file changed, 1 insertion(+) (limited to 'erts') diff --git a/erts/emulator/utils/make_preload b/erts/emulator/utils/make_preload index 13019d4062..4e329b24f8 100755 --- a/erts/emulator/utils/make_preload +++ b/erts/emulator/utils/make_preload @@ -87,6 +87,7 @@ foreach $file (@ARGV) { my $comment = ''; open(FILE, $file) or error("failed to read $file: $!"); + binmode(FILE); $_ = ; $_ = beam_strip($_); close(FILE); -- cgit v1.2.3