Stop using shared-ld wrapper script under Mac
We don't need to cater for gcc < 3.1 any longer and can just use -single_module option unconditionally. This is simpler and avoids spurious errors about "unknown option" when using -fsanitize=xxx in LDFLAGS from the script.
This commit is contained in:
158
configure
vendored
158
configure
vendored
@@ -39399,161 +39399,11 @@ $as_echo "$bakefile_cv_prog_makeisgnu" >&6; }
|
||||
;;
|
||||
|
||||
*-*-darwin* )
|
||||
SHARED_LD_MODULE_CC="\${CC} -bundle -single_module -headerpad_max_install_names -o"
|
||||
SHARED_LD_MODULE_CXX="\${CXX} -bundle -single_module -headerpad_max_install_names -o"
|
||||
|
||||
D='$'
|
||||
cat <<EOF >shared-ld-sh
|
||||
#!/bin/sh
|
||||
#-----------------------------------------------------------------------------
|
||||
#-- Name: distrib/mac/shared-ld-sh
|
||||
#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X
|
||||
#-- Author: Gilles Depeyrot
|
||||
#-- Copyright: (c) 2002 Gilles Depeyrot
|
||||
#-- Licence: any use permitted
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
verbose=0
|
||||
args=""
|
||||
objects=""
|
||||
linking_flag="-dynamiclib"
|
||||
ldargs="-r -keep_private_externs -nostdlib"
|
||||
|
||||
if test "x${D}CXX" = "x"; then
|
||||
CXX="c++"
|
||||
fi
|
||||
|
||||
while test ${D}# -gt 0; do
|
||||
case ${D}1 in
|
||||
|
||||
-v)
|
||||
verbose=1
|
||||
;;
|
||||
|
||||
-o|-compatibility_version|-current_version|-framework|-undefined|-install_name)
|
||||
# collect these options and values
|
||||
args="${D}{args} ${D}1 ${D}2"
|
||||
shift
|
||||
;;
|
||||
|
||||
-arch|-isysroot)
|
||||
# collect these options and values
|
||||
ldargs="${D}{ldargs} ${D}1 ${D}2"
|
||||
shift
|
||||
;;
|
||||
|
||||
-s|-Wl,*)
|
||||
# collect these load args
|
||||
ldargs="${D}{ldargs} ${D}1"
|
||||
;;
|
||||
|
||||
-l*|-L*|-flat_namespace|-headerpad_max_install_names)
|
||||
# collect these options
|
||||
args="${D}{args} ${D}1"
|
||||
;;
|
||||
|
||||
-dynamiclib|-bundle)
|
||||
linking_flag="${D}1"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo "shared-ld: unhandled option '${D}1'"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*.o | *.a | *.dylib)
|
||||
# collect object files
|
||||
objects="${D}{objects} ${D}1"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "shared-ld: unhandled argument '${D}1'"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
status=0
|
||||
|
||||
#
|
||||
# Link one module containing all the others
|
||||
#
|
||||
if test ${D}{verbose} = 1; then
|
||||
echo "${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o"
|
||||
fi
|
||||
${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o
|
||||
status=${D}?
|
||||
|
||||
#
|
||||
# Link the shared library from the single module created, but only if the
|
||||
# previous command didn't fail:
|
||||
#
|
||||
if test ${D}{status} = 0; then
|
||||
if test ${D}{verbose} = 1; then
|
||||
echo "${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args}"
|
||||
fi
|
||||
${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args}
|
||||
status=${D}?
|
||||
fi
|
||||
|
||||
#
|
||||
# Remove intermediate module
|
||||
#
|
||||
rm -f master.${D}${D}.o
|
||||
|
||||
exit ${D}status
|
||||
EOF
|
||||
|
||||
chmod +x shared-ld-sh
|
||||
|
||||
SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o"
|
||||
SHARED_LD_MODULE_CXX="CXX=\"\$(CXX)\" $SHARED_LD_MODULE_CC"
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc 3.1 or later" >&5
|
||||
$as_echo_n "checking for gcc 3.1 or later... " >&6; }
|
||||
if ${bakefile_cv_gcc31+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#if (__GNUC__ < 3) || \
|
||||
((__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
|
||||
This is old gcc
|
||||
#endif
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
bakefile_cv_gcc31=yes
|
||||
|
||||
else
|
||||
|
||||
bakefile_cv_gcc31=no
|
||||
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_gcc31" >&5
|
||||
$as_echo "$bakefile_cv_gcc31" >&6; }
|
||||
if test "$bakefile_cv_gcc31" = "no"; then
|
||||
SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o"
|
||||
SHARED_LD_CXX="$SHARED_LD_CC"
|
||||
else
|
||||
SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o"
|
||||
SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o"
|
||||
fi
|
||||
SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o"
|
||||
SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o"
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
PIC_FLAG="-dynamic -fPIC"
|
||||
|
Reference in New Issue
Block a user