Skip to content

Commit db00b4c

Browse files
authored
Merge pull request #860 from AriaXLi/PA-6549
(PA-6549) Fix warning:undefining the allocator of T_DATA class
2 parents 2f23346 + 1b6bc80 commit db00b4c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

configs/components/_base-ruby-selinux.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
pkg.add_source("file://resources/patches/ruby-selinux/selinuxswig_ruby_wrap.patch")
7+
pkg.add_source("file://resources/patches/ruby-selinux/selinuxswig_ruby_undefining_allocator.patch")
78

89
# These can be overridden by the including component.
910
ruby_version ||= settings[:ruby_version]
@@ -81,6 +82,7 @@
8182
unless platform.name =~ /^(debian-12|ubuntu-24|fedora-40)/
8283
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_wrap.patch"
8384
end
85+
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_undefining_allocator.patch"
8486
end
8587

8688
# libselinux 3.3 is the minimum version we want to build on RHEL 9, but the
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- selinuxswig_ruby_wrap.c.orig 2024-06-11 20:02:30.112707265 +0000
2+
+++ selinuxswig_ruby_wrap.c 2024-06-11 22:34:16.000151780 +0000
3+
@@ -1510,7 +1510,7 @@
4+
_cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
5+
rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
6+
}
7+
- rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
8+
+ rb_undef_alloc_func(rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer));
9+
free((void *) klass_name);
10+
}

0 commit comments

Comments
 (0)