Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7922595

Browse files
committed
Further restrict the scope of no-exit()-in-libpq test.
Disable this check altogether in --enable-coverage builds, because newer versions of gcc insert exit() as well as abort() calls for that. Also disable it on AIX and Solaris, because those platforms tend to provide facilities such as libldap as static libraries, which then get included in libpq's shlib. We can't expect such libraries to honor our coding rules. (That platform list might need additional tweaking, but I think this is enough to keep the buildfarm happy.) Per reports from Jacob Champion and Noah Misch. Discussion: https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us
1 parent d390bb6 commit 7922595

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/interfaces/libpq/Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,20 @@ backend_src = $(top_srcdir)/src/backend
104104

105105
# Check for functions that libpq must not call, currently just exit().
106106
# (Ideally we'd reject abort() too, but there are various scenarios where
107-
# build toolchains silently insert abort() calls, e.g. when profiling.)
107+
# build toolchains insert abort() calls, e.g. to implement assert().)
108108
# If nm doesn't exist or doesn't work on shlibs, this test will do nothing,
109109
# which is fine. The exclusion of __cxa_atexit is necessary on OpenBSD,
110110
# which seems to insert references to that even in pure C code.
111+
# Skip the test when profiling, as gcc may insert exit() calls for that.
112+
# Also skip the test on platforms where libpq infrastructure may be provided
113+
# by statically-linked libraries, as we can't expect them to honor this
114+
# coding rule.
111115
libpq-refs-stamp: $(shlib)
116+
ifneq ($(enable_coverage), yes)
117+
ifeq (,$(filter aix solaris,$(PORTNAME)))
112118
! nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit
119+
endif
120+
endif
113121
touch $@
114122

115123
# Make dependencies on pg_config_paths.h visible in all builds.

0 commit comments

Comments
 (0)