svn commit: r269096 - projects/bmake/share/mk

Simon J. Gerraty sjg at FreeBSD.org
Fri Jul 25 20:44:05 UTC 2014


Author: sjg
Date: Fri Jul 25 20:44:04 2014
New Revision: 269096
URL: http://svnweb.freebsd.org/changeset/base/269096

Log:
  Crude cross-build support thanks to clang

Modified:
  projects/bmake/share/mk/local.sys.mk

Modified: projects/bmake/share/mk/local.sys.mk
==============================================================================
--- projects/bmake/share/mk/local.sys.mk	Fri Jul 25 20:21:02 2014	(r269095)
+++ projects/bmake/share/mk/local.sys.mk	Fri Jul 25 20:44:04 2014	(r269096)
@@ -220,7 +220,7 @@ STAGE_SYMLINKS_DIR= ${STAGE_OBJTOP}
 .ifdef WITH_SYSROOT
 SYSROOT?= ${STAGE_OBJTOP}/
 .endif
-LDFLAGS_LAST+= -Wl,-rpath-link,${STAGE_LIBDIR}
+LDFLAGS_LAST+= -Wl,-rpath-link -Wl,${STAGE_LIBDIR}
 STAGED_INCLUDE_DIR= ${STAGE_OBJTOP}/usr/include
 .endif
 .endif				# EARLY_BUILD for host
@@ -309,4 +309,16 @@ HOST_CC?= ${TOOLSDIR}/usr/bin/cc
 .endif
 .endif
 
+.if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE}
+# cross-building
+.if !defined(FREEBSD_REVISION)
+FREEBSD_REVISION!= sed -n '/^REVISION=/{s,.*=,,;s,",,g;p; }' ${SRCTOP}/sys/conf/newvers.sh
+.export FREEBSD_REVISION
+.endif
+CROSS_TARGET_FLAGS= -target ${MACHINE_ARCH}-unknown-freebsd${FREEBSD_REVISION}
+CFLAGS+= ${CROSS_TARGET_FLAGS}
+ACFLAGS+= ${CROSS_TARGET_FLAGS}
+LDFLAGS+= -Wl,-m -Wl,elf_${MACHINE_ARCH}_fbsd
+.endif
+
 .endif				# bmake


More information about the svn-src-projects mailing list