Skip to content

Commit dd3a44c

Browse files
committed
selftests/powerpc: Only test lwm/stmw on big endian
Newer binutils (>= 2.36) refuse to assemble lmw/stmw when building in little endian mode. That breaks compilation of our alignment handler test: /tmp/cco4l14N.s: Assembler messages: /tmp/cco4l14N.s:1440: Error: `lmw' invalid when little-endian /tmp/cco4l14N.s:1814: Error: `stmw' invalid when little-endian make[2]: *** [../../lib.mk:139: /output/kselftest/powerpc/alignment/alignment_handler] Error 1 These tests do pass on little endian machines, as the kernel will still emulate those instructions even when running little endian (which is arguably a kernel bug). But we don't really need to test that case, so ifdef those instructions out to get the alignment test building again. Reported-by: Libor Pechacek <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Tested-by: Libor Pechacek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 92a5e1f commit dd3a44c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/testing/selftests/powerpc/alignment/alignment_handler.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ int test_alignment_handler_integer(void)
443443
LOAD_DFORM_TEST(ldu);
444444
LOAD_XFORM_TEST(ldx);
445445
LOAD_XFORM_TEST(ldux);
446-
LOAD_DFORM_TEST(lmw);
447446
STORE_DFORM_TEST(stb);
448447
STORE_XFORM_TEST(stbx);
449448
STORE_DFORM_TEST(stbu);
@@ -462,7 +461,11 @@ int test_alignment_handler_integer(void)
462461
STORE_XFORM_TEST(stdx);
463462
STORE_DFORM_TEST(stdu);
464463
STORE_XFORM_TEST(stdux);
464+
465+
#ifdef __BIG_ENDIAN__
466+
LOAD_DFORM_TEST(lmw);
465467
STORE_DFORM_TEST(stmw);
468+
#endif
466469

467470
return rc;
468471
}

0 commit comments

Comments
 (0)