Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add make target shared-gc #11111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,9 @@ jobs:

- name: Build shared GC
run: >
make probes.h &&
export RUBY_GC_LIBRARY=librubygc.so &&
echo "RUBY_GC_LIBRARY=$RUBY_GC_LIBRARY" >> $GITHUB_ENV &&
echo "RUBY_GC_LIBRARY=librubygc.gc_impl.so" >> $GITHUB_ENV &&
mkdir ${{ matrix.entry.shared_gc_dir }} &&
gcc -I../src -I../src/include -I. -I.ext/include/x86_64-linux
-Wl,-undefined,dynamic_lookup -fPIC -g -O3 -shared
-o ${{ matrix.entry.shared_gc_dir }}/$RUBY_GC_LIBRARY ../src/gc_impl.c
make shared-gc SHARED_GC=gc_impl
if: ${{ matrix.entry.shared_gc }}

- name: Add to ext/Setup
Expand Down
12 changes: 12 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,18 @@ rewindable:

HELP_EXTRA_TASKS = ""

shared-gc: probes.h
$(Q) if test -z $(shared_gc_dir); then \
echo "You must configure with --with-shared-gc to use shared GC"; \
exit 1; \
elif test -z $(SHARED_GC); then \
echo "You must specify SHARED_GC with the GC to build"; \
exit 1; \
else \
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
$(LDSHARED) -I$(srcdir)/include -I$(srcdir) -I$(arch_hdrdir) -I. $(XDLDFLAGS) $(cflags) -fPIC -o $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT) $(srcdir)/$(SHARED_GC).c; \
fi

help: PHONY
$(MESSAGE_BEGIN) \
" Makefile of Ruby" \
Expand Down
2 changes: 2 additions & 0 deletions template/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ RUBY_VERSION_NAME = @RUBY_VERSION_NAME@
UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@
BUILTIN_BINARY = @X_BUILTIN_BINARY@

shared_gc_dir = @shared_gc_dir@

TESTUI = console
TESTS =
INSTALLDOC = @INSTALLDOC@
Expand Down
2 changes: 2 additions & 0 deletions tool/m4/ruby_shared_gc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ AS_IF([test x"$shared_gc_dir" != x], [

shared_gc_summary="no"
])

AC_SUBST(shared_gc_dir, "${shared_gc_dir}")
])dnl
Loading