Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jun 2011 01:51:43 GMT
From:      Carl <k0802647@telus.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/158013: devel/gmake: TARGET_ARCH variable prevents cross-compilations
Message-ID:  <201106190151.p5J1phk0035516@red.freebsd.org>
Resent-Message-ID: <201106190200.p5J20LCH073450@freefall.freebsd.org>

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

>Number:         158013
>Category:       ports
>Synopsis:       devel/gmake: TARGET_ARCH variable prevents cross-compilations
>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:   Sun Jun 19 02:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Carl
>Release:        FreeBSD-8.2-RELEASE-amd64/i386
>Organization:
>Environment:
FreeBSD xxxxxxxx 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Please refer to the problem reports listed below which document an issue relating to the use of gmake for building FreeBSD ports. I do not profess to fully understand what is going on, but it seems that gmake incorrectly inserts the value of a TARGET_ARCH variable in the 'cc' compile command line, thereby causing a compilation error if that variable is set (see ports/156607 for example). Although it appears that TARGET_ARCH does not serve a purpose when cross-compiling most FreeBSD ports, it is a variable that users may have set in the build environment for other reasons (eg. same environment used for cross-compiling kernel or world). The obvious workaround of ensuring that variable is unset is possible for cross-compiling most ports. However, it is completely counter-intuitive and non-obvious that a variable which is not used by a port MUST be unset in order for that port to compile. This seems a clear violation of the POLA to me. Unfortunately, not all port maintainers are 
 willing to implement a fix in their port's Makefile.

http://www.freebsd.org/cgi/query-pr.cgi?pr=147853
http://www.freebsd.org/cgi/query-pr.cgi?pr=151224
http://www.freebsd.org/cgi/query-pr.cgi?pr=156607
http://www.freebsd.org/cgi/query-pr.cgi?pr=157457
http://www.freebsd.org/cgi/query-pr.cgi?pr=157479

If the FreeBSD gmake port is referencing TARGET_ARCH in a manner that serves no useful purpose in any FreeBSD context, can that functionality be patched out of the gmake port so that users do not have to intuit the undocumented need to unset TARGET_ARCH for ports cross-built with gmake?

Carl                                                 / K0802647

>How-To-Repeat:
Set TARGET_ARCH in the build environment and compile the security/nmap port.
>Fix:


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



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