Skip to content

Commit

Permalink
Fix an issue building DB_File on FreeBSD
Browse files Browse the repository at this point in the history
v5.8.9 and v5.10.0 fail to build on FreeBSD 14.0-RELEASE
which comes with clang 16.0.6. Backported revisions to DB_File from
v5.10.1 which did build.

Only tested against v5.8.9 and v5.10.0 and only applicable to
OS == 'freebsd' for the moment

Updated included hints.
  • Loading branch information
bingos committed Nov 28, 2023
1 parent 2e710bc commit 6b09b7f
Show file tree
Hide file tree
Showing 3 changed files with 992 additions and 697 deletions.
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = Devel-PatchPerl
version = 2.08
version = 2.09
author = Chris Williams <[email protected]>
license = Perl_5
copyright_holder = Chris Williams and Marcus Holland-Moritz
Expand Down
265 changes: 263 additions & 2 deletions lib/Devel/PatchPerl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Module::Pluggable search_path => ['Devel::PatchPerl::Plugin'];
use vars qw[@ISA @EXPORT_OK];

use constant CERTIFIED => 5.033005; # Anything less than this
use constant HINTSCERT => 5.033004; # Hints certified to this
use constant HINTSCERT => 5.039006; # Hints certified to this

@ISA = qw(Exporter);
@EXPORT_OK = qw(patch_source);
Expand Down Expand Up @@ -290,6 +290,12 @@ my @patch = (
],
subs => [ [ \&_patch_useshrplib ] ],
},
{
perl => [
qr/.*/,
],
subs => [ [ \&_patch_dbfile_clang ] ],
},
);

sub patch_source {
Expand Down Expand Up @@ -444,10 +450,16 @@ sub _patch
}
}

sub _write_b64_or_die {
my($file, $base64) = @_;
my $data = decode_base64($base64);
_write_or_die($file, $data);
}

sub _write_or_die
{
my($file, $data) = @_;
my $fh = IO::File->new(">$file") or die "$file: $!\n";
my $fh = IO::File->new($file,'>') or die "$file: $!\n";
$fh->print($data);
}

Expand Down Expand Up @@ -10458,6 +10470,255 @@ c2xpYi5kbGwkQ29uZmlnX2xpYmV4dCIgKSApIHsK
EUMMBIGSUR
}

sub _patch_dbfile_clang {
return unless $^O eq 'freebsd'; # for the moment limit this
my $perlver = shift;
my $num = _norm_ver( $perlver );
# I've only tested against v5.8.9 and v5.10.0
# It might work for intervening v5.9.*, but at this point
# it's not my circus, nor my monkeys
return unless $num > 5.008008;
return unless $num < 5.010001;
# Patch mkpport.lst
_patch_b64(<<'DBFILE001');
LS0tIG1rcHBwb3J0LmxzdC5vcmcJMjAyMy0xMS0yNyAyMjo0NzoyOS41ODM5NjEwMDAgKzAwMDAK
KysrIG1rcHBwb3J0LmxzdAkyMDIzLTExLTI3IDIyOjQ3OjU3LjU3OTk3MTAwMCArMDAwMApAQCAt
OCwzICs4LDQgQEAKIGV4dC9JUEMvU3lzVgogZXh0L1RpbWUvSGlSZXMKIGV4dC9XaW4zMkFQSS9G
aWxlCitleHQvREJfRmlsZQo=
DBFILE001
# Patch ext/DB_File/DB_File.xs
_patch_b64(<<'DBFILE002');
LS0tIGV4dC9EQl9GaWxlL0RCX0ZpbGUueHMub3JnCTIwMjMtMTEtMjcgMjI6NTg6NTcuNDcwNDM2
MDAwICswMDAwCisrKyBleHQvREJfRmlsZS9EQl9GaWxlLnhzCTIwMjMtMTEtMjcgMjI6NTk6MTgu
Njk1ODI4MDAwICswMDAwCkBAIC0xMjMsOSArMTIzLDcgQEAKICNpbmNsdWRlICJwZXJsLmgiCiAj
aW5jbHVkZSAiWFNVQi5oIgogCi0jaWZkZWYgX05PVF9DT1JFCi0jICBpbmNsdWRlICJwcHBvcnQu
aCIKLSNlbmRpZgorI2luY2x1ZGUgInBwcG9ydC5oIgogCiAvKiBNZW50aW9uIERCX1ZFUlNJT05f
TUFKT1JfQ0ZHLCBEQl9WRVJTSU9OX01JTk9SX0NGRywgYW5kCiAgICBEQl9WRVJTSU9OX1BBVENI
X0NGRyBoZXJlIHNvIHRoYXQgQ29uZmlndXJlIHB1bGxzIHRoZW0gYWxsIGluLiAqLwo=
DBFILE002
# Overwrite ext/DB_File/Makefile.PL
{
my $file = File::Spec->catfile('ext','DB_File','Makefile.PL');
my $mode;
if (-r $file and not -w _) {
$mode = (stat $file)[2];
chmod $mode | 0200, $file;
}
_write_b64_or_die($file,<<'DBFILE003');
IyEgcGVybCAtdwoKdXNlIHN0cmljdCA7CnVzZSBFeHRVdGlsczo6TWFrZU1ha2VyIDUuMTYgOwp1
c2UgQ29uZmlnIDsKCmRpZSAiREJfRmlsZSBuZWVkcyBQZXJsIDUuMDA0XzA1IG9yIGJldHRlci4g
VGhpcyBpcyAkXVxuIiAKICAgIGlmICRdIDw9IDUuMDA0MDQ7IAoKbXkgJFZFUl9JTkZPIDsKbXkg
JExJQl9ESVIgOwpteSAkSU5DX0RJUiA7Cm15ICREQl9OQU1FIDsKbXkgJExJQlMgOwpteSAkQ09N
UEFUMTg1ID0gIiIgOwoKUGFyc2VDT05GSUcoKSA7CgpteSBAZmlsZXMgPSAoJ0RCX0ZpbGUucG0n
LCBnbG9iICJ0LyoudCIpIDsKVXBEb3duZ3JhZGUoQGZpbGVzKTsKCmlmIChkZWZpbmVkICREQl9O
QU1FKQogIHsgJExJQlMgPSAkREJfTkFNRSB9CmVsc2UgewogICAgaWYgKCReTyBlcSAnTVNXaW4z
MicpCiAgICAgIHsgJExJQlMgPSAkQ29uZmlne2NjfSA9fiAvZ2NjLyA/ICctbGRiJyA6ICctbGxp
YmRiJyB9CiAgICBlbHNlCiAgICAgIHsgJExJQlMgPSAnLWxkYicgfQp9CgojIFNvbGFyaXMgaXMg
c3BlY2lhbC4KIyRMSUJTIC49ICIgLWx0aHJlYWQiIGlmICReTyBlcSAnc29sYXJpcycgOwoKIyBB
SVggaXMgc3BlY2lhbC4KJExJQlMgLj0gIiAtbHB0aHJlYWQiIGlmICReTyBlcSAnYWl4JyA7Cgoj
IE9TMiBpcyBhIHNwZWNpYWwgY2FzZSwgc28gY2hlY2sgZm9yIGl0IG5vdy4KbXkgJE9TMiA9ICIi
IDsKJE9TMiA9ICItRE9TMiIgaWYgJENvbmZpZ3snb3NuYW1lJ30gZXEgJ29zMicgOwoKbX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XHMrPVxzK3F3XCgvIDsKICAgIH0KCiAgICB3aGlsZSAoPEY+KQogICAgewog
ICAgICAgIGxhc3QgaWYgL15ccypcKS8gOwogICAgICAgIC8oXFMrKS8gOwogICAgICAgIGRlbGV0
ZSAkbmFtZXN7JDF9IGlmIGRlZmluZWQgJDEgOwogICAgfQogICAgY2xvc2UgRiA7CgogICAgaWYg
KCBrZXlzICVuYW1lcyApCiAgICB7CiAgICAgICAgbXkgJG1pc3NpbmcgPSBqb2luICgiXG5cdCIs
IHNvcnQga2V5cyAlbmFtZXMpIDsKICAgICAgICBkaWUgIlRoZSBmb2xsb3dpbmcgbmFtZXMgYXJl
IG1pc3NpbmcgZnJvbSBcQEVYUE9SVCBpbiBEQl9GaWxlLnBtXG4iIC4KICAgICAgICAgICAgIlx0
JG1pc3NpbmdcbiIgOwogICAgfQogICAgCgogICAgRXh0VXRpbHM6OkNvbnN0YW50OjpXcml0ZUNv
bnN0YW50cygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5BTUUgPT4gJ0RC
X0ZpbGUnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkFNRVMgPT4gXEBu
YW1lcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENfRklMRSAgPT4gJ2Nv
bnN0YW50cy5oJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhTX0ZJTEUg
ID0+ICdjb25zdGFudHMueHMnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICApOwp9IAplbHNlIHsKICAgIHVzZSBGaWxlOjpDb3B5OwogICAgY29weSAo
J2ZhbGxiYWNrLmgnLCAnY29uc3RhbnRzLmgnKQogICAgICBvciBkaWUgIkNhbid0IGNvcHkgZmFs
bGJhY2suaCB0byBjb25zdGFudHMuaDogJC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gICAgICAgc3BsaXQg
YWNyb3NzIG11bHRpcGxlIGxpbmVzLgoKCiAgICBteSAkd2Fybl9zdWIgOwogICAgbXkgJG91cl9z
dWIgOwoKICAgIGlmICgkXSA8IDUuMDA2MDAxKSB7CiAgICAgICAgIyBGcm9tOiB1c2V8bm8gd2Fy
bmluZ3MgImJsYWgiCiAgICAgICAgIyBUbzogICBsb2NhbCAoJF5XKSA9IDE7ICMgdXNlfG5vIHdh
cm5pbmdzICJibGFoIgogICAgICAgICMKICAgICAgICAjIGFuZAogICAgICAgICMKICAgICAgICAj
IEZyb206IHdhcm5pbmdzOjp3YXJuaWYoeCx5KTsKICAgICAgICAjIFRvOiAgICReVyAmJiBjYXJw
KHkpOyAjIHdhcm5pZiAtLSB4CiAgICAgICAgJHdhcm5fc3ViID0gc3ViIHsKCSAgICBzL14oXHMq
KShub1xzK3dhcm5pbmdzKS8kezF9bG9jYWwgKFwkXlcpID0gMDsgIyQyLyA7CgkgICAgcy9eKFxz
KikodXNlXHMrd2FybmluZ3MpLyR7MX1sb2NhbCAoXCReVykgPSAxOyAjJDIvIDsKCgkgICAgcy9e
KFxzKil3YXJuaW5nczo6d2FybmlmXHMqXCgoLio/KVxzKixccyooLio/KVwpXHMqOy8kezF9XCRe
VyAmJiBjYXJwKCQzKTsgIyB3YXJuaWYgLSAkMi8gOwogICAgICAgICAgfTsKICAgIH0KICAgIGVs
c2UgewogICAgICAgICMgRnJvbTogbG9jYWwgKCReVykgPSAxOyAjIHVzZXxubyB3YXJuaW5ncyAi
YmxhaCIKICAgICAgICAjIFRvOiAgIHVzZXxubyB3YXJuaW5ncyAiYmxhaCIKICAgICAgICAjCiAg
ICAgICAgIyBhbmQKICAgICAgICAjCiAgICAgICAgIyBGcm9tOiAkXlcgJiYgY2FycCh5KTsgIyB3
YXJuaWYgLS0geAogICAgICAgICMgVG86ICAgd2FybmluZ3M6Ondhcm5pZih4LHkpOwogICAgICAg
ICR3YXJuX3N1YiA9IHN1YiB7CgkgICAgcy9eKFxzKilsb2NhbFxzKlwoXCRcXldcKVxzKj1ccypc
ZCtccyo7XHMqI1xzKigobm98dXNlKVxzK3dhcm5pbmdzLiopLyQxJDIvIDsKCSAgICBzL14oXHMq
KVwkXF5XXHMrXCZcJlxzKmNhcnBccypcKCguKj8pXClccyo7XHMqI1xzKndhcm5pZlxzKi1ccyoo
LiopLyR7MX13YXJuaW5nczo6d2FybmlmKCQzLCAkMik7LyA7CiAgICAgICAgICB9OwogICAgfQoK
ICAgIGlmICgkXSA8IDUuMDA2MDAwKSB7CiAgICAgICAgJG91cl9zdWIgPSBzdWIgewoJICAgIGlm
ICggL14oXHMqKW91clxzK1woXHMqKFteKV0rXHMqKVwpLyApIHsKICAgICAgICAgICAgICAgIG15
ICRpbmRlbnQgPSAkMTsKICAgICAgICAgICAgICAgIG15ICR2YXJzID0gam9pbiAnICcsIHNwbGl0
IC9ccyosXHMqLywgJDI7CiAgICAgICAgICAgICAgICAkXyA9ICIke2luZGVudH11c2UgdmFycyBx
dygkdmFycyk7XG4iOwogICAgICAgICAgICB9CiAgICAgICAgICB9OwogICAgfQogICAgZWxzZSB7
CiAgICAgICAgJG91cl9zdWIgPSBzdWIgewoJICAgIGlmICggL14oXHMqKXVzZVxzK3ZhcnNccytx
d1woKC4qPylcKS8gKSB7CiAgICAgICAgICAgICAgICBteSAkaW5kZW50ID0gJDE7CiAgICAgICAg
ICAgICAgICBteSAkdmFycyA9IGpvaW4gJywgJywgc3BsaXQgJyAnLCAkMjsKICAgICAgICAgICAg
ICAgICRfID0gIiR7aW5kZW50fW91ciAoJHZhcnMpO1xuIjsKICAgICAgICAgICAgfQogICAgICAg
ICAgfTsKICAgIH0KCiAgICBmb3JlYWNoIChAZmlsZXMpCiAgICAgIHsgZG9VcERvd24oJG91cl9z
dWIsICR3YXJuX3N1YiwgJF8pIH0KfQoKCnN1YiBkb1VwRG93bgp7CiAgICBteSAkb3VyX3N1YiA9
IHNoaWZ0OwogICAgbXkgJHdhcm5fc3ViID0gc2hpZnQ7CgogICAgbG9jYWwgKCReSSkgPSAiLmJh
ayIgOwogICAgbG9jYWwgKEBBUkdWKSA9IHNoaWZ0OwoKICAgIHdoaWxlICg8PikKICAgIHsKCXBy
aW50LCBsYXN0IGlmIC9eX18oRU5EfERBVEEpX18vIDsKCgkmeyAkb3VyX3N1YiB9KCk7CgkmeyAk
d2Fybl9zdWIgfSgpOwoJcHJpbnQgOwogICAgfQoKICAgIHJldHVybiBpZiBlb2YgOwoKICAgIHdo
aWxlICg8PikKICAgICAgeyBwcmludCB9Cn0KCiMgZW5kIG9mIGZpbGUgTWFrZWZpbGUuUEwK
DBFILE003
chmod $mode, $file if $mode;
}
# Create ext/DB_File/config.in
{
my $file = File::Spec->catfile('ext','DB_File','config.in');
_write_b64_or_die($file,<<'DBFILE004');
IyBGaWxlbmFtZToJY29uZmlnLmluCiMKIyB3cml0dGVuIGJ5IFBhdWwgTWFycXVlc3MgPFBhdWwu
TWFycXVlc3NAYnRpbnRlcm5ldC5jb20+CiMgbGFzdCBtb2RpZmllZCA5dGggU2VwdCAxOTk3CiMg
dmVyc2lvbiAxLjU1CgojIDEuIFdoZXJlIGlzIHRoZSBmaWxlIGRiLmg/CiMKIyAgICBDaGFuZ2Ug
dGhlIHBhdGggYmVsb3cgdG8gcG9pbnQgdG8gdGhlIGRpcmVjdG9yeSB3aGVyZSBkYi5oIGlzCiMg
ICAgaW5zdGFsbGVkIG9uIHlvdXIgc3lzdGVtLgoKSU5DTFVERQk9IC91c3IvbG9jYWwvQmVya2Vs
ZXlEQi9pbmNsdWRlCiNJTkNMVURFCT0gL3Vzci9sb2NhbC9pbmNsdWRlCiNJTkNMVURFCT0gL3Vz
ci9pbmNsdWRlCgojIDIuIFdoZXJlIGlzIGxpYmRiPwojCiMgICAgQ2hhbmdlIHRoZSBwYXRoIGJl
bG93IHRvIHBvaW50IHRvIHRoZSBkaXJlY3Rvcnkgd2hlcmUgbGliZGIgaXMKIyAgICBpbnN0YWxs
ZWQgb24geW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CAtbGxpYmRiIHdpbGwgYmUKIyAgICB1c2VkIGJ5IGRlZmF1bHQuCiMKIyAg
ICBJZiB5b3UgaGF2ZSBjaGFuZ2VkIHRoZSBuYW1lIG9mIHRoZSBsaWJyYXJ5LCB1bmNvbW1lbnQg
dGhlIGxpbmUKIyAgICBiZWxvdyAoYnkgcmVtb3ZpbmcgdGhlIGxlYWRpbmcgIykgYW5kIGVkaXQg
dGhlIGxpbmUgdG8gdXNlIHRoZSBuYW1lCiMgICAgeW91IGhhdmUgcGlja2VkLgogCiNEQk5BTUUg
PSAtbGRiLTIuNC4xMAoKIyBlbmQgb2YgZmlsZSBjb25maWcuaW4K
DBFILE004
}
}

sub _patch_useshrplib {
# from https://github.com/Perl/perl5/commit/191f8909fa4eca1db16a91ada42dd4a065c04890
_patch(<<'END');
Expand Down
Loading

0 comments on commit 6b09b7f

Please sign in to comment.