You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bunch of distros now build with LTO by default, although Gentoo doesn't (yet?). We should try make that work, or if we really have to, pass -fno-lto for now in the build system.
This is very much something we've never tried before -- but it should nearly work. The only thingss the USDT mechanism (that's failing here) absolutely require are that we can identify the location of references to specific symbols at link time and patch them into NOPs, recording their (section-relative) offsets in the DOF so we can put probes there later. Nothing there requires non-LTO that I know of, but the usdt-tst-forker error suggests that something is being thrown awry in this process. Probably the problem is that under LTO the actual compilation isn't done until link time, but when USDT is in use, dtrace -G modifies the input object files before link time and requires them to contain actual final references to USDT probe points. An object file containing no object code and nothing but IR to be later consumed by the compiler isn't going to be good enough.
The right fix for this is probably for DTrace to contribute a linker plugin so that it can get into the linking process after LTO and run dtrace -G for you, which would have the major advantage of making building programs containing USDT probes just like building normal programs: no special dtrace -G stage. But I have absolutely no idea how easy that would be...
With regard to LTOing DTrace itself... God only knows how many assumptions there are in the codebase that LTO violates. I know the testsuite verifies that we can identify things correctly in the presence of interposition, and that test is obviously not going to work with interposition disabled (but that's not this error, and that's easy to fix in the makefiles by turning on -fno-semantic-interposition for that specific test).
The drti.c failure probably relates to this line:
dof_hdr_t *dof = &__SUNW_dof;
which suggests that the entire .SUNW_dof section has been dropped as unused. While this is technically true (it isn't used by the program, no), it is distinctly unhelpful. I wonder how we can stop it. We can hardly require everyone linking DOF into their program to use a specialized linker script: I wonder if this requires upstream binutils changes to exempt this section from pruning?
A bunch of distros now build with LTO by default, although Gentoo doesn't (yet?). We should try make that work, or if we really have to, pass
-fno-lto
for now in the build system.We currently explode with:
I've not looked into it yet.
The text was updated successfully, but these errors were encountered: