Skip to content

Commit 9a39fef

Browse files
committed
clang on linux just ignores -compatibility_version instead of failing
with an unknown error message (despite the fact that ld won't actually understand the argument, so linking will actually fail in the end). This is a hack to generate workable makefiles; it may not be the right fix...
1 parent efa2a28 commit 9a39fef

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

configure.ac

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,17 @@ AS_IF([test "x$dispatch_cv_cc_omit_leaf_fp" != "xno"], [
273273
])
274274
AC_SUBST([OMIT_LEAF_FP_FLAGS])
275275

276-
AC_CACHE_CHECK([for darwin linker], [dispatch_cv_ld_darwin], [
277-
saveLDFLAGS="$LDFLAGS"
278-
LDFLAGS="$LDFLAGS -dynamiclib -compatibility_version 1.2.3 -current_version 4.5.6 -dead_strip"
279-
AC_LINK_IFELSE([AC_LANG_PROGRAM([
280-
extern int foo; int foo;], [foo = 0;])],
281-
[dispatch_cv_ld_darwin="yes"], [dispatch_cv_ld_darwin="no"])
282-
LDFLAGS="$saveLDFLAGS"
276+
AS_IF([test "x$have_mach" = "xtrue"], [
277+
AC_CACHE_CHECK([for darwin linker], [dispatch_cv_ld_darwin], [
278+
saveLDFLAGS="$LDFLAGS"
279+
LDFLAGS="$LDFLAGS -dynamiclib -compatibility_version 1.2.3 -current_version 4.5.6 -dead_strip"
280+
AC_LINK_IFELSE([AC_LANG_PROGRAM([
281+
extern int foo; int foo;], [foo = 0;])],
282+
[dispatch_cv_ld_darwin="yes"], [dispatch_cv_ld_darwin="no"])
283+
LDFLAGS="$saveLDFLAGS"
284+
])
283285
])
284-
AM_CONDITIONAL(HAVE_DARWIN_LD, [test "x$dispatch_cv_ld_darwin" != "xno"])
286+
AM_CONDITIONAL(HAVE_DARWIN_LD, [test "x$dispatch_cv_ld_darwin" == "xyes"])
285287

286288
#
287289
# Temporary: some versions of clang do not mark __builtin_trap() as

0 commit comments

Comments
 (0)