Page MenuHomeFreeBSD

lang/python314: Add DTRACE
Needs ReviewPublic

Authored by 0mp on Mon, Oct 5, 3:14 PM.
Tags
None
Referenced Files
F175329953: D60369.diff
Sat, Oct 10, 12:55 AM
F175282827: D60369.id.diff
Fri, Oct 9, 4:26 PM
F175282434: D60369.id.diff
Fri, Oct 9, 4:23 PM
Unknown Object (File)
Wed, Oct 7, 5:51 PM
Unknown Object (File)
Wed, Oct 7, 5:41 PM
Unknown Object (File)
Wed, Oct 7, 1:35 AM
Unknown Object (File)
Wed, Oct 7, 12:29 AM
Unknown Object (File)
Tue, Oct 6, 9:25 PM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

We need to patch configure the same way NetBSD does it.
See https://github.com/python/cpython/pull/137444.

Option DTRACE is incompatible with option LTO due to build
failures:

dtrace: failed to link script ./Include/pydtrace.d: invalid file type: Python/ceval.o

That probably caused by the fact that, when LTO is enabled, the object
files during build contain LLVM bitcode instead of ELF objects.

PR: 288359
Sponsored by: fme AG


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288359

Test Plan

Test instructions:

  1. Build the port with DTRACE enable and LTO disabled.
  2. Install the port.
  3. Run dtrace -l -n 'python*:::' -c 'python3.14 --version' | grep libpython to confirm the presence of DTrace probes.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77721
Build 74604: arc lint + arc unit

Event Timeline

0mp requested review of this revision.Mon, Oct 5, 3:14 PM
0mp created this revision.
0mp added subscribers: Python, smyru.
0mp added a subscriber: antranigv_freebsd.am.

As mentioned in D31489, the inability of LTO and DTrace to work together is unacceptable.

It looks like the build failure with both LTO and DTrace enabled was reported upstream some time ago.

lang/python314/Makefile
79

https://llvm.org/docs/FatLTO.html

The one obvious downside is an increase in resulting package size. However, this allows enabling both LTO and DTRACE options, with a caveat:

80

In theory this should also be passed to the linker (lld), but LTO linking fails, so let the linker fall back to non-LTO linking.

This flag is placed here instead of in LTO because the resulting package size balloons to 2-3×. Also when LTO is disabled, this flag is a no-op.

81

Please put this in pkg-plist.