Allows building shared GC using `make shared-gc SHARED_GC=gc_impl`
This commit is contained in:
Peter Zhu 2024-07-05 15:02:42 -04:00
Родитель 3be9ce3cf6
Коммит a9f6bd028a
4 изменённых файлов: 18 добавлений и 6 удалений

8
.github/workflows/compilers.yml поставляемый
Просмотреть файл

@ -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

Просмотреть файл

@ -1906,6 +1906,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" \

Просмотреть файл

@ -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@

Просмотреть файл

@ -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