@@ -5251,7 +5251,7 @@ else
52515251fi
52525252
52535253# When generating bitcode (for inlining) we always want to use -O2
5254- # even when --enable-debug is specified. The bitcode it's not going to
5254+ # even when --enable-debug is specified. The bitcode is not going to
52555255# be used for line-by-line debugging, and JIT inlining doesn't work
52565256# without at least -O1 (otherwise clang will emit 'noinline'
52575257# attributes everywhere), which is bad for testing. Still allow the
@@ -6288,9 +6288,14 @@ if test x"$pgac_cv_prog_CC_cflags__ftree_vectorize" = x"yes"; then
62886288fi
62896289
62906290
6291- # We want to suppress clang's unhelpful unused-command-line-argument warnings
6292- # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
6293- # test for the positive form and if that works, add the negative form
6291+ #
6292+ # The following tests want to suppress various unhelpful warnings by adding
6293+ # -Wno-foo switches. But gcc won't complain about unrecognized -Wno-foo
6294+ # switches, so we have to test for the positive form and if that works,
6295+ # add the negative form. Note that tests of this form typically need to
6296+ # be duplicated in the BITCODE_CFLAGS setup stanza below.
6297+ #
6298+ # Suppress clang's unhelpful unused-command-line-argument warnings.
62946299 NOT_THE_CFLAGS=""
62956300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
62966301$as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
63356340 CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
63366341 fi
63376342 # Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
6338- # of warnings when building plperl because of Perl. Like previously, test
6339- # for the positive form and add the negative form
6343+ # of warnings when building plperl because of usages in the Perl headers.
63406344 NOT_THE_CFLAGS=""
63416345 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
63426346$as_echo_n "checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
@@ -6936,9 +6940,12 @@ fi
69366940
69376941
69386942
6939- # Determine flags used to emit bitcode for JIT inlining. Need to test
6940- # for behaviour changing compiler flags, to keep compatibility with
6941- # compiler used for normal postgres code.
6943+ # Determine flags used to emit bitcode for JIT inlining.
6944+ # 1. We must duplicate any behaviour-changing compiler flags used above,
6945+ # to keep compatibility with the compiler used for normal Postgres code.
6946+ # 2. We don't bother to duplicate extra-warnings switches --- seeing a
6947+ # warning in the main build is enough.
6948+ # 3. But we must duplicate -Wno-warning flags, else we'll see those anyway.
69426949if test "$with_llvm" = yes ; then
69436950 CLANGXX="$CLANG -xc++"
69446951
@@ -7206,6 +7213,175 @@ if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes";
72067213 BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
72077214fi
72087215
7216+
7217+ NOT_THE_CFLAGS=""
7218+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
7219+ $as_echo_n "checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
7220+ if ${pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument+:} false; then :
7221+ $as_echo_n "(cached) " >&6
7222+ else
7223+ pgac_save_CFLAGS=$CFLAGS
7224+ pgac_save_CC=$CC
7225+ CC=${CLANG}
7226+ CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
7227+ ac_save_c_werror_flag=$ac_c_werror_flag
7228+ ac_c_werror_flag=yes
7229+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7230+ /* end confdefs.h. */
7231+
7232+ int
7233+ main ()
7234+ {
7235+
7236+ ;
7237+ return 0;
7238+ }
7239+ _ACEOF
7240+ if ac_fn_c_try_compile "$LINENO"; then :
7241+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=yes
7242+ else
7243+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=no
7244+ fi
7245+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7246+ ac_c_werror_flag=$ac_save_c_werror_flag
7247+ CFLAGS="$pgac_save_CFLAGS"
7248+ CC="$pgac_save_CC"
7249+ fi
7250+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&5
7251+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&6; }
7252+ if test x"$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" = x"yes"; then
7253+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
7254+ fi
7255+
7256+ if test -n "$NOT_THE_CFLAGS"; then
7257+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-unused-command-line-argument"
7258+ fi
7259+ NOT_THE_CFLAGS=""
7260+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
7261+ $as_echo_n "checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
7262+ if ${pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro+:} false; then :
7263+ $as_echo_n "(cached) " >&6
7264+ else
7265+ pgac_save_CFLAGS=$CFLAGS
7266+ pgac_save_CC=$CC
7267+ CC=${CLANG}
7268+ CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
7269+ ac_save_c_werror_flag=$ac_c_werror_flag
7270+ ac_c_werror_flag=yes
7271+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7272+ /* end confdefs.h. */
7273+
7274+ int
7275+ main ()
7276+ {
7277+
7278+ ;
7279+ return 0;
7280+ }
7281+ _ACEOF
7282+ if ac_fn_c_try_compile "$LINENO"; then :
7283+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=yes
7284+ else
7285+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=no
7286+ fi
7287+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7288+ ac_c_werror_flag=$ac_save_c_werror_flag
7289+ CFLAGS="$pgac_save_CFLAGS"
7290+ CC="$pgac_save_CC"
7291+ fi
7292+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&5
7293+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&6; }
7294+ if test x"$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" = x"yes"; then
7295+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
7296+ fi
7297+
7298+ if test -n "$NOT_THE_CFLAGS"; then
7299+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
7300+ fi
7301+ NOT_THE_CFLAGS=""
7302+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
7303+ $as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
7304+ if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :
7305+ $as_echo_n "(cached) " >&6
7306+ else
7307+ pgac_save_CFLAGS=$CFLAGS
7308+ pgac_save_CC=$CC
7309+ CC=${CLANG}
7310+ CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
7311+ ac_save_c_werror_flag=$ac_c_werror_flag
7312+ ac_c_werror_flag=yes
7313+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7314+ /* end confdefs.h. */
7315+
7316+ int
7317+ main ()
7318+ {
7319+
7320+ ;
7321+ return 0;
7322+ }
7323+ _ACEOF
7324+ if ac_fn_c_try_compile "$LINENO"; then :
7325+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=yes
7326+ else
7327+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=no
7328+ fi
7329+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7330+ ac_c_werror_flag=$ac_save_c_werror_flag
7331+ CFLAGS="$pgac_save_CFLAGS"
7332+ CC="$pgac_save_CC"
7333+ fi
7334+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&5
7335+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&6; }
7336+ if test x"$pgac_cv_prog_CLANG_cflags__Wformat_truncation" = x"yes"; then
7337+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
7338+ fi
7339+
7340+ if test -n "$NOT_THE_CFLAGS"; then
7341+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"
7342+ fi
7343+ NOT_THE_CFLAGS=""
7344+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
7345+ $as_echo_n "checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
7346+ if ${pgac_cv_prog_CLANG_cflags__Wstringop_truncation+:} false; then :
7347+ $as_echo_n "(cached) " >&6
7348+ else
7349+ pgac_save_CFLAGS=$CFLAGS
7350+ pgac_save_CC=$CC
7351+ CC=${CLANG}
7352+ CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
7353+ ac_save_c_werror_flag=$ac_c_werror_flag
7354+ ac_c_werror_flag=yes
7355+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7356+ /* end confdefs.h. */
7357+
7358+ int
7359+ main ()
7360+ {
7361+
7362+ ;
7363+ return 0;
7364+ }
7365+ _ACEOF
7366+ if ac_fn_c_try_compile "$LINENO"; then :
7367+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=yes
7368+ else
7369+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=no
7370+ fi
7371+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7372+ ac_c_werror_flag=$ac_save_c_werror_flag
7373+ CFLAGS="$pgac_save_CFLAGS"
7374+ CC="$pgac_save_CC"
7375+ fi
7376+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&5
7377+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&6; }
7378+ if test x"$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" = x"yes"; then
7379+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
7380+ fi
7381+
7382+ if test -n "$NOT_THE_CFLAGS"; then
7383+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-stringop-truncation"
7384+ fi
72097385fi
72107386
72117387# supply -g if --enable-debug
0 commit comments