From owner-svn-src-all@FreeBSD.ORG Thu Sep 9 11:10:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5EF710656DE; Thu, 9 Sep 2010 11:10:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48C38FC12; Thu, 9 Sep 2010 11:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o89BAFJ1071495; Thu, 9 Sep 2010 11:10:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o89BAFFF071493; Thu, 9 Sep 2010 11:10:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009091110.o89BAFFF071493@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Sep 2010 11:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 11:10:15 -0000 Author: rpaulo Date: Thu Sep 9 11:10:15 2010 New Revision: 212358 URL: http://svn.freebsd.org/changeset/base/212358 Log: Don't clobber an existing target object file when doing the DTrace linking process. This is needed because we change the source object files and the second this dtrace -G is run, no probes will be found. This hack allows us to build postgres with DTrace probes enabled. I'll try to find a way to fix this without needing this hack. Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 9 09:58:05 2010 (r212357) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 9 11:10:15 2010 (r212358) @@ -1616,6 +1616,18 @@ dtrace_program_link(dtrace_hdl_t *dtp, d int eprobes = 0, ret = 0; #if !defined(sun) + if (access(file, R_OK) == 0) { + fprintf(stderr, "dtrace: target object (%s) already exists. " + "Please remove the target\ndtrace: object and rebuild all " + "the source objects if you wish to run the DTrace\n" + "dtrace: linking process again\n", file); + /* + * Several build infrastructures run DTrace twice (e.g. + * postgres) and we don't want the build to fail. Return + * 0 here since this isn't really a fatal error. + */ + return (0); + } /* XXX Should get a temp file name here. */ snprintf(tfile, sizeof(tfile), "%s.tmp", file); #endif