Page MenuHomeFreeBSD

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

Authored by siva on Thu, Aug 20, 4:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 20, 8:47 PM
Unknown Object (File)
Thu, Aug 20, 8:47 PM
Subscribers

Details

Reviewers
markj
lwhsu
gnn
Group Reviewers
DTrace
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 75949
Build 72832: 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!