Fix s_lock_test compile
authorAlvaro Herrera <[email protected]>
Thu, 25 Jan 2024 10:13:38 +0000 (11:13 +0100)
committerAlvaro Herrera <[email protected]>
Thu, 25 Jan 2024 10:17:33 +0000 (11:17 +0100)
This is a mostly unused tool, but I discovered while nosing around the
Makefile that it hasn't been kept in line with other changes.  Fix it.

Backpatching doesn't appear to be necessary.

Discussion: https://postgr.es/m/202401241114[email protected]

src/backend/storage/lmgr/Makefile
src/backend/storage/lmgr/s_lock.c

index 504480e8477a535a2021893ae670b38a3851057f..1aef423384c91fe2f09a32958c2f392335b3ad75 100644 (file)
@@ -33,7 +33,7 @@ endif
 s_lock_test: s_lock.c $(top_builddir)/src/common/libpgcommon.a $(top_builddir)/src/port/libpgport.a
    $(CC) $(CPPFLAGS) $(CFLAGS) -DS_LOCK_TEST=1 $(srcdir)/s_lock.c \
        $(TASPATH) -L $(top_builddir)/src/common -lpgcommon \
-       -L $(top_builddir)/src/port -lpgport -o s_lock_test
+       -L $(top_builddir)/src/port -lpgport -lm -o s_lock_test
 
 # see notes in src/backend/parser/Makefile
 lwlocknames.c: lwlocknames.h
index 0e5f7ab0b9f50add9fd1b5b26805556f9791f967..8437b1307364a185b494aa9cf3246a7837f424cc 100644 (file)
 #define MIN_DELAY_USEC     1000L
 #define MAX_DELAY_USEC     1000000L
 
+#ifdef S_LOCK_TEST
+/*
+ * These are needed by pgstat_report_wait_start in the standalone compile of
+ * s_lock_test.
+ */
+static uint32 local_my_wait_event_info;
+uint32    *my_wait_event_info = &local_my_wait_event_info;
+#endif
 
 slock_t        dummy_spinlock;