Bug 7855 - cpp should define __ELF__ if objformat = elf
Summary: cpp should define __ELF__ if objformat = elf
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1998-09-07 20:50 UTC by Don Croyle
Modified: 1999-08-22 03:14 UTC (History)
0 users

See Also:


Attachments
file.diff (281 bytes, patch)
1998-09-07 20:50 UTC, Don Croyle
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Croyle 1998-09-07 20:50:03 UTC
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).

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:
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.
Comment 1 Don Croyle 1999-07-08 08:53:17 UTC
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.
Comment 2 hoek freebsd_committer freebsd_triage 1999-08-22 03:09:26 UTC
State Changed
From-To: open->closed

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.