From 25ec8c921c7ca82cfdfdf8da7ecef3f74c00b002 Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Fri, 14 Aug 2015 22:54:52 +0000 Subject: [PATCH] Introduce a new make variable: NMFLAGS. As the name indicates, these are flags to pass to nm(1). The newer binutils have a plugin mechanism so, to build something with LLVM's LTO, we need to pass flags to nm(1). This commit also extends lorder(1) to pass NMFLAGS to nm(1). --- share/mk/sys.mk | 1 + usr.bin/lorder/lorder.1 | 5 ++++- usr.bin/lorder/lorder.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/mk/sys.mk b/share/mk/sys.mk index d23d1d713bd3..99e0337844eb 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -167,6 +167,7 @@ MAKE ?= make .if !defined(%POSIX) NM ?= nm +NMFLAGS ?= OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import diff --git a/usr.bin/lorder/lorder.1 b/usr.bin/lorder/lorder.1 index 66e682aa98e2..56a4b2a70061 100644 --- a/usr.bin/lorder/lorder.1 +++ b/usr.bin/lorder/lorder.1 @@ -28,7 +28,7 @@ .\" @(#)lorder.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 25, 2006 +.Dd August 14, 2015 .Dt LORDER 1 .Os .Sh NAME @@ -68,6 +68,9 @@ Path to the .Xr nm 1 binary, defaults to .Dq Li nm . +.It Ev NMFLAGS +Flags to pass to +.Xr nm 1 . .El .Sh EXAMPLES .Bd -literal -offset indent diff --git a/usr.bin/lorder/lorder.sh b/usr.bin/lorder/lorder.sh index e423d96b14d3..8123c96779b4 100644 --- a/usr.bin/lorder/lorder.sh +++ b/usr.bin/lorder/lorder.sh @@ -60,7 +60,7 @@ done # # if the line has " U " it's a globally undefined symbol, put it into # the reference file. -${NM} -go $* | sed " +${NM} ${NMFLAGS} -go $* | sed " / [TDW] / { s/:.* [TDW] / / w $S