Skip to content

Commit ee3bd57

Browse files
committed
Enforce LC_ALL=C
To ensure consistent file and directory handling, this patch bypasses locale-specific behavior in libc.
1 parent ebfcec0 commit ee3bd57

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ EXPECTED_pi = 3.1415926535897932384626433832795028841971693993751058209749445923
343343

344344
check-hello: $(BIN)
345345
$(Q)$(PRINTF) "Running hello.elf ... "; \
346-
if [ "$(shell $(BIN) $(OUT)/hello.elf | uniq)" = "$(strip $(EXPECTED_hello)) inferior exit code 0" ]; then \
346+
if [ "$(shell LC_ALL=C $(BIN) $(OUT)/hello.elf | uniq)" = "$(strip $(EXPECTED_hello)) inferior exit code 0" ]; then \
347347
$(call notice, [OK]); \
348348
else \
349349
$(PRINTF) "Failed.\n"; \
@@ -353,7 +353,7 @@ check-hello: $(BIN)
353353
check: $(BIN) check-hello artifact
354354
$(Q)$(foreach e,$(CHECK_ELF_FILES),\
355355
$(PRINTF) "Running $(e) ... "; \
356-
if [ "$(shell $(BIN) $(OUT)/riscv32/$(e) | uniq)" = "$(strip $(EXPECTED_$(e))) inferior exit code 0" ]; then \
356+
if [ "$(shell LC_ALL=C $(BIN) $(OUT)/riscv32/$(e) | uniq)" = "$(strip $(EXPECTED_$(e))) inferior exit code 0" ]; then \
357357
$(call notice, [OK]); \
358358
else \
359359
$(PRINTF) "Failed.\n"; \
@@ -364,7 +364,7 @@ check: $(BIN) check-hello artifact
364364
EXPECTED_aes_sha1 = 1242a6757c8aef23e50b5264f5941a2f4b4a347e -
365365
misalign: $(BIN) artifact
366366
$(Q)$(PRINTF) "Running uaes ... ";
367-
$(Q)if [ "$(shell $(BIN) -m $(OUT)/riscv32/uaes | $(SHA1SUM))" = "$(EXPECTED_aes_sha1)" ]; then \
367+
$(Q)if [ "$(shell LC_ALL=C $(BIN) -m $(OUT)/riscv32/uaes | $(SHA1SUM))" = "$(EXPECTED_aes_sha1)" ]; then \
368368
$(call notice, [OK]); \
369369
else \
370370
$(PRINTF) "Failed.\n"; \
@@ -373,7 +373,7 @@ misalign: $(BIN) artifact
373373
EXPECTED_misalign = MISALIGNED INSTRUCTION FETCH TEST PASSED!
374374
misalign-in-blk-emu: $(BIN)
375375
$(Q)$(PRINTF) "Running misalign.elf ... "; \
376-
if [ "$(shell $(BIN) tests/system/alignment/misalign.elf | tail -n 2)" = "$(strip $(EXPECTED_misalign)) inferior exit code 0" ]; then \
376+
if [ "$(shell LC_ALL=C $(BIN) tests/system/alignment/misalign.elf | tail -n 2)" = "$(strip $(EXPECTED_misalign)) inferior exit code 0" ]; then \
377377
$(call notice, [OK]); \
378378
else \
379379
$(PRINTF) "Failed.\n"; \
@@ -383,7 +383,7 @@ misalign-in-blk-emu: $(BIN)
383383
EXPECTED_mmu = STORE PAGE FAULT TEST PASSED!
384384
mmu-test: $(BIN)
385385
$(Q)$(PRINTF) "Running vm.elf ... "; \
386-
if [ "$(shell $(BIN) tests/system/mmu/vm.elf | tail -n 2)" = "$(strip $(EXPECTED_mmu)) inferior exit code 0" ]; then \
386+
if [ "$(shell LC_ALL=C $(BIN) tests/system/mmu/vm.elf | tail -n 2)" = "$(strip $(EXPECTED_mmu)) inferior exit code 0" ]; then \
387387
$(call notice, [OK]); \
388388
else \
389389
$(PRINTF) "Failed.\n"; \
@@ -392,13 +392,13 @@ mmu-test: $(BIN)
392392

393393
# Non-trivial demonstration programs
394394
ifeq ($(call has, SDL), 1)
395-
doom_action := (cd $(OUT); ../$(BIN) riscv32/doom)
395+
doom_action := (cd $(OUT); LC_ALL=C ../$(BIN) riscv32/doom)
396396
doom_deps += $(DOOM_DATA) $(BIN)
397397
doom: artifact $(doom_deps)
398398
$(doom_action)
399399

400400
ifeq ($(call has, EXT_F), 1)
401-
quake_action := (cd $(OUT); ../$(BIN) riscv32/quake)
401+
quake_action := (cd $(OUT); LC_ALL=C ../$(BIN) riscv32/quake)
402402
quake_deps += $(QUAKE_DATA) $(BIN)
403403
quake: artifact $(quake_deps)
404404
$(quake_action)

0 commit comments

Comments
 (0)