From owner-svn-src-stable@FreeBSD.ORG Fri Dec 30 21:00:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0C4106564A; Fri, 30 Dec 2011 21:00:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 378C18FC08; Fri, 30 Dec 2011 21:00:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBUL03DP030425; Fri, 30 Dec 2011 21:00:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBUL02Rt030423; Fri, 30 Dec 2011 21:00:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201112302100.pBUL02Rt030423@svn.freebsd.org> From: Dimitry Andric Date: Fri, 30 Dec 2011 21:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229029 - stable/9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 21:00:03 -0000 Author: dim Date: Fri Dec 30 21:00:02 2011 New Revision: 229029 URL: http://svn.freebsd.org/changeset/base/229029 Log: MFC r227120: Make it possible to set CC and CXX (and optionally, AS and LD) in make.conf(5), while allowing the build32 stage on 64-bit architectures to still override them, so that stage can successfully build 32-bit compatibility libraries. Explanation: 1) The build32 stage sets environment variables CC, CXX, AS and LD for its sub-make, to add 32-bit specific flags (-m32 and such). 2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so does not alter them. 3) After some other stuff, sys.mk reads /etc/make.conf. When you have "CC=xxx" and "CXX=yyy" statements in there, they will *override* the build32-supplied CC/CXX values, nullifying the 32-bit specific flags. 4) Thus all objects get built as 64-bit anyway, and since LD is usually not set in make.conf, it still has the 32-bit flags! 5) Now, whenever something is linked, you will get a "ld: Relocatable linking with relocations from format elf64-x86-64-freebsd (foo.o) to format elf32-i386-freebsd (bar.o) is not supported" error. Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make invocation, which forces those environment variables to always override any assignment in makefiles. Thus making it possible to simply set: CC=my-cc CXX=my-c++ in your make.conf, or specify a path, even: CC=/usr/local/bin/other-cc CXX=/usr/local/bin/other-c++ Note this was never a problem on i386, since it has no build32 stage. Silence from: current@ Modified: stable/9/Makefile.inc1 (contents, props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Dec 30 20:57:36 2011 (r229028) +++ stable/9/Makefile.inc1 Fri Dec 30 21:00:02 2011 (r229029) @@ -313,7 +313,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ - -DWITHOUT_HTML -DNO_CTF -DNO_LINT DESTDIR=${LIB32TMP} + -DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \ + DESTDIR=${LIB32TMP} LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS .endif