Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dtest: Disable optimization of the compiled tests

GCC optimizes ever more enthusiastically: At version 4, even at -O2, it
does so in ways that break these tests and that are increasingly
difficult to prevent with code changes.  Instead of increasing levels of
trickery, just disable optimization.

The specific problems we've had are:

- pid/tst.args1

  Notices that the arguments passed to go() are unused, and so
  doesn't actually pass them.

- pid/tst.ret1, pid/tst.ret2

  Notices that handle() calling go() is without side-effect, doesn't do
  it.

- profile-n/tst.ufuncsort, java_api/tst.ProbeData, java_api/tst.FunctionLookup

  Notices that because fN is static, it doesn't need to use the normal
  i386 ABI and instead passes arg0 in %eax, rather than
  on the stack.
  • Loading branch information...
commit 9d633eb43f03b96fb91fca87cfbeca3cc1276b80 1 parent 812d625
Rich Lowe richlowe authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 usr/src/cmd/dtrace/test/tst/Makefile.com
8 usr/src/cmd/dtrace/test/tst/Makefile.com
View
@@ -23,8 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include $(SRC)/cmd/Makefile.cmd
@@ -56,6 +54,12 @@ ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
$(ROOT_TSTS) := FILEMODE = 0444
$(ROOT_EXES) := FILEMODE = 0555
+# The DTrace tests rely on "normal" behaviour from the compiler which
+# agressive optimization of small, simple, one compilation-unit programs may
+# utterly subvert. We force the compiler to not optimize rather than engage
+# in an arms race with increasingly belligerent optimizers.
+COPTFLAG= -xO0
+
all: $(EXES)
clean lint:
Please sign in to comment.
Something went wrong with that request. Please try again.