From nobody@FreeBSD.org  Mon Feb 27 11:17:28 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C73AE106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2012 11:17:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B678C8FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2012 11:17:28 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RBHSHj057152
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2012 11:17:28 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1RBHSN2057151;
	Mon, 27 Feb 2012 11:17:28 GMT
	(envelope-from nobody)
Message-Id: <201202271117.q1RBHSN2057151@red.freebsd.org>
Date: Mon, 27 Feb 2012 11:17:28 GMT
From: Olivier Cochard-Labbe <olivier@cochard.me>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsd.port.mk : Proposal patch for fixing TARGET_ARCH uses with somes ports
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165502
>Category:       ports
>Synopsis:       [bsd.port.mk] Proposal patch for fixing TARGET_ARCH uses with somes ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 27 11:20:03 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Feb 27 11:32:15 UTC 2012
>Originator:     Olivier Cochard-Labbe
>Release:        9.0
>Organization:
BSD Router Project
>Environment:
FreeBSD bigdev.bsdrp.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sat Jan  7 19:32:30 CET 2012     root@bigdev.bsdrp.net:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Hi,
I found multiple same problem in different ports: PR/165480, PR/147853, PR/151224.
For theses ports, setting TARGET_ARCH for build the port generate an error, here is one example:

cc -O2 -pipe -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse -DFUSE_USE_VERSION=26 -std=gnu99 -g3 -Wall -Wextra -I/usr/local/include -L/usr/local/lib amd64 -c -o extents.o extents.c
cc: amd64: No such file or directory

The patch was the same for all ports by adding this line on the Makefile:
MAKE_ENV+= TARGET_ARCH=

Why not patching bsd.port.mk for fixing the problem for all ports ?
I didn't know how many ports are affected by this problem.
>How-To-Repeat:

>Fix:
Applying the patch attached to Mk/bsd.port.mk.

Patch attached with submission follows:

--- Mk/bsd.port.mk.orig	2012-02-27 11:46:48.000000000 +0100
+++ Mk/bsd.port.mk	2012-02-27 11:47:38.000000000 +0100
@@ -2205,6 +2205,7 @@
 			LDFLAGS="${LDFLAGS}" \
 			CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
 			MANPREFIX="${MANPREFIX}"
+MAKE_ENV+=		TARGET_ARCH=
 
 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Feb 27 11:20:16 UTC 2012 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165502 
>Unformatted:
