Page MenuHomeFreeBSD

dtrace, drti, libdtrace: fix type redefintion errors
AbandonedPublic

Authored by christos on May 21 2022, 7:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 1:18 AM
Unknown Object (File)
Jul 9 2023, 2:42 PM
Unknown Object (File)
May 24 2023, 7:06 AM
Unknown Object (File)
May 2 2023, 7:28 AM
Unknown Object (File)
Mar 20 2023, 7:17 PM
Unknown Object (File)
Mar 13 2023, 1:00 PM
Unknown Object (File)
Feb 19 2023, 8:56 AM
Unknown Object (File)
Feb 17 2023, 2:57 AM
Subscribers

Details

Reviewers
markj
gnn
Summary

They couldn't compile due to type redefintion errors. Below is a sample from the compiler output:

/usr/include/x86/_types.h:109:20: error: redefinition of typedef '__uintfptr_t' is a C11 feature [-Werror,-
typedef __uint64_t      __uintfptr_t;
                        ^
/mnt/src/sys/sys/_types.h:78:20: note: previous definition is here
typedef __uint64_t      __uintfptr_t;
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error code 1

There might be more files that need to be modified, but these are the
ones I could find.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think this is probably right. The build shouldn't be setting the include path this way. libdtrace and drti need similar patches.

Just for context, the problem arose when trying to compile just dtrace(1) from the main branch on a system running 13.0, yes?

I think this is probably right. The build shouldn't be setting the include path this way. libdtrace and drti need similar patches.

I can take care of them.

Just for context, the problem arose when trying to compile just dtrace(1) from the main branch on a system running 13.0, yes?

IIRC, it happened on both my host running 13.0 kernel and world and my bhyve
guest running -CURRENT kernel but 13.0 world. In any case, I tried building from
the main branch.

christos retitled this revision from dtrace(1): fix type redefintion errors to dtrace, drti, libdtrace: fix type redefintion errors.
christos edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jun 6 2022, 3:14 PM

Bump. Is this still relevant?

Sorry, yes probably still relevant, I just haven't tried to test it. I guess it should happen if I try to build cddl/lib/libdtrace directly with an empty /usr/obj?

Sorry, yes probably still relevant, I just haven't tried to test it. I guess it should happen if I try to build cddl/lib/libdtrace directly with an empty /usr/obj?

IIRC yes.

I've been carrying this patch in my local tree for a while. I'm not quite sure why it was fine before, but now it causes the libdtrace build to fail: libdtrace builds sys/cddl/dev/dtrace/x86/instr_size.c, which includes <cddl/dev/dtrace/dtrace_cddl.h>, which only works if sys/ is in the include path. In particular, dtrace_cddl.h doesn't get installed to /usr/include.

I've been carrying this patch in my local tree for a while. I'm not quite sure why it was fine before, but now it causes the libdtrace build to fail: libdtrace builds sys/cddl/dev/dtrace/x86/instr_size.c, which includes <cddl/dev/dtrace/dtrace_cddl.h>, which only works if sys/ is in the include path. In particular, dtrace_cddl.h doesn't get installed to /usr/include.

Yeah. I think we should abandon this one.