NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/60642: dtrace(1): doesn't call preprocessor correctly



>Number:         60642
>Category:       bin
>Synopsis:       dtrace(1): doesn't call preprocessor correctly
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 25 12:15:00 +0000 2026
>Originator:     Thomas Klausner
>Release:        NetBSD 11.99.7
>Organization:
	
>Environment:
Architecture: x86_64
Machine: amd64
>Description:
When compiling wip/modular-xorg-server with the (disabled-on-NetBSD)
dtrace option, you'll see

[1/647] Generating 'dix/liblibxserver_dix.a.p/Xserver-dtrace.h'
FAILED: [code=1] dix/liblibxserver_dix.a.p/Xserver-dtrace.h
/usr/sbin/dtrace -h -s ../include/Xserver.d -o dix/liblibxserver_dix.a.p/Xserver-dtrace.h
dtrace: failed to compile script ../include/Xserver.d: "/usr/lib/dtrace/psinfo.d", line 46: syntax error near "u_int"

I've fixed this problem by removing psinfo.d from the NetBSD base system,
since it uses `u_int` and `struct proc` but nothing defines it.

After that removal, the error is now:
[3/647] Generating 'dix/liblibxserver_dix.a.p/Xserver-dtrace.h'
FAILED: [code=1] dix/liblibxserver_dix.a.p/Xserver-dtrace.h
/usr/sbin/dtrace -h -s ../include/Xserver.d -o dix/liblibxserver_dix.a.p/Xserver-dtrace.h
dtrace: failed to compile script ../include/Xserver.d: line 26: invalid control directive: #ifdef

The code is (after some comments):

#ifdef __APPLE__
#define string char *
#define pid_t uint32_t
#define zoneid_t uint32_t
#elif defined(__FreeBSD__)
#define zoneid_t id_t
#else
#include <sys/types.h>
#endif

Changing '#ifdef' to #if' doesn't fix this.

I assume dtrace should call a c preprocessor to handle this, which
is why I chose the subject.

Perhaps the removal of psinfo.d was incorrect and that it should
also work; I'm happy to put it back when this is fixed.
>How-To-Repeat:
Enable the dtrace option in wip/modular-xorg-server and build it.
>Fix:
Please.

>Unformatted:
 	
 	



Home | Main Index | Thread Index | Old Index