summaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-11-18 10:06:03 +0000
committerIain Sandoe <iain@sandoe.co.uk>2020-12-05 08:43:20 +0000
commit1352bc88a0525743c952197fb2db6e4f8c091cde (patch)
tree06207e8cc7971e67177cda013cacc9a764abfe3c /libcc1
parent3e2ae3ee285a57455d5a23bd352a68c289130186 (diff)
Darwin : Update libtool and dependencies for Darwin20 [PR97865]
The change in major version (and the increment from Darwin19 to 20) caused libtool tests to fail which resulted in incorrect build settings for shared libraries. We take this opportunity to sort out the shared undefined symbols state rather than propagating the current unsound behaviour into a new rev. This change means that we default to the case that missing symbols are considered an error, and if one wants to allow this intentionally, the confiuration for that case should be set appropriately. Three existing cases need undefined dynamic lookup: libitm, where there is already a configuration mechanism to add the flags. libcc1, where we add simple configuration to add the flags for Darwin. libsanitizer, where we can add to the existing extra flags. libcc1/ChangeLog: PR target/97865 * Makefile.am: Add dynamic_lookup to LD flags for Darwin. * configure.ac: Test for Darwin host and set a flag. * Makefile.in: Regenerate. * configure: Regenerate. libitm/ChangeLog: PR target/97865 * configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin. * configure: Regenerate. libsanitizer/ChangeLog: PR target/97865 * configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for Darwin. * configure: Regenerate. ChangeLog: PR target/97865 * libtool.m4: Update handling of Darwin platform link flags for Darwin20. gcc/ChangeLog: PR target/97865 * configure: Regenerate. libatomic/ChangeLog: PR target/97865 * configure: Regenerate. libbacktrace/ChangeLog: PR target/97865 * configure: Regenerate. libffi/ChangeLog: PR target/97865 * configure: Regenerate. libgfortran/ChangeLog: PR target/97865 * configure: Regenerate. libgomp/ChangeLog: PR target/97865 * configure: Regenerate. libhsail-rt/ChangeLog: PR target/97865 * configure: Regenerate. libobjc/ChangeLog: PR target/97865 * configure: Regenerate. libphobos/ChangeLog: PR target/97865 * configure: Regenerate. libquadmath/ChangeLog: PR target/97865 * configure: Regenerate. libssp/ChangeLog: PR target/97865 * configure: Regenerate. libstdc++-v3/ChangeLog: PR target/97865 * configure: Regenerate. libvtv/ChangeLog: PR target/97865 * configure: Regenerate. zlib/ChangeLog: PR target/97865 * configure: Regenerate.
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/Makefile.am3
-rw-r--r--libcc1/Makefile.in6
-rwxr-xr-xlibcc1/configure53
-rw-r--r--libcc1/configure.ac6
4 files changed, 51 insertions, 17 deletions
diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
index ab6f839ecae..173b84f9cdb 100644
--- a/libcc1/Makefile.am
+++ b/libcc1/Makefile.am
@@ -25,6 +25,9 @@ CPPFLAGS_FOR_C_FAMILY = -I $(srcdir)/../gcc/c-family \
CPPFLAGS_FOR_C = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/c
CPPFLAGS_FOR_CXX = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/cp
AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS)
+if DARWIN_DYNAMIC_LOOKUP
+AM_CXXFLAGS += -Wl,-undefined,dynamic_lookup
+endif
override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
# Can be simplified when libiberty becomes a normal convenience library.
diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
index 7d1cada1c09..753d435c9cb 100644
--- a/libcc1/Makefile.in
+++ b/libcc1/Makefile.in
@@ -89,10 +89,13 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+@DARWIN_DYNAMIC_LOOKUP_TRUE@am__append_1 = -Wl,-undefined,dynamic_lookup
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/cet.m4 \
$(top_srcdir)/../config/depstand.m4 \
+ $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/gcc-plugin.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/override.m4 \
@@ -383,7 +386,8 @@ CPPFLAGS_FOR_C_FAMILY = -I $(srcdir)/../gcc/c-family \
CPPFLAGS_FOR_C = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/c
CPPFLAGS_FOR_CXX = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/cp
-AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS)
+AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS) \
+ $(am__append_1)
# Can be simplified when libiberty becomes a normal convenience library.
libiberty_normal = ../libiberty/libiberty.a
libiberty_noasan = ../libiberty/noasan/libiberty.a
diff --git a/libcc1/configure b/libcc1/configure
index 4e2ca41c5bd..d3eedfec9b8 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -635,6 +635,8 @@ LTLIBOBJS
LIBOBJS
ENABLE_PLUGIN_FALSE
ENABLE_PLUGIN_TRUE
+DARWIN_DYNAMIC_LOOKUP_FALSE
+DARWIN_DYNAMIC_LOOKUP_TRUE
libsuffix
GMPINC
WERROR
@@ -7253,23 +7255,25 @@ _LT_EOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
+ # Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
+ # build without first building modern cctools / linker.
+ case $host_cpu-$host_os in
+ *-rhapsody* | *-darwin1.[012])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
+ *-darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ *-darwin*)
+ # darwin 5.x (macOS 10.1) onwards we only need to adjust when the
+ # deployment target is forced to an earlier version.
+ case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
+ UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
+ ;;
10.[012][,.]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ *)
+ ;;
+ esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
@@ -10783,7 +10787,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10786 "configure"
+#line 10790 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10889,7 +10893,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10892 "configure"
+#line 10896 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14970,6 +14974,19 @@ fi
$as_echo "$libcc1_cv_lib_sockets" >&6; }
LIBS="$LIBS $libcc1_cv_lib_sockets"
+case "$host" in
+ *-*-darwin*) darwin_dynamic_lookup=yes ;;
+ *) darwin_dynamic_lookup= ;;
+esac
+ if test $darwin_dynamic_lookup = yes; then
+ DARWIN_DYNAMIC_LOOKUP_TRUE=
+ DARWIN_DYNAMIC_LOOKUP_FALSE='#'
+else
+ DARWIN_DYNAMIC_LOOKUP_TRUE='#'
+ DARWIN_DYNAMIC_LOOKUP_FALSE=
+fi
+
+
# If any of these functions are missing, simply don't bother building
# this plugin.
# Check for plugin support
@@ -15338,6 +15355,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${DARWIN_DYNAMIC_LOOKUP_TRUE}" && test -z "${DARWIN_DYNAMIC_LOOKUP_FALSE}"; then
+ as_fn_error $? "conditional \"DARWIN_DYNAMIC_LOOKUP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ENABLE_PLUGIN_TRUE}" && test -z "${ENABLE_PLUGIN_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_PLUGIN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libcc1/configure.ac b/libcc1/configure.ac
index 8d3b8d14748..262e0a61e6f 100644
--- a/libcc1/configure.ac
+++ b/libcc1/configure.ac
@@ -104,6 +104,12 @@ AC_CACHE_CHECK([for socket libraries], libcc1_cv_lib_sockets,
])
LIBS="$LIBS $libcc1_cv_lib_sockets"
+case "$host" in
+ *-*-darwin*) darwin_dynamic_lookup=yes ;;
+ *) darwin_dynamic_lookup= ;;
+esac
+AM_CONDITIONAL(DARWIN_DYNAMIC_LOOKUP, test $darwin_dynamic_lookup = yes)
+
# If any of these functions are missing, simply don't bother building
# this plugin.
GCC_ENABLE_PLUGINS