NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
toolchain/59659: ctfconvert in tools is built differently on non-NetBSD OSes
>Number: 59659
>Category: toolchain
>Synopsis: ctfconvert in tools is built differently on non-NetBSD OSes
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 18 09:45:00 +0000 2025
>Originator: Ryota Ozaki
>Release: current and 10 (probably also 11)
>Organization:
IIJ
>Environment:
amd64 and aarch64 (see below)
>Description:
ctfconvert is built as a tool with the NetBSD specific change that omits low-value CTF entries: "volatile", "const" and "restrict" (*).
(*) https://github.com/NetBSD/src/blob/f17778d50731ed4f8f4d2b5e817e979064019bc5/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c#L280-L288
Unfortunately, this change is applied inside #ifdef __NetBSD__ and so if it is built on non-NetBSD OS like Linux, the change is ignored. This results in that built binaries between NetBSD and Linux have different CTF data.
>How-To-Repeat:
Build NetBSD on both NetBSD and Linux, run ctfdump netbsd.gdb of both and see the differences of the outputs.
An example of sdiff output of the outputs (partial):
total number of volatile types = 0 | total number of volatile types = 41
total number of const types = 0 | total number of const types = 1017
total number of restrict types = 0 | total number of restrict types = 4
The left is NetBSD and the right is Linux.
Tested versions:
- NetBSD current (amd64) on NetBSD 9 (amd64)
- NetBSD 10 (aarch64) on NetBSD 9 (amd64)
- NetBDS 10 (aarch64) on Ubuntu 24.04 (amd64)
>Fix:
Add another condition HAVE_NBTOOL_CONFIG_H to #ifdef __NetBSD__ in fixup_tdescs.c.
Home |
Main Index |
Thread Index |
Old Index