Skip to contentSkip to conversation

Makefile: set LC_{COLLATE, NUMERIC}=C, unexport LC_ALL

PATCH In review Petr Vorel 2 participants 3 messages Nov 7, 2022 – Nov 10, 2022 Kbuild

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

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

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.

---
 Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Makefile +7 -1
index eb12b9d69..cb80622d6 100644
@@ -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
Signature · 5 lines
2.38.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 1/1
#1 lore raw
Quoted 33 lines · Petr Vorel

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.

---
  Makefile | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
Makefile +7 -1
index eb12b9d69..cb80622d6 100644
@@ -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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw

Hi Akihiko, Richard,

thank you for a review, merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp