Module Name:    src
Committed By:   christos
Date:           Tue Apr 23 21:58:57 UTC 2024

Modified Files:
        src/distrib/common: Makefile.mdset

Log Message:
`nm`: Generate a stable symbol table (Jan-Benedict Glaw)

Release artifacts may contain symbol lists. Binutils's `nm` sorts them by
symbol name, locale based. Inserting a plain `sort` (with `LC_ALL=C`) here
sorts them by address, and (with several symbols pointing to the same address)
sorting by name is also stable (think of embedded '_'.)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/distrib/common/Makefile.mdset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/common/Makefile.mdset
diff -u src/distrib/common/Makefile.mdset:1.46 src/distrib/common/Makefile.mdset:1.47
--- src/distrib/common/Makefile.mdset:1.46	Mon Aug 12 04:04:28 2019
+++ src/distrib/common/Makefile.mdset	Tue Apr 23 17:58:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.46 2019/08/12 08:04:28 martin Exp $
+#	$NetBSD: Makefile.mdset,v 1.47 2024/04/23 21:58:57 christos Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -149,7 +149,7 @@ ${_KERNEL.${_K}.${_F}}: .NOTMAIN ${_KERN
 	${TOOL_MDSETIMAGE} ${MDSETIMAGEFLAGS} ${.TARGET}.tmp ${_I}
 .endif
 .if !defined(MDSET_NOSYMBOLS.${_FILENAME}) && !defined(MDSET_NOSYMBOLS)
-	${NM} ${.TARGET}.tmp | ${TOOL_GZIP_N} -9 > ${.TARGET}.symbols.gz
+	${NM} ${.TARGET}.tmp | LC_ALL=C sort | ${TOOL_GZIP_N} -9 > ${.TARGET}.symbols.gz
 .endif
 .if !defined(MDSET_NOSTRIP.${_FILENAME}) && !defined(MDSET_NOSTRIP)
 	${STRIP} -R .eh_frame -R .eh_frame_hdr -R .comment -R .ident ${MDSET_STRIPSECTIONS} ${.TARGET}.tmp

Reply via email to