From croyle@gelemna.ft-wayne.in.us  Mon Sep  7 12:43:39 1998
Received: from catastrophe.gelemna.ft-wayne.in.us (fw-line-137.fwi.com [209.84.172.142])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA22451
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 7 Sep 1998 12:43:35 -0700 (PDT)
          (envelope-from croyle@gelemna.ft-wayne.in.us)
Received: from emerson.gelemna.ft-wayne.in.us (emerson.gelemna.ft-wayne.in.us [10.23.42.2])
	by catastrophe.gelemna.ft-wayne.in.us (8.8.8/8.8.8) with ESMTP id OAA26603
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 7 Sep 1998 14:42:23 -0500 (EST)
	(envelope-from croyle@gelemna.ft-wayne.in.us)
Received: (from croyle@localhost)
	by emerson.gelemna.ft-wayne.in.us (8.9.1/8.9.1) id OAA02194;
	Mon, 7 Sep 1998 14:42:23 -0500 (EST)
	(envelope-from croyle@gelemna.ft-wayne.in.us)
Message-Id: <199809071942.OAA02194@emerson.gelemna.ft-wayne.in.us>
Date: Mon, 7 Sep 1998 14:42:23 -0500 (EST)
From: Don Croyle <croyle@gelemna.ft-wayne.in.us>
Reply-To: croyle@gelemna.ft-wayne.in.us
To: FreeBSD-gnats-submit@freebsd.org
Subject: cpp should define __ELF__ if objformat = elf
X-Send-Pr-Version: 3.2

>Number:         7855
>Category:       bin
>Synopsis:       cpp should define __ELF__ if objformat = elf
>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:   Mon Sep  7 12:50:03 PDT 1998
>Closed-Date:    Sat Aug 21 19:09:26 PDT 1999
>Last-Modified:  Sat Aug 21 19:14:20 PDT 1999
>Originator:     Don Croyle
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:
A post E-day -current.
	

>Description:
Cpp doesn't define __ELF__ when the object format is elf.  I don't
believe that anything in the core OS uses cpp, but I know at least one
port that cares about __ELF__ does (archivers/zip).
	

>How-To-Repeat:
On a system where the default object format is elf:

touch foo.c
cc -E -dM foo.c
cpp -dM foo.c

Note the __ELF__ is listed in the former but not the latter output.
	

>Fix:
Since /usr/bin/cpp is a wrapper script, fixing it seems less intrusive
than grafting objformat's functionality into /usr/libexec/cpp.

This patch does that:

*** usr.bin/cpp/cpp.sh.orig	Sat Feb 22 14:54:47 1997
--- usr.bin/cpp/cpp.sh	Mon Sep  7 02:32:17 1998
***************
*** 50,55 ****
--- 50,60 ----
  INCS="-nostdinc"
  FOUNDFILES=no
  
+ if [ `objformat` = "elf" ]
+ then
+ 	ALST="$ALST -D__ELF__"
+ fi
+ 
  for A
  do
  	case $A in

	

>Release-Note:
>Audit-Trail:

From: Don Croyle <croyle@gelemna.ft-wayne.in.us>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/7855: cpp should define __ELF__ if objformat = elf
Date: 08 Jul 1999 02:53:17 -0500

 Someone what to close this?  It has long since been overtaken by
 events and bde hated the idea when someone else suggested it.
 -- 
 I've always wanted to be a dilettante, but I've never quite been ready
 to make the commitment.
 
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Sat Aug 21 19:09:26 PDT 1999 
State-Changed-Why:  
cpp should define no more than absolutely necessary.  Originator reportrts 
that his suggestion has long since been overtaken by events.  Originator 
reports that bde also hated his suggestion.  Originator confirms closure. 
>Unformatted:
