ports/96407: [PATCH] devel/avr-gcc-devel fails to build with -march in CFLAGS

Alex Mogilnikov alx at intellectronika.ru
Thu Apr 27 10:00:31 UTC 2006


>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 at 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:



More information about the freebsd-ports-bugs mailing list