From b3059f23efb87f30549a5392022ed79b71fb8685 Mon Sep 17 00:00:00 2001 From: aswin-mcw Date: Wed, 29 Jul 2026 15:27:40 +0530 Subject: [PATCH] Cygwin: testsuite: install the test runtime under testinst/usr/bin Mirror the real MSYS2 layout so init_installation_root() resolves to testinst. MSYS2 strips three levels from the DLL path (/usr/bin/msys-2.0.dll -> ); with the DLL and helpers under testinst/bin the extra strip overshot the root to ${builddir}, so /tmp resolved to ${builddir}/tmp instead of testinst/tmp. Put the test DLL and the sh/sleep/ls helpers under testinst/usr/bin and point runtime_root there; / -> testinst, /bin and /usr/bin -> testinst/usr/bin, /tmp stays testinst/tmp. --- winsup/cygwin/Makefile.am | 4 ++-- winsup/testsuite/Makefile.am | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am index 41190bdb7a..f30cfa5652 100644 --- a/winsup/cygwin/Makefile.am +++ b/winsup/cygwin/Makefile.am @@ -620,8 +620,8 @@ $(NEW_DLL_NAME): $(LDSCRIPT) libdll.a $(VERSION_OFILES) $(LIBSERVER)\ $(newlib_build)/libm.a \ $(newlib_build)/libc.a \ -lgcc -lkernel32 -lntdll -Wl,-Map,msys.map - @$(MKDIR_P) ${target_builddir}/winsup/testsuite/testinst/bin/ - $(AM_V_at)$(INSTALL_PROGRAM) $(NEW_DLL_NAME) ${target_builddir}/winsup/testsuite/testinst/bin/$(DLL_NAME) + @$(MKDIR_P) ${target_builddir}/winsup/testsuite/testinst/usr/bin/ + $(AM_V_at)$(INSTALL_PROGRAM) $(NEW_DLL_NAME) ${target_builddir}/winsup/testsuite/testinst/usr/bin/$(DLL_NAME) # msys-2.0 import library toolopts=--cpu=@target_cpu@ --ar=@AR@ --as=@AS@ --nm=@NM@ --objcopy=@OBJCOPY@ diff --git a/winsup/testsuite/Makefile.am b/winsup/testsuite/Makefile.am index 8f2967a6dc..f43b460791 100644 --- a/winsup/testsuite/Makefile.am +++ b/winsup/testsuite/Makefile.am @@ -343,7 +343,7 @@ XFAIL_TESTS = \ # cygrun.sh test-runner script, and variables used by it: LOG_COMPILER = $(srcdir)/cygrun.sh -export runtime_root=$(abs_builddir)/testinst/bin +export runtime_root=$(abs_builddir)/testinst/usr/bin export cygrun=$(builddir)/mingw/cygrun # Set up things in the Cygwin 'installation' at testsuite/testinst/ to provide @@ -365,9 +365,9 @@ export cygrun=$(builddir)/mingw/cygrun check-local: $(MKDIR_P) ${builddir}/testinst/tmp - cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe sh.exe - cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe sleep.exe - cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe ls.exe + cd ${builddir}/testinst/usr/bin && cp /usr/libexec/busybox/bin/busybox.exe sh.exe + cd ${builddir}/testinst/usr/bin && cp /usr/libexec/busybox/bin/busybox.exe sleep.exe + cd ${builddir}/testinst/usr/bin && cp /usr/libexec/busybox/bin/busybox.exe ls.exe # target to build all the programs needed by check, without running check check_programs: $(check_PROGRAMS)