Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite45b0df

Browse files
committed
Fix portability fallout from commitdc227eb.
Give up on trying to mechanically forbid abort() within libpq.Even though there are no such calls in the source code, we've nowseen three different scenarios where build toolchains silentlyinsert such calls: gcc does it for profiling, some platformsimplement assert() using it, and icc does so for no visible reason.Checking for accidental use of exit() seems considerably moreimportant than checking for abort(), so we'll settle for doingthat for now.Also, filter out __cxa_atexit() to avoid a false match. It seemsthat OpenBSD inserts a call to that despite the fact that libpqcontains no C++ code.Discussion:https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us
1 parent3465c8a commite45b0df

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎src/interfaces/libpq/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ all: all-lib check-libpq-refs
102102
include$(top_srcdir)/src/Makefile.shlib
103103
backend_src =$(top_srcdir)/src/backend
104104

105-
# Check for functions that libpq must not call, currently abort() and exit().
106-
# If nm doesn't exist or doesn't work on shlibs, this test will silently
107-
# do nothing, which is fine. The exclusion of _eprintf.o is to prevent
108-
# complaining about <assert.h> infrastructure on ancient macOS releases.
105+
# Check for functions that libpq must not call, currently just exit().
106+
# (Ideally we'd reject abort() too, but there are various scenarios where
107+
# build toolchains silently insert abort() calls, e.g. when profiling.)
108+
# If nm doesn't exist or doesn't work on shlibs, this test will do nothing,
109+
# which is fine. The exclusion of __cxa_atexit is necessary on OpenBSD,
110+
# which seems to insert references to that even in pure C code.
109111
.PHONY: check-libpq-refs
110112
check-libpq-refs:$(shlib)
111-
! nm -A -g -u$<2>/dev/null| grep -v'_eprintf\.o:'| grep -e abort -eexit
113+
! nm -A -g -u$<2>/dev/null| grep -v__cxa_atexit| grepexit
112114

113115
# Make dependencies on pg_config_paths.h visible in all builds.
114116
fe-connect.o: fe-connect.c$(top_builddir)/src/port/pg_config_paths.h

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp