From cperciva@fafnir.daemonology.net  Thu Jan  8 09:58:55 2004
Return-Path: <cperciva@fafnir.daemonology.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5570A16A4D0
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Jan 2004 09:58:55 -0800 (PST)
Received: from pd2mo3so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DE49043D5A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Jan 2004 09:58:49 -0800 (PST)
	(envelope-from cperciva@fafnir.daemonology.net)
Received: from pd2mr2so.prod.shaw.ca (pd2mr2so-ser.prod.shaw.ca [10.0.141.109])
 by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003))
 with ESMTP id <0HR600CFYN07MG@l-daemon> for FreeBSD-gnats-submit@freebsd.org;
 Thu, 08 Jan 2004 10:52:55 -0700 (MST)
Received: from pn2ml1so.prod.shaw.ca
 (pn2ml1so-qfe0.prod.shaw.ca [10.0.121.145]) by l-daemon
 (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003))
 with ESMTP id <0HR6003OGN071W@l-daemon> for FreeBSD-gnats-submit@freebsd.org;
 Thu, 08 Jan 2004 10:52:55 -0700 (MST)
Received: from fafnir.daemonology.net ([24.87.233.42])
 by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003))
 with SMTP id <0HR60013AN06L6@l-daemon> for FreeBSD-gnats-submit@freebsd.org;
 Thu, 08 Jan 2004 10:52:55 -0700 (MST)
Received: (qmail 23838 invoked by uid 0); Thu, 08 Jan 2004 17:53:16 +0000
Message-Id: <20040108175316.23832.qmail@fafnir.daemonology.net>
Date: Thu, 08 Jan 2004 17:53:16 +0000
From: Colin Percival <cperciva@daemonology.net>
Reply-To: Colin Percival <cperciva@daemonology.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: wacky string constant merging in isdnd
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         61087
>Category:       bin
>Synopsis:       wacky string constant merging in isdnd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 08 10:00:33 PST 2004
>Closed-Date:    Wed Jan 21 08:50:04 PST 2004
>Last-Modified:  Wed Jan 21 08:50:04 PST 2004
>Originator:     Colin Percival
>Release:        FreeBSD 5.2-RC i386
>Organization:
>Environment:
System: FreeBSD fafnir.daemonology.net 5.2-RC FreeBSD 5.2-RC #3: Sun Jan 4 16:13:57 GMT 2004 cperciva@fafnir.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

>Description:

isdnd contains a build timestamp.  It also contains the 
strings "1", "2", "3", ... , "32".

If isdnd is built at 1-32 seconds past a minute, gcc
will, very helpfully, merge the two constant strings.

This is
1. A problem for FreeBSD Update, since this causes
cascading differences, and
2. Rather astonishing behaviour.

>How-To-Repeat:
>Fix:

Tell gcc not to merge the string constants in this
particular case.

--- isdnd.diff begins here ---
Index: Makefile
===================================================================
RCS file: /usr/cvsroot/src/usr.sbin/i4b/isdnd/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- usr.sbin/i4b/isdnd/Makefile	4 Apr 2003 17:49:14 -0000	1.12
+++ usr.sbin/i4b/isdnd/Makefile	8 Jan 2004 17:23:04 -0000
@@ -10,6 +10,10 @@
 # compile debug support
 COPTS+=	-DDEBUG
 
+# avoid wacky merging of string constants from
+# source code with compile-time timestamp
+COPTS+= -fno-merge-constants
+
 # enable rtprio usage
 COPTS+=	-DUSE_RTPRIO
 
--- isdnd.diff ends here ---
>Release-Note:
>Audit-Trail:

From: Colin Percival <colin.percival@wadham.ox.ac.uk>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/61087: wacky string constant merging in isdnd
Date: Fri, 09 Jan 2004 00:43:32 +0000

 Oops, this isn't sufficient -- isdnmonitor needs a patch as well,
 any maybe other isdn binaries as well.  I'll follow up with a
 complete patch later.
 
 Colin Percival
 
State-Changed-From-To: open->closed 
State-Changed-By: cperciva 
State-Changed-When: Wed Jan 21 08:49:29 PST 2004 
State-Changed-Why:  
Close my PR, I've committed a fix. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=61087 
>Unformatted:
