From: "steakknife (Barry Allard)" Date: 2022-11-12T02:00:07+00:00 Subject: [ruby-core:110716] [Ruby master Bug#19126] clang: Cannot compile with Control Flow Integrity (CFI) Issue #19126 has been reported by steakknife (Barry Allard). ---------------------------------------- Bug #19126: clang: Cannot compile with Control Flow Integrity (CFI) https://bugs.ruby-lang.org/issues/19126 * Author: steakknife (Barry Allard) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- 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! ``` -- https://bugs.ruby-lang.org/ Unsubscribe: