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

Appearance settings

Commit e7abc11

Browse filesBrowse files
committed
On macOS, use -isysroot in link steps as well as compile steps.
We previously put the -isysroot switch only into CPPFLAGS, theorizing that it was only needed to find the right copies of include files. However, it seems that we also need to use it while linking programs, to find the right stub ".tbd" files for libraries. We got away without that up to now, but apparently that was mostly luck. It may also be that failures are only observed when the Xcode version is noticeably out of sync with the host macOS version; the case that's prompting action right now is that builds fail when using latest Xcode (12.2) on macOS Catalina, even though it's fine on Big Sur. Hence, add -isysroot to LDFLAGS as well. (It seems that the more common practice is to put it in CFLAGS, whence it'd be included at both compile and link steps. However, we can't mess with CFLAGS in the platform template file without confusing configure's logic for choosing default CFLAGS.) Back-patch of 49407dc into all supported branches. Report and patch by James Hilliard (some cosmetic mods by me) Discussion: https://postgr.es/m/20201120003314.20560-1-james.hilliard1@gmail.com
1 parent 159b677 commit e7abc11
Copy full SHA for e7abc11

File tree

Expand file treeCollapse file tree

3 files changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+5
-0
lines changed

‎configure

Copy file name to clipboardExpand all lines: configure
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16264,8 +16264,10 @@ _ACEOF
1626416264
# literally, so that it's possible to override it at build time using
1626516265
# a command like "make ... PG_SYSROOT=path". This has to be done after
1626616266
# we've finished all configure checks that depend on CPPFLAGS.
16267+
# The same for LDFLAGS, too.
1626716268
if test x"$PG_SYSROOT" != x; then
1626816269
CPPFLAGS=`echo "$CPPFLAGS" | sed -e "s| $PG_SYSROOT | \\\$(PG_SYSROOT) |"`
16270+
LDFLAGS=`echo "$LDFLAGS" | sed -e "s| $PG_SYSROOT | \\\$(PG_SYSROOT) |"`
1626916271
fi
1627016272

1627116273

‎configure.in

Copy file name to clipboardExpand all lines: configure.in
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,8 +2234,10 @@ AC_SUBST(PG_VERSION_NUM)
22342234
# literally, so that it's possible to override it at build time using
22352235
# a command like "make ... PG_SYSROOT=path". This has to be done after
22362236
# we've finished all configure checks that depend on CPPFLAGS.
2237+
# The same for LDFLAGS, too.
22372238
if test x"$PG_SYSROOT" != x; then
22382239
CPPFLAGS=`echo "$CPPFLAGS" | sed -e "s| $PG_SYSROOT | \\\$(PG_SYSROOT) |"`
2240+
LDFLAGS=`echo "$LDFLAGS" | sed -e "s| $PG_SYSROOT | \\\$(PG_SYSROOT) |"`
22392241
fi
22402242
AC_SUBST(PG_SYSROOT)
22412243

‎src/template/darwin

Copy file name to clipboardExpand all lines: src/template/darwin
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fi
1111
if test x"$PG_SYSROOT" != x"" ; then
1212
if test -d "$PG_SYSROOT" ; then
1313
CPPFLAGS="-isysroot $PG_SYSROOT $CPPFLAGS"
14+
LDFLAGS="-isysroot $PG_SYSROOT $LDFLAGS"
1415
else
1516
PG_SYSROOT=""
1617
fi

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.