@@ -5229,7 +5229,7 @@ else
5229
5229
fi
5230
5230
5231
5231
# When generating bitcode (for inlining) we always want to use -O2
5232
- # even when --enable-debug is specified. The bitcodeit's not going to
5232
+ # even when --enable-debug is specified. The bitcodeis not going to
5233
5233
# be used for line-by-line debugging, and JIT inlining doesn't work
5234
5234
# without at least -O1 (otherwise clang will emit 'noinline'
5235
5235
# attributes everywhere), which is bad for testing. Still allow the
@@ -5988,9 +5988,14 @@ if test x"$pgac_cv_prog_CC_cflags__ftree_vectorize" = x"yes"; then
5988
5988
fi
5989
5989
5990
5990
5991
- # We want to suppress clang's unhelpful unused-command-line-argument warnings
5992
- # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
5993
- # test for the positive form and if that works, add the negative form
5991
+ #
5992
+ # The following tests want to suppress various unhelpful warnings by adding
5993
+ # -Wno-foo switches. But gcc won't complain about unrecognized -Wno-foo
5994
+ # switches, so we have to test for the positive form and if that works,
5995
+ # add the negative form. Note that tests of this form typically need to
5996
+ # be duplicated in the BITCODE_CFLAGS setup stanza below.
5997
+ #
5998
+ # Suppress clang's unhelpful unused-command-line-argument warnings.
5994
5999
NOT_THE_CFLAGS=""
5995
6000
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
5996
6001
$as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
6035
6040
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
6036
6041
fi
6037
6042
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
6038
- # of warnings when building plperl because of Perl. Like previously, test
6039
- # for the positive form and add the negative form
6043
+ # of warnings when building plperl because of usages in the Perl headers.
6040
6044
NOT_THE_CFLAGS=""
6041
6045
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
6042
6046
$as_echo_n "checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
@@ -6635,9 +6639,12 @@ fi
6635
6639
6636
6640
6637
6641
6638
- # Determine flags used to emit bitcode for JIT inlining. Need to test
6639
- # for behaviour changing compiler flags, to keep compatibility with
6640
- # compiler used for normal postgres code.
6642
+ # Determine flags used to emit bitcode for JIT inlining.
6643
+ # 1. We must duplicate any behaviour-changing compiler flags used above,
6644
+ # to keep compatibility with the compiler used for normal Postgres code.
6645
+ # 2. We don't bother to duplicate extra-warnings switches --- seeing a
6646
+ # warning in the main build is enough.
6647
+ # 3. But we must duplicate -Wno-warning flags, else we'll see those anyway.
6641
6648
if test "$with_llvm" = yes ; then
6642
6649
CLANGXX="$CLANG -xc++"
6643
6650
@@ -6905,6 +6912,175 @@ if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes";
6905
6912
BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6906
6913
fi
6907
6914
6915
+
6916
+ NOT_THE_CFLAGS=""
6917
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
6918
+ $as_echo_n "checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
6919
+ if ${pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument+:} false; then :
6920
+ $as_echo_n "(cached) " >&6
6921
+ else
6922
+ pgac_save_CFLAGS=$CFLAGS
6923
+ pgac_save_CC=$CC
6924
+ CC=${CLANG}
6925
+ CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
6926
+ ac_save_c_werror_flag=$ac_c_werror_flag
6927
+ ac_c_werror_flag=yes
6928
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6929
+ /* end confdefs.h. */
6930
+
6931
+ int
6932
+ main ()
6933
+ {
6934
+
6935
+ ;
6936
+ return 0;
6937
+ }
6938
+ _ACEOF
6939
+ if ac_fn_c_try_compile "$LINENO"; then :
6940
+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=yes
6941
+ else
6942
+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=no
6943
+ fi
6944
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6945
+ ac_c_werror_flag=$ac_save_c_werror_flag
6946
+ CFLAGS="$pgac_save_CFLAGS"
6947
+ CC="$pgac_save_CC"
6948
+ fi
6949
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&5
6950
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&6; }
6951
+ if test x"$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" = x"yes"; then
6952
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
6953
+ fi
6954
+
6955
+ if test -n "$NOT_THE_CFLAGS"; then
6956
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-unused-command-line-argument"
6957
+ fi
6958
+ NOT_THE_CFLAGS=""
6959
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
6960
+ $as_echo_n "checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
6961
+ if ${pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro+:} false; then :
6962
+ $as_echo_n "(cached) " >&6
6963
+ else
6964
+ pgac_save_CFLAGS=$CFLAGS
6965
+ pgac_save_CC=$CC
6966
+ CC=${CLANG}
6967
+ CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6968
+ ac_save_c_werror_flag=$ac_c_werror_flag
6969
+ ac_c_werror_flag=yes
6970
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6971
+ /* end confdefs.h. */
6972
+
6973
+ int
6974
+ main ()
6975
+ {
6976
+
6977
+ ;
6978
+ return 0;
6979
+ }
6980
+ _ACEOF
6981
+ if ac_fn_c_try_compile "$LINENO"; then :
6982
+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=yes
6983
+ else
6984
+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=no
6985
+ fi
6986
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6987
+ ac_c_werror_flag=$ac_save_c_werror_flag
6988
+ CFLAGS="$pgac_save_CFLAGS"
6989
+ CC="$pgac_save_CC"
6990
+ fi
6991
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&5
6992
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&6; }
6993
+ if test x"$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" = x"yes"; then
6994
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6995
+ fi
6996
+
6997
+ if test -n "$NOT_THE_CFLAGS"; then
6998
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
6999
+ fi
7000
+ NOT_THE_CFLAGS=""
7001
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
7002
+ $as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
7003
+ if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :
7004
+ $as_echo_n "(cached) " >&6
7005
+ else
7006
+ pgac_save_CFLAGS=$CFLAGS
7007
+ pgac_save_CC=$CC
7008
+ CC=${CLANG}
7009
+ CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
7010
+ ac_save_c_werror_flag=$ac_c_werror_flag
7011
+ ac_c_werror_flag=yes
7012
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7013
+ /* end confdefs.h. */
7014
+
7015
+ int
7016
+ main ()
7017
+ {
7018
+
7019
+ ;
7020
+ return 0;
7021
+ }
7022
+ _ACEOF
7023
+ if ac_fn_c_try_compile "$LINENO"; then :
7024
+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=yes
7025
+ else
7026
+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=no
7027
+ fi
7028
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7029
+ ac_c_werror_flag=$ac_save_c_werror_flag
7030
+ CFLAGS="$pgac_save_CFLAGS"
7031
+ CC="$pgac_save_CC"
7032
+ fi
7033
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&5
7034
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&6; }
7035
+ if test x"$pgac_cv_prog_CLANG_cflags__Wformat_truncation" = x"yes"; then
7036
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
7037
+ fi
7038
+
7039
+ if test -n "$NOT_THE_CFLAGS"; then
7040
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"
7041
+ fi
7042
+ NOT_THE_CFLAGS=""
7043
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
7044
+ $as_echo_n "checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
7045
+ if ${pgac_cv_prog_CLANG_cflags__Wstringop_truncation+:} false; then :
7046
+ $as_echo_n "(cached) " >&6
7047
+ else
7048
+ pgac_save_CFLAGS=$CFLAGS
7049
+ pgac_save_CC=$CC
7050
+ CC=${CLANG}
7051
+ CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
7052
+ ac_save_c_werror_flag=$ac_c_werror_flag
7053
+ ac_c_werror_flag=yes
7054
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7055
+ /* end confdefs.h. */
7056
+
7057
+ int
7058
+ main ()
7059
+ {
7060
+
7061
+ ;
7062
+ return 0;
7063
+ }
7064
+ _ACEOF
7065
+ if ac_fn_c_try_compile "$LINENO"; then :
7066
+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=yes
7067
+ else
7068
+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=no
7069
+ fi
7070
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7071
+ ac_c_werror_flag=$ac_save_c_werror_flag
7072
+ CFLAGS="$pgac_save_CFLAGS"
7073
+ CC="$pgac_save_CC"
7074
+ fi
7075
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&5
7076
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&6; }
7077
+ if test x"$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" = x"yes"; then
7078
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
7079
+ fi
7080
+
7081
+ if test -n "$NOT_THE_CFLAGS"; then
7082
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-stringop-truncation"
7083
+ fi
6908
7084
fi
6909
7085
6910
7086
# supply -g if --enable-debug