Skip site navigation (1)Skip section navigation (2)
Date:      27 Apr 2006 09:57:25 -0000
From:      Alex Mogilnikov <alx@intellectronika.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Joerg Wunsch <joerg@FreeBSD.org>
Subject:   ports/96407: [PATCH] devel/avr-gcc-devel fails to build with -march in CFLAGS
Message-ID:  <20060427095725.92690.qmail@newserv.intellectronika.ru>
Resent-Message-ID: <200604271000.k3RA0UIQ037205@freefall.freebsd.org>

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

>Number:         96407
>Category:       ports
>Synopsis:       [PATCH] devel/avr-gcc-devel fails to build with -march in CFLAGS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 27 10:00:29 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alex Mogilnikov
>Release:        
>Organization:
>Environment:
System: FreeBSD newserv.intellectronika.ru 5.4-RELEASE-p6 FreeBSD 5.4-RELEASE-p6 #2: Sun Aug 7 14:48:38 YEKST 2005 alx@newserv.intellectronika.ru:/usr/obj/usr/src/sys/MYKERNEL i386
CPUTYPE=i686 in /etc/make.conf
>Description:
    Makefile in gcc-4.1.0 unconditionally adds host compiler flags
    containing in CFLAGS variable to CFLAGS_FOR_TARGET.
    If CFLAGS contains -march=... option, building of libgcc modules
    fails with the following error message:

	cc1: error: unrecognized command line option "-march=pentiumpro"

>How-To-Repeat:
    echo CPUTYPE=i686 >>/etc/make.conf
    cd /usr/ports/devel/avr-gcc-devel && make

>Fix:
	add the following patch to devel/avr-gcc-devel/files

--- patch-march begins here ---
--- Makefile.in.orig	Thu Dec 15 19:02:02 2005
+++ Makefile.in	Thu Apr 27 03:58:59 2006
@@ -329,7 +329,7 @@
 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
 # (which we know are built with gcc) are built with optimizations so
 # prepend -O2 when setting CFLAGS_FOR_TARGET.
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+CFLAGS_FOR_TARGET = -O2 $(filter-out -march=% -mcpu=%,$(CFLAGS)) $(SYSROOT_CFLAGS_FOR_TARGET)
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
 CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
--- patch-march ends here ---

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



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