Bug 13224 - bug of gcc-2.95? (-D__FreeBSD__=3=4)
Summary: bug of gcc-2.95? (-D__FreeBSD__=3=4)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: David E. O'Brien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-08-18 15:50 UTC by imura
Modified: 1999-08-19 00:11 UTC (History)
0 users

See Also:


Attachments
file.diff (1.13 KB, patch)
1999-08-18 15:50 UTC, imura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description imura 1999-08-18 15:50:03 UTC
If a code have "__FreeBSD__" compile fails, because
$(LOCALBASE)/lib/gcc-lib/i386-portbld-freebsd3.2/2.95/specs says
"-D__FreeBSD__=3=4" which comes from $(WRKSRC)/gcc/specs, I'm not sure.
This may be $(WRKSRC)/gcc/stage1/specs or $(WRKSRC)/gcc/stage2/specs.

Fix: Following patches may solve the problem.
How-To-Repeat: Compile a code which have "__FreeBSD__".
Comment 1 motoyuki 1999-08-18 16:20:45 UTC
Hi,

imura@cs.titech.ac.jp wrote:
> If a code have "__FreeBSD__" compile fails, because
> $(LOCALBASE)/lib/gcc-lib/i386-portbld-freebsd3.2/2.95/specs says
> "-D__FreeBSD__=3=4" which comes from $(WRKSRC)/gcc/specs, I'm not sure.
> This may be $(WRKSRC)/gcc/stage1/specs or $(WRKSRC)/gcc/stage2/specs.
> >How-To-Repeat:
> Compile a code which have "__FreeBSD__".
> >Fix:
> Following patches may solve the problem.

I think the problem caused by the followings.

In the file ports/lang/egcs/files/freebsd.h, 
--------
#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -Asystem(unix) -Asystem(FreeBSD) "
--------

In the file ports/lang/egcs/Makefile
--------
pre-configure:
        @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
        ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \
                >${WRKSRC}/gcc/config/freebsd.h )
--------


So, apply following patches to solve this problem.
==========
--- ports/lang/egcs/files/freebsd.h.old       Mon Aug 16 10:42:29 1999
+++ ports/lang/egcs/files/freebsd.h   Thu Aug 19 00:19:48 1999
@@ -55,7 +55,7 @@
 
 /* Place spaces around this string.  We depend on string splicing to produce
    the final CPP_PREDEFINES value.  */
-#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -Asystem(unix) -Asystem(FreeBSD) "
+#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) "
 
 /* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
    libc, depending on whether we're doing profiling or need threads support.
==========

--
------------------------------------------------------------------------
Motoyuki Konno                  mkonno@res.yamanashi-med.ac.jp   (Univ)
                                motoyuki@snipe.rim.or.jp         (Home)
                                motoyuki@FreeBSD.ORG  (FreeBSD Project)
Yamanashi Medical University    http://www.freebsd.org/~motoyuki/ (WWW)
Comment 2 cpiazza freebsd_committer freebsd_triage 1999-08-18 20:08:24 UTC
Responsible Changed
From-To: freebsd-ports->obrien

Over to maintainer 
Comment 3 David E. O'Brien freebsd_committer freebsd_triage 1999-08-18 23:51:29 UTC
State Changed
From-To: open->closed

problem fixed