[LTP] [PATCH v2 1/1] Makefile: set LC_{COLLATE, NUMERIC}=C, unexport LC_ALL

Petr Vorel pvorel@suse.cz
Mon Nov 7 15:54:53 CET 2022


to have reproducible builds (no locale dependencies).
Get inspiration from Linux kernel, commits:
c051346b7db2 ("Makefile: set LC_CTYPE, LC_COLLATE, LC_NUMERIC to C")
07105202bdeb ("Makefile: do not override LC_CTYPE")

NOTE: we don't care about messages not being localized.

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index eb12b9d69..cb80622d6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) Linux Test Project, 2009-2021
+# Copyright (c) Linux Test Project, 2009-2022
 # Copyright (c) Cisco Systems Inc., 2009-2010
 # Ngie Cooper, July 2009
 
+# Avoid funny character set dependencies
+unexport LC_ALL
+LC_COLLATE=C
+LC_NUMERIC=C
+export LC_COLLATE LC_NUMERIC
+
 top_srcdir		?= $(CURDIR)
 
 include $(top_srcdir)/include/mk/env_pre.mk
-- 
2.38.0



More information about the ltp mailing list