Skip to content
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

Get make yjit-bindgen to work on clean checkout. Fix miniruby build #175

Merged
merged 1 commit into from
Feb 18, 2022
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
6 changes: 4 additions & 2 deletions defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,14 @@ $(YJIT_LIBS): yjit-static-lib
# TODO: might need to move for BSD Make support
miniruby$(EXEEXT): $(YJIT_LIBS)

# generate rust bindings. see source for details
# Generate rust bindings. See source for details. Needs `./configure --enable-yjit`
ifneq ($(strip $(CARGO)),) # if configure found Cargo
.PHONY: yjit-bindgen
yjit-bindgen:
yjit-bindgen: miniruby$(EXEEXT)
cd '$(top_srcdir)'
# See make recipe for `.c.i`
$(CARGO) run --manifest-path '$(top_srcdir)/yjit/bindgen/Cargo.toml' -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS)
endif

# Query on the generated rdoc
#
Expand Down
3 changes: 3 additions & 0 deletions yjit.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#ifndef YJIT_STATS
# define YJIT_STATS RUBY_DEBUG
#endif
// For porting, disable YJIT_STATS. C code mostly for textual reference now.
#undef YJIT_STATS
#define YJIT_STATS 0

// We generate x86 assembly
#if (defined(__x86_64__) && !defined(_WIN32)) || (defined(_WIN32) && defined(_M_AMD64)) // x64 platforms without mingw/msys
Expand Down
3 changes: 1 addition & 2 deletions yjit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ To generate C bindings for the YJIT Rust code, run:

```sh
CC=clang ./configure --enable-yjit=dev
make -j miniruby
make yjit-bindgen
make -j yjit-bindgen
```

This will generate/update `yjit/src/cruby_bindings.inc.rs`. Avoid manually editing this file
Expand Down
3 changes: 2 additions & 1 deletion yjit_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,8 @@ static VALUE
comments_for(rb_execution_context_t *ec, VALUE self, VALUE start_address, VALUE end_address)
{
VALUE comment_array = rb_ary_new();
#if RUBY_DEBUG
// disabled to help porting.
#if 0
uint8_t *start = (void *)NUM2ULL(start_address);
uint8_t *end = (void *)NUM2ULL(end_address);

Expand Down