summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGabriella Gonzalez <gabriella@mercury.com>2023-02-07 12:56:23 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-06 17:06:50 -0500
commit674b6b81e391fc9271d0a8f6ab20037b917a4721 (patch)
treea9aa3566099b7d76e95d15a105a5e537dff54bc5 /m4
parentb042b125dd7c59703d313b5339b1d66128f590b5 (diff)
downloadhaskell-674b6b81e391fc9271d0a8f6ab20037b917a4721.tar.gz
Try to create somewhat portable `ld` command
I cannot figure out a good way to generate an `ld` command that works on both Linux and macOS. Normally you'd use something like `AC_LINK_IFELSE` for this purpose (I think), but that won't let us test response file support.
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_ld_supports_response_files.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/m4/fp_ld_supports_response_files.m4 b/m4/fp_ld_supports_response_files.m4
index 84f0d4b033..c9f633157e 100644
--- a/m4/fp_ld_supports_response_files.m4
+++ b/m4/fp_ld_supports_response_files.m4
@@ -6,7 +6,7 @@ AC_DEFUN([FP_LD_SUPPORTS_RESPONSE_FILES], [
AC_MSG_CHECKING([whether $LD supports response files])
echo 'int main(void) {return 0;}' > conftest.c
$CC -c -o conftest.o conftest.c > /dev/null 2>&1
- if $LD @<(printf '%q\n' -o conftest conftest.o) > /dev/null 2>&1
+ if $LD @<(printf '%q\n' -shared -o conftest conftest.o) > /dev/null 2>&1 || $LD @<(printf '%q\n' -dylib -o conftest conftest.o) > /dev/null 2>&1
then
LdSupportsResponseFiles=YES
AC_MSG_RESULT([yes])