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
F170659477: D59030.id184436.diff
Sat, Sep 5, 8:59 PM
F170633592: D59030.id184669.diff
Sat, Sep 5, 5:56 PM
F170623822: D59030.diff
Sat, Sep 5, 4:53 PM
F170574744: D59030.id184669.diff
Sat, Sep 5, 11:39 AM
F170556140: D59030.id184436.diff
Sat, Sep 5, 9:44 AM
F170513885: D59030.id.diff
Sat, Sep 5, 4:36 AM
F170509045: D59030.diff
Sat, Sep 5, 4:01 AM
F170504345: D59030.id.diff
Sat, Sep 5, 3:32 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 75775
Build 72658: arc lint + arc unit

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