[Bug 296407] lang/tcl86: dtrace build requires `execstack`

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 30 Jun 2026 15:38:26 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296407

            Bug ID: 296407
           Summary: lang/tcl86: dtrace build requires `execstack`
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tcltk@FreeBSD.org
          Reporter: michael@galassi.us
             Flags: maintainer-feedback?(tcltk@FreeBSD.org)
          Assignee: tcltk@FreeBSD.org

When building on a current 14.4:
$ uname -a
FreeBSD tms.home.galassi.us 14.4-STABLE FreeBSD 14.4-STABLE
stable/14-n274442-58a15fe75cc5 GENERIC amd64
linking `libtcl86.so.1` yields the following:

...
ld.lld: error: tclDTrace.o: requires an executable stack, but -z execstack is
not specified
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libtcl86.so.1] Error code 1

My understanding of this is that dtrace requires the stack to be executable
which in turn requires that lld be given `-z execstack` which can be done by
giving `cc` the added flags `-z,execstack` which will then be correctly passed
through to the linker.  This one line change makes things seem to work, someone
who better knows this code should think this through.

$ git diff Makefile 
diff --git a/lang/tcl86/Makefile b/lang/tcl86/Makefile
index a15f390805c6..f773a68662c1 100644
--- a/lang/tcl86/Makefile
+++ b/lang/tcl86/Makefile
@@ -24,7 +24,7 @@ CONFIGURE_ARGS=       --enable-shared \
                --enable-man-suffix=.${MAN_SUFFIX} \
                --includedir=${PREFIX}/include/tcl${TCL_VER}
 CONFIGURE_ENV= PORTSDIR=${PORTSDIR}
-LDFLAGS+=      -Wl,-z,muldefs
+LDFLAGS+=      -Wl,-z,muldefs,-z,execstack

 OPTIONS_DEFINE=        TCLMAN TZDATA THREADS DEBUG
 OPTIONS_DEFINE_amd64=  DTRACE

-- 
You are receiving this mail because:
You are the assignee for the bug.