postgres/src/tools/pgindent/exclude_file_patterns
Thomas Munro 19bf81c06a Monkey-patch LLVM code to fix ARM relocation bug.
Supply a new memory manager for RuntimeDyld, to avoid crashes in
generated code caused by memory placement that can overflow a 32 bit
data type.  This is a drop-in replacement for the
llvm::SectionMemoryManager class in the LLVM library, with Michael
Smith's proposed fix from
https://www.github.com/llvm/llvm-project/pull/71968.

We hereby slurp it into our own source tree, after moving into a new
namespace llvm::backport and making some minor adjustments so that it
can be compiled with older LLVM versions as far back as 12.  It's harder
to make it work on even older LLVM versions, but it doesn't seem likely
that people are really using them so that is not investigated for now.

The problem could also be addressed by switching to JITLink instead of
RuntimeDyld, and that is the LLVM project's recommended solution as
the latter is about to be deprecated.  We'll have to do that soon enough
anyway, and then when the LLVM version support window advances far
enough in a few years we'll be able to delete this code.  Unfortunately
that wouldn't be enough for PostgreSQL today: in most relevant versions
of LLVM, JITLink is missing or incomplete.

Several other projects have already back-ported this fix into their fork
of LLVM, which is a vote of confidence despite the lack of commit into
LLVM as of today.  We don't have our own copy of LLVM so we can't do
exactly what they've done; instead we have a copy of the whole patched
class so we can pass an instance of it to RuntimeDyld.

The LLVM project hasn't chosen to commit the fix yet, and even if it
did, it wouldn't be back-ported into the releases of LLVM that most of
our users care about, so there is not much point in waiting any longer
for that.  If they make further changes and commit it to LLVM 19 or 20,
we'll still need this for older versions, but we may want to
resynchronize our copy and update some comments.

The changes that we've had to make to our copy can be seen by diffing
our SectionMemoryManager.{h,cpp} files against the ones in the tree of
the pull request.  Per the LLVM project's license requirements, a copy
is in SectionMemoryManager.LICENSE.

This should fix the spate of crash reports we've been receiving lately
from users on large memory ARM systems.

Back-patch to all supported releases.

Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Co-authored-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se> (license aspects)
Reported-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Discussion: https://postgr.es/m/CAO6_Xqr63qj%3DSx7HY6ZiiQ6R_JbX%2B-p6sTPwDYwTWZjUmjsYBg%40mail.gmail.com
2024-11-06 23:09:28 +13:00

51 lines
1.8 KiB
Plaintext

# List of filename patterns to exclude from pgindent runs
#
# These contain assembly code that pgindent tends to mess up.
src/include/storage/s_lock\.h$
src/include/port/atomics/
#
# These contains C++ constructs that confuse pgindent.
src/include/jit/llvmjit\.h$
src/include/jit/SectionMemoryManager\.h$
#
# This confuses pgindent, and it's a derived file anyway.
src/backend/utils/fmgrtab\.c$
#
# pgindent might mangle entries in this that match typedef names.
# Since it's a derived file anyway, just exclude it.
src/backend/utils/fmgrprotos\.h$
#
# kwlist_d files are made by gen_keywordlist.pl. While we could insist that
# they match pgindent style, they'd look worse not better, so exclude them.
kwlist_d\.h$
#
# These are generated by the scripts from src/common/unicode/. They use
# hash functions generated by PerfectHash.pm whose format looks worse with
# pgindent.
src/include/common/unicode_norm_hashfunc\.h$
src/include/common/unicode_normprops_table\.h$
#
# Exclude ecpg test files to avoid breaking the ecpg regression tests
# (but include files at the top level of the ecpg/test/ directory).
src/interfaces/ecpg/test/.*/
#
# src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/
# are excluded because those files are imported from an external project,
# rather than maintained locally, and they are machine-generated anyway.
/snowball/libstemmer/
#
# These files are machine-generated by code not under our control,
# so we shouldn't expect them to conform to our style.
# (Some versions of dtrace build probes.h files that confuse pgindent, too.)
src/backend/utils/probes\.h$
src/include/pg_config\.h$
src/pl/plperl/ppport\.h$
src/pl/plperl/SPI\.c$
src/pl/plperl/Util\.c$
#
# Exclude any temporary installations that may be in the tree.
/tmp_check/
/tmp_install/
# ... and for paranoia's sake, don't touch git stuff.
/\.git/