Skip to content

Commit

Permalink
fix(truffle): patch posix thread detection support
Browse files Browse the repository at this point in the history
because the weak symbols won't work with truffleruby, for more context
see:

- oracle/truffleruby#3031
  • Loading branch information
flavorjones committed May 2, 2023
1 parent cfb6b99 commit 4d5486d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ def needs_darwin_linker_hack
append_ldflags("-Wl,-flat_namespace")
end

if truffle?
append_ldflags("-lpthread")
end

require "yaml"
dependencies = YAML.load_file(File.join(PACKAGE_ROOT_DIR, "dependencies.yml"))

Expand Down
29 changes: 29 additions & 0 deletions patches/libxml2/0011-patch-posix-thread-detection-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 8cc1e13856ca509e02175552fc0f142eef46a129 Mon Sep 17 00:00:00 2001
From: Mike Dalessio <[email protected]>
Date: Tue, 2 May 2023 15:39:50 -0400
Subject: [PATCH] patch posix thread detection support

because the weak symbols won't work with truffleruby, for more context
see:

- https://github.com/oracle/truffleruby/issues/3031
---
threads.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/threads.c b/threads.c
index 56a917e6..c496cfbd 100644
--- a/threads.c
+++ b/threads.c
@@ -43,7 +43,7 @@

#elif defined(HAVE_POSIX_THREADS) && \
defined(__GLIBC__) && \
- defined(__GNUC__)
+ defined(__GNUC__) && false

/*
* The traditional way to check for single-threaded applications with
--
2.40.1

0 comments on commit 4d5486d

Please sign in to comment.