Project

General

Profile

Actions

Feature #19126

open

clang: Cannot compile with Control Flow Integrity (CFI)

Added by steakknife (Barry Allard) over 1 year ago. Updated almost 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:110716]

Description

Maybe related #19124

Reproduction

sudo dnf install -y yum-utils
sudo yum-config-manager --enable crb
sudo dnf install -y \
  make bc binutils-gold mold patch git bison xz autoconf automake m4 libtool pkg-config perl-interpreter \
  gmp-devel openssl-devel readline-devel libyaml-devel gdbm-devel zlib-devel libffi-devel \
  ncurses-devel readline-devel glibc-static glibc-devel llvm-toolset

LINKER=lld # also tried bfd and mold
FLAGS='-fsanitize=cfi'
LINKFLAGS="-fuse-ld=$LINKER -fsanitize=cfi -flto=thin -fvisibility=default" # also tried =hidden
EXE_LINKFLAGS=''

export \
  CC=clang \
  CXX=clang++ \
  LD=$LINKER \
  CPPFLAGS="$FLAGS" \
  CFLAGS="$FLAGS" \
  CXXFLAGS="$FLAGS" \
  DCFLAGS="$FLAGS" \
  XCFLAGS="$FLAGS" \
  MJIT_CFLAGS="$FLAGS" \
  DLDFLAGS="$FLAGS $LINKFLAGS" \
  LDFLAGS="$FLAGS $LINKFLAGS" \
  XLDFLAGS="$FLAGS $LINKFLAGS $EXE_LINKFLAGS"

./configure --disable-install-doc --enable-shared && \
  make -j && \
  make test && \
  sudo make install

Output

compiling enc/trans/newline.c
./revision.h unchanged
compiling version.c
linking miniruby
generating encdb.h
make: *** [uncommon.mk:1178: builtin_binary.inc] Illegal instruction (core dumped)
make: *** Waiting for unfinished jobs....
make: *** [uncommon.mk:841: .rbconfig.time] Illegal instruction (core dumped)
make: *** [uncommon.mk:1129: encdb.h] Illegal instruction (core dumped)
!!! Compiling ruby 3.1.2 failed!
Actions #1

Updated by jeremyevans0 (Jeremy Evans) almost 1 year ago

  • Tracker changed from Bug to Feature
  • ruby -v deleted (ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux])
  • Backport deleted (2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN)
Actions

Also available in: Atom PDF

Like0
Like0