Page MenuHomeFreeBSD

dtrace/tests: compile D sources at runtime on test target
ClosedPublic

Authored by siva on Thu, Aug 20, 4:15 AM.
Tags
None
Referenced Files
F171950715: D59030.id.diff
Mon, Sep 14, 9:03 PM
Unknown Object (File)
Sat, Sep 12, 6:17 PM
Unknown Object (File)
Fri, Sep 11, 11:57 PM
Unknown Object (File)
Fri, Sep 11, 5:31 PM
Unknown Object (File)
Thu, Sep 10, 2:35 PM
Unknown Object (File)
Wed, Sep 9, 3:07 PM
Unknown Object (File)
Wed, Sep 9, 3:06 PM
Unknown Object (File)
Wed, Sep 9, 2:12 PM
Subscribers

Details

Summary

Previously, we would precompile D test dependencies using the
host's dtrace, which unconditionally outputs ELF files in the
host's format. This breaks the cross-compile build with errors
like the following:

dtrace: failed to link script: incorrect ELF machine type for
object file: tst.usdt.pieo

  • usdt.o ---
  • Failed target: usdt.o

This patch moves compilation to runtime for all C-based testcases
that have a dependent D source file.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

siva requested review of this revision.Thu, Aug 20, 4:15 AM

This is fine I guess, but ideally dtrace would support cross-compilation. It'd take some work though: to start, dt_link.c would need some notion of a target platform where today it uses ifdefs. I don't object to your approach though, if it solves some immediate problem.

cddl/usr.sbin/dtrace/tests/tools/dtest.sh
59

There should be some comment explaining what this is doing, and why.

cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
70

Can't we just set this to ${TFILES} ${CFILES} in each makefile? That should make the diff smaller.

cddl/usr.sbin/dtrace/tests/tools/dtest.sh
59

Hope this is sufficient. Yeah I'd like to get the tests running on all archs first, this is just a short term fix.

cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
70

Good idea, thanks!

This revision is now accepted and ready to land.Tue, Aug 25, 6:03 PM