From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2026-02-05T12:31:11+00:00 Subject: [ruby-core:124681] [Ruby Bug#21862] dtrace is passed unmodified CPPFLAGS, but not all compiler flags are supported by dtrace Issue #21862 has been updated by nobu (Nobuyoshi Nakada). `-g` is not a C pre-processor flag. ---------------------------------------- Bug #21862: dtrace is passed unmodified CPPFLAGS, but not all compiler flags are supported by dtrace https://bugs.ruby-lang.org/issues/21862#change-116276 * Author: wiz (Thomas Klausner) * Status: Open * ruby -v: 4.0.1 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- I use "CPPFLAGS=-g" to enable symbols in my builds. This works for most software, except for ruby. The problem is that, in template/Makefile.in, CPPFLAGS are passed unmodified to dtrace: ``` .d.h: @$(ECHO) translating probes $< $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) $(CPPFLAGS) -s $< ``` which on NetBSD leads to a dtrace usage warning, because -g is not supported: ``` BASERUBY = ./tool/missing-baseruby.bat CC = gcc LD = ld LDSHARED = gcc -shared CFLAGS = -O2 -g -fstack-clash-protection -pthread -I/usr/pkg/include -I/usr/include -fPIC -pipe XCFLAGS = -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/x86_64-netbsd -I.ext/include -I./include -I. -I./prism -I./enc/unicode/17.0.0 -Dmodular_gc_dir= CPPFLAGS = -g -I/usr/pkg/include -I/usr/include DLDFLAGS = -Wl,-zrelro -Wl,-znow -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -pthread -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby40.so.40 SOLIBS = -lexecinfo -lz -lrt -lrt -lcrypt -lm -lpthread LANG = C LC_ALL = C LC_CTYPE = C MFLAGS = RUSTC = rustc YJIT_RUSTC_ARGS = --crate-name=yjit --crate-type=staticlib --cfg feature="stats_allocator" --edition=2021 -g -C lto=thin -C opt-level=3 -C overflow-checks=on '--out-dir=/tmp/lang/ruby40/work/ruby-4.0.1/tar get/release/' './yjit/src/lib.rs' ZJIT_RUSTC_ARGS = --crate-name=zjit --crate-type=staticlib --cfg feature="stats_allocator" --edition=2024 -g -C lto=thin -C opt-level=3 -C overflow-checks=on '--out-dir=/tmp/lang/ruby40/work/ruby-4.0.1/tar get/release/' './zjit/src/lib.rs' gcc (nb2 20260118) 14.3.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. compiling ./main.c compiling dmydln.c compiling miniinit.c translating probes probes.d dtrace: unknown option -- g Usage: dtrace [-32|-64] [-aACeFGhHlqSvVwZ] [-b bufsz] [-c cmd] [-D name[=def]] [-I path] [-L path] [-o output] [-p pid] [-s script] [-U name] [-x opt[=val]] [-X a|c|s|t] [-P provider [[ predicate ] action ]] [-m [ provider: ] module [[ predicate ] action ]] [-f [[ provider: ] module: ] func [[ predicate ] action ]] [-n [[[ provider: ] module: ] func: ] name [[ predicate ] action ]] [-i probe-id [[ predicate ] action ]] [ args ... ] ... ``` which breaks the build. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/