Skip to content

Commit

Permalink
[DOC] Comment about logic to care about static/dynamic hetero build
Browse files Browse the repository at this point in the history
The condition is rarely met in usual cases, so it's worth to note about
the situation and the reason why we care about it.
  • Loading branch information
kateinoigakukun committed Feb 21, 2024
1 parent 6aa5067 commit fd91354
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions template/exts.mk.tmpl
Expand Up @@ -69,6 +69,13 @@ Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
end
end
deps.uniq!

# NOTE: Only if extensions are configured as static and dynamic heterogeneously
# (e.g. --with-static-linked-ext=foo or ext/Setup can mix static and dynamic
# extensions), EXTOBJS may contain both extinit.o and dmyext.o. In such case,
# prefer extinit.o, which does actual Init_${ext} function calls for statically
# linked extensions, and drop dmyext.o, which does nothing but just to make the
# linker happy.
if objs = macros["EXTOBJS"] and objs.any? {|e|e.start_with?("ext/extinit.")}
objs.delete_if {|e|e.start_with?("dmyext.")}
end
Expand Down

0 comments on commit fd91354

Please sign in to comment.