Skip to content

Commit 54da527

Browse files
authored
ruby: disable backtrace (#15022)
This PR removes backtrace from the ruby build. The reason we want to remove that is to disable [this code block](https://github.com/ruby/ruby/blob/56bdb93b024495bfd544c75a00eaf5d68b15be6c/vm.c#L4108-L4124). From what I can tell, this code block breaks the coverage build; When clang compiles a codebase with coverage instrumentation (-fcoverage-mapping), it can produce a malformed record in the __llvm_covfun ELF section — a ULEB128 value has its continuation bit set but no following byte. Since llvm-cov parses the section sequentially and aborts on the first malformed record, this single bad record (193 bytes out of ~7.4 MB in Rubys case during local testing) causes the entire coverage report to show 0%. This is the case with the Ruby coverage report: The coverage report builds but it incorrectly shows 0% coverage. I don't know why that code block causes that, perhaps it is [the inline include](https://github.com/ruby/ruby/blob/56bdb93b024495bfd544c75a00eaf5d68b15be6c/vm.c#L4109). Signed-off-by: Adam Korczynski <adam@adalogics.com>
1 parent 97db22c commit 54da527

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/ruby/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ echo "Configuring target Ruby with static linking..."
100100
--without-gmp \
101101
--disable-dtrace \
102102
--disable-jit-support \
103-
--with-baseruby="$BASERUBY"
103+
--with-baseruby="$BASERUBY" \
104+
ac_cv_func_backtrace=no
104105

105106
# Build Ruby static library
106107
echo "Building Ruby static library..."

0 commit comments

Comments
 (0)