From 2e35b207d2accd69baa2557dd908066cb436bebf Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 17 Aug 2022 14:31:09 +0200 Subject: [PATCH 7/7] WIP: meson: Make link order of object files match makefile order --- src/bin/pg_basebackup/meson.build | 2 +- src/bin/pg_waldump/Makefile | 2 +- src/common/Makefile | 17 ++++++++++------- src/fe_utils/Makefile | 2 +- src/interfaces/libpq/meson.build | 4 ++-- src/port/Makefile | 6 +++--- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build index dcaae84b9a..dd388d8a1e 100644 --- a/src/bin/pg_basebackup/meson.build +++ b/src/bin/pg_basebackup/meson.build @@ -3,8 +3,8 @@ common_sources = files( 'bbstreamer_gzip.c', 'bbstreamer_inject.c', 'bbstreamer_lz4.c', - 'bbstreamer_tar.c', 'bbstreamer_zstd.c', + 'bbstreamer_tar.c', 'receivelog.c', 'streamutil.c', 'walmethods.c', diff --git a/src/bin/pg_waldump/Makefile b/src/bin/pg_waldump/Makefile index d6459e17c7..53c602c3ca 100644 --- a/src/bin/pg_waldump/Makefile +++ b/src/bin/pg_waldump/Makefile @@ -8,11 +8,11 @@ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global OBJS = \ - $(RMGRDESCOBJS) \ $(WIN32RES) \ compat.o \ pg_waldump.o \ rmgrdesc.o \ + $(RMGRDESCOBJS) \ xlogreader.o \ xlogstats.o diff --git a/src/common/Makefile b/src/common/Makefile index e9af7346c9..05ea957861 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -50,12 +50,9 @@ OBJS_COMMON = \ base64.o \ checksum_helper.o \ compression.o \ - config_info.o \ controldata_utils.o \ - d2s.o \ encnames.o \ exec.o \ - f2s.o \ file_perm.o \ file_utils.o \ hashfn.o \ @@ -83,9 +80,9 @@ OBJS_COMMON = \ ifeq ($(with_ssl),openssl) OBJS_COMMON += \ - protocol_openssl.o \ cryptohash_openssl.o \ - hmac_openssl.o + hmac_openssl.o \ + protocol_openssl.o else OBJS_COMMON += \ cryptohash.o \ @@ -95,6 +92,11 @@ OBJS_COMMON += \ sha2.o endif +OBJS_EXTRA = \ + d2s.o \ + f2s.o \ + config_info.o + # A few files are currently only built for frontend, not server # (Mkvcbuild.pm has a copy of this list, too). logging.c is excluded # from OBJS_FRONTEND_SHLIB (shared library) as a matter of policy, @@ -104,14 +106,15 @@ OBJS_FRONTEND_SHLIB = \ $(OBJS_COMMON) \ fe_memutils.o \ restricted_token.o \ - sprompt.o + sprompt.o \ + $(OBJS_EXTRA) OBJS_FRONTEND = \ $(OBJS_FRONTEND_SHLIB) \ logging.o # foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c OBJS_SHLIB = $(OBJS_FRONTEND_SHLIB:%.o=%_shlib.o) -OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o) +OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o) $(OBJS_EXTRA:%.o=%_srv.o) # where to find gen_keywordlist.pl and subsidiary files TOOLSDIR = $(top_srcdir)/src/tools diff --git a/src/fe_utils/Makefile b/src/fe_utils/Makefile index 44bc7a1215..ab750d336a 100644 --- a/src/fe_utils/Makefile +++ b/src/fe_utils/Makefile @@ -20,6 +20,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) OBJS = \ + psqlscan.o \ archive.o \ cancel.o \ conditional.o \ @@ -28,7 +29,6 @@ OBJS = \ option_utils.o \ parallel_slot.o \ print.o \ - psqlscan.o \ query_utils.o \ recovery_gen.o \ simple_list.o \ diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build index 2cc4f5f8c8..0a78a498c7 100644 --- a/src/interfaces/libpq/meson.build +++ b/src/interfaces/libpq/meson.build @@ -28,8 +28,8 @@ endif if gssapi.found() libpq_sources += files( - 'fe-secure-gssapi.c', - 'fe-gssapi-common.c' + 'fe-gssapi-common.c', + 'fe-secure-gssapi.c' ) endif diff --git a/src/port/Makefile b/src/port/Makefile index b3754d8940..d8da9d77b6 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -38,8 +38,6 @@ LIBS += $(PTHREAD_LIBS) # If you add objects here, see also src/tools/msvc/Mkvcbuild.pm OBJS = \ - $(LIBOBJS) \ - $(PG_CRC32C_OBJS) \ bsearch_arg.o \ chklocale.o \ inet_net_ntop.o \ @@ -59,7 +57,9 @@ OBJS = \ snprintf.o \ strerror.o \ tar.o \ - thread.o + thread.o \ + $(LIBOBJS) \ + $(PG_CRC32C_OBJS) # libpgport.a, libpgport_shlib.a, and libpgport_srv.a contain the same files # foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c -- 2.37.1