Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jan 2011 00:02:39 GMT
From:      Yuri Karaban <tech@askold.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/154364: lang/gcc45: generate i486 code by default for i386 architecture
Message-ID:  <201101290002.p0T02dbH072281@red.freebsd.org>
Resent-Message-ID: <201101290010.p0T0A9oE092256@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         154364
>Category:       ports
>Synopsis:       lang/gcc45: generate i486 code by default for i386 architecture
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 29 00:10:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Yuri Karaban
>Release:        8.1-RELEASE
>Organization:
>Environment:
>Description:
Since genuine 80386 machines is officially not supported by FreeBSD. It is safe to enable generation of i486 code by default.

This needed to enable atomic built-ins, which greatly speed up concurrent code. In standard C++ library std::string, using locking extensively and atomic built-ins will give noticeable speedup.

Needless to say, granting to use i486 instructions by default will speed up some programs which does not explicitly set -march.

I opened similar bug report (gnu/148926) regarding system gcc. The problem were solved by enabling some defines in c++config.h related to atomic builtins (since system gcc already generates i486 code by default).

Adding -with-arch=i486 to configure options is sufficient for lang/gcc45. The gcc will generate i486 code by default and libstdc++ shipped with it will be auto-configured to use atomic built-ins without need to edit c++config.h manually.

I'm attaching the patch which adds -with-arch=i486 for i386 architecture.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Makefile.orig	2011-01-28 21:33:11.000000000 +0200
+++ Makefile	2011-01-29 00:44:53.000000000 +0200
@@ -66,6 +66,10 @@
 CONFIGURE_TARGET=	${ARCH}-portbld-freebsd${OSREL}
 .endif
 
+.if ${ARCH} == "i386"
+CONFIGURE_ARGS+=	--with-arch=i486
+.endif
+
 SRCDIR=		${WRKDIR}/gcc-${VERSIONSTRING}
 WRKSRC=		${WRKDIR}/build
 TARGLIB=	${PREFIX}/lib/gcc${SUFFIX}


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101290002.p0T02dbH072281>