mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Fix namespace cleanliness checks with GCC on Windows.
On Windows, object files created by GCC contain reference pointer symbols
beginning with ".refptr.". Ignore these symbols when doing namespace
cleanliness checks. They are an implementation detail. If there is
an issue with namespace cleanliness, then we can detect and report it for
the original symbol for which the reference point was generated.
configure.ac:
Detect whether this platform is one that generates reference pointers
in object code.
Mmake.common.in:
On platforms that have reference pointers, ignore all symbols beginning
with ".refptr." when doing namespace cleanliness checks.
This commit is contained in:
@@ -479,6 +479,15 @@ else
|
||||
MSVC_OBJ_PREFIX_EXPRS =
|
||||
endif
|
||||
|
||||
# Ignore reference pointer symbols created by GCC on Windows.
|
||||
# (See definition of HAVE_REFPTR_SYMS in configure.ac for details.)
|
||||
ifeq ("@HAVE_REFPTR_SYMS@","yes")
|
||||
GCC_WIN_OBJ_PREFIX_EXPRS = \
|
||||
-e '^\.refptr\.'
|
||||
else
|
||||
GCC_WIN_OBJ_PREFIX_EXPRS =
|
||||
endif
|
||||
|
||||
MACRO_PREFIX_EXPRS = \
|
||||
$(GEN_MACRO_PREFIX_EXPRS) \
|
||||
$(LIB_MACRO_PREFIX_EXPRS) \
|
||||
@@ -491,7 +500,8 @@ OBJ_PREFIX_EXPRS = \
|
||||
$(BROWSER_OBJ_PREFIX_EXPRS) \
|
||||
$(MDBCOMP_OBJ_PREFIX_EXPRS) \
|
||||
$(SSDB_OBJ_PREFIX_EXPRS) \
|
||||
$(MSVC_OBJ_PREFIX_EXPRS)
|
||||
$(MSVC_OBJ_PREFIX_EXPRS) \
|
||||
$(GCC_WIN_OBJ_PREFIX_EXPRS)
|
||||
|
||||
HEADER_CLEAN_FILTER = \
|
||||
grep -v $(MACRO_PREFIX_EXPRS) | \
|
||||
|
||||
21
configure.ac
21
configure.ac
@@ -3236,6 +3236,27 @@ AC_SUBST([SYMPREFIX])
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
# On Windows, GCC generates reference pointers in the object code that it
|
||||
# creates. These are intended to workaround limitations in the PE/COFF format.
|
||||
# Reference pointer symbol names begin with the prefix ".refptr.".
|
||||
# We ignore such symbols when doing namespace cleanliness checks since they
|
||||
# are an implementation detail and if there is a cleanliness issue we will
|
||||
# report it for the original symbol anyway.
|
||||
|
||||
HAVE_REFPTR_SYMS=
|
||||
|
||||
case "$host" in
|
||||
*mingw*|*cygwin*)
|
||||
case "$C_COMPILER_TYPE)" in
|
||||
gcc*) HAVE_REFPTR_SYMS=yes ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST([HAVE_REFPTR_SYMS])
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
#
|
||||
# Figure out which is the best grade to use for various different purposes.
|
||||
# In particular, choose the default grade for compiling applications.
|
||||
|
||||
Reference in New Issue
Block a user