aboutsummaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
commitafae4a55ccaa0de95ea11e5f634084db6ab2f444 (patch)
treed632cc867d10410ba9fb750523be790b86846ac4 /libcc1
parent9d9a82ec8478ff52c7a9d61f58cd2a7b6295b5f9 (diff)
parentd2eb616a0f7bea78164912aa438c29fe1ef5774a (diff)
downloadgcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.zip
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.gz
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.bz2
Merge branch 'master' into devel/coarray_native
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/ChangeLog37
-rw-r--r--libcc1/Makefile.am3
-rw-r--r--libcc1/Makefile.in6
-rwxr-xr-xlibcc1/configure61
-rw-r--r--libcc1/configure.ac6
-rw-r--r--libcc1/libcc1plugin.cc2
-rw-r--r--libcc1/libcp1plugin.cc6
7 files changed, 96 insertions, 25 deletions
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog
index 804941e..b94dce9 100644
--- a/libcc1/ChangeLog
+++ b/libcc1/ChangeLog
@@ -1,3 +1,40 @@
+2020-12-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/98380
+ * configure.ac: Set darwin_dynamic_lookup=no instead to empty
+ string.
+ * configure: Regenerated.
+
+2020-12-05 Iain Sandoe <iain@sandoe.co.uk>
+
+ 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.
+
+2020-11-29 John David Anglin <danglin@gcc.gnu.org>
+
+ * configure: Regenerate.
+
+2020-11-11 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/88115
+ * libcp1plugin.cc (plugin_build_unary_expr): Pass true to
+ cxx_sizeof_or_alignof_expr.
+
+2020-11-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/97518
+ * libcp1plugin.cc (plugin_add_static_assert): Pass false to
+ finish_static_assert.
+
+2020-11-06 Nathan Sidwell <nathan@acm.org>
+
+ * libcc1plugin.cc (address_rewriter): Rename
+ DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
+ * libcp1plugin.cc (supplement_binding): Likewise.
+
2020-10-14 Nathan Sidwell <nathan@acm.org>
* libcp1plugin.cc (plugin_add_friend): Set DECL_UNIQUE_FRIEND_P.
diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
index ab6f839..173b84f 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 7d1cada..753d435 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 3610219..ac0f031 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
@@ -9067,7 +9071,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
@@ -9079,7 +9083,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
else
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
@@ -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
@@ -12317,7 +12321,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
aCC*)
case $host_cpu in
hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -12341,7 +12345,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
if test $with_gnu_ld = no; then
case $host_cpu in
hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
@@ -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=no ;;
+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 8d3b8d1..648bcba 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=no ;;
+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
diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 8351f2e..241a815 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -300,7 +300,7 @@ address_rewriter (tree *in, int *walk_subtrees, void *arg)
decl_addr_value *found_value = ctx->address_map.find (&value);
if (found_value != NULL)
;
- else if (DECL_IS_BUILTIN (*in))
+ else if (DECL_IS_UNDECLARED_BUILTIN (*in))
{
gcc_address address;
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index d758df8..6483683 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -353,7 +353,7 @@ supplement_binding (cxx_binding *binding, tree decl)
/* If TARGET_BVAL is anticipated but has not yet been
declared, pretend it is not there at all. */
|| (TREE_CODE (target_bval) == FUNCTION_DECL
- && DECL_UNDECLARED_BUILTIN_P (target_bval)))
+ && DECL_IS_UNDECLARED_BUILTIN (target_bval)))
binding->value = decl;
else if (TREE_CODE (target_bval) == TYPE_DECL
&& DECL_ARTIFICIAL (target_bval)
@@ -2806,7 +2806,7 @@ plugin_build_unary_expr (cc1_plugin::connection *self,
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
result = cxx_sizeof_or_alignof_expr (input_location,
- op0, opcode, true);
+ op0, opcode, true, true);
break;
case DELETE_EXPR:
@@ -3642,7 +3642,7 @@ plugin_add_static_assert (cc1_plugin::connection *self,
bool member_p = at_class_scope_p ();
- finish_static_assert (condition, message, loc, member_p);
+ finish_static_assert (condition, message, loc, member_p, false);
return 1;
}