@@ -5068,7 +5068,7 @@ else
5068
5068
fi
5069
5069
5070
5070
# When generating bitcode (for inlining) we always want to use -O2
5071
- # even when --enable-debug is specified. The bitcode it's not going to
5071
+ # even when --enable-debug is specified. The bitcode is not going to
5072
5072
# be used for line-by-line debugging, and JIT inlining doesn't work
5073
5073
# without at least -O1 (otherwise clang will emit 'noinline'
5074
5074
# attributes everywhere), which is bad for testing. Still allow the
@@ -5778,9 +5778,14 @@ if test x"$pgac_cv_prog_CC_cflags__ftree_vectorize" = x"yes"; then
5778
5778
fi
5779
5779
5780
5780
5781
- # We want to suppress clang's unhelpful unused-command-line-argument warnings
5782
- # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
5783
- # test for the positive form and if that works, add the negative form
5781
+ #
5782
+ # The following tests want to suppress various unhelpful warnings by adding
5783
+ # -Wno-foo switches. But gcc won't complain about unrecognized -Wno-foo
5784
+ # switches, so we have to test for the positive form and if that works,
5785
+ # add the negative form. Note that tests of this form typically need to
5786
+ # be duplicated in the BITCODE_CFLAGS setup stanza below.
5787
+ #
5788
+ # Suppress clang's unhelpful unused-command-line-argument warnings.
5784
5789
NOT_THE_CFLAGS=""
5785
5790
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
5786
5791
$as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
5825
5830
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
5826
5831
fi
5827
5832
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
5828
- # of warnings when building plperl because of Perl. Like previously, test
5829
- # for the positive form and add the negative form
5833
+ # of warnings when building plperl because of usages in the Perl headers.
5830
5834
NOT_THE_CFLAGS=""
5831
5835
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
5832
5836
$as_echo_n "checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
@@ -6425,9 +6429,12 @@ fi
6425
6429
6426
6430
6427
6431
6428
- # Determine flags used to emit bitcode for JIT inlining. Need to test
6429
- # for behaviour changing compiler flags, to keep compatibility with
6430
- # compiler used for normal postgres code.
6432
+ # Determine flags used to emit bitcode for JIT inlining.
6433
+ # 1. We must duplicate any behaviour-changing compiler flags used above,
6434
+ # to keep compatibility with the compiler used for normal Postgres code.
6435
+ # 2. We don't bother to duplicate extra-warnings switches --- seeing a
6436
+ # warning in the main build is enough.
6437
+ # 3. But we must duplicate -Wno-warning flags, else we'll see those anyway.
6431
6438
if test "$with_llvm" = yes ; then
6432
6439
CLANGXX="$CLANG -xc++"
6433
6440
@@ -6695,6 +6702,175 @@ if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes";
6695
6702
BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6696
6703
fi
6697
6704
6705
+
6706
+ NOT_THE_CFLAGS=""
6707
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
6708
+ $as_echo_n "checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
6709
+ if ${pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument+:} false; then :
6710
+ $as_echo_n "(cached) " >&6
6711
+ else
6712
+ pgac_save_CFLAGS=$CFLAGS
6713
+ pgac_save_CC=$CC
6714
+ CC=${CLANG}
6715
+ CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
6716
+ ac_save_c_werror_flag=$ac_c_werror_flag
6717
+ ac_c_werror_flag=yes
6718
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6719
+ /* end confdefs.h. */
6720
+
6721
+ int
6722
+ main ()
6723
+ {
6724
+
6725
+ ;
6726
+ return 0;
6727
+ }
6728
+ _ACEOF
6729
+ if ac_fn_c_try_compile "$LINENO"; then :
6730
+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=yes
6731
+ else
6732
+ pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=no
6733
+ fi
6734
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6735
+ ac_c_werror_flag=$ac_save_c_werror_flag
6736
+ CFLAGS="$pgac_save_CFLAGS"
6737
+ CC="$pgac_save_CC"
6738
+ fi
6739
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&5
6740
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&6; }
6741
+ if test x"$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" = x"yes"; then
6742
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
6743
+ fi
6744
+
6745
+ if test -n "$NOT_THE_CFLAGS"; then
6746
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-unused-command-line-argument"
6747
+ fi
6748
+ NOT_THE_CFLAGS=""
6749
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
6750
+ $as_echo_n "checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
6751
+ if ${pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro+:} false; then :
6752
+ $as_echo_n "(cached) " >&6
6753
+ else
6754
+ pgac_save_CFLAGS=$CFLAGS
6755
+ pgac_save_CC=$CC
6756
+ CC=${CLANG}
6757
+ CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6758
+ ac_save_c_werror_flag=$ac_c_werror_flag
6759
+ ac_c_werror_flag=yes
6760
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6761
+ /* end confdefs.h. */
6762
+
6763
+ int
6764
+ main ()
6765
+ {
6766
+
6767
+ ;
6768
+ return 0;
6769
+ }
6770
+ _ACEOF
6771
+ if ac_fn_c_try_compile "$LINENO"; then :
6772
+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=yes
6773
+ else
6774
+ pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=no
6775
+ fi
6776
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6777
+ ac_c_werror_flag=$ac_save_c_werror_flag
6778
+ CFLAGS="$pgac_save_CFLAGS"
6779
+ CC="$pgac_save_CC"
6780
+ fi
6781
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&5
6782
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&6; }
6783
+ if test x"$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" = x"yes"; then
6784
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6785
+ fi
6786
+
6787
+ if test -n "$NOT_THE_CFLAGS"; then
6788
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
6789
+ fi
6790
+ NOT_THE_CFLAGS=""
6791
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
6792
+ $as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
6793
+ if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :
6794
+ $as_echo_n "(cached) " >&6
6795
+ else
6796
+ pgac_save_CFLAGS=$CFLAGS
6797
+ pgac_save_CC=$CC
6798
+ CC=${CLANG}
6799
+ CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
6800
+ ac_save_c_werror_flag=$ac_c_werror_flag
6801
+ ac_c_werror_flag=yes
6802
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6803
+ /* end confdefs.h. */
6804
+
6805
+ int
6806
+ main ()
6807
+ {
6808
+
6809
+ ;
6810
+ return 0;
6811
+ }
6812
+ _ACEOF
6813
+ if ac_fn_c_try_compile "$LINENO"; then :
6814
+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=yes
6815
+ else
6816
+ pgac_cv_prog_CLANG_cflags__Wformat_truncation=no
6817
+ fi
6818
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6819
+ ac_c_werror_flag=$ac_save_c_werror_flag
6820
+ CFLAGS="$pgac_save_CFLAGS"
6821
+ CC="$pgac_save_CC"
6822
+ fi
6823
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&5
6824
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&6; }
6825
+ if test x"$pgac_cv_prog_CLANG_cflags__Wformat_truncation" = x"yes"; then
6826
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
6827
+ fi
6828
+
6829
+ if test -n "$NOT_THE_CFLAGS"; then
6830
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"
6831
+ fi
6832
+ NOT_THE_CFLAGS=""
6833
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
6834
+ $as_echo_n "checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
6835
+ if ${pgac_cv_prog_CLANG_cflags__Wstringop_truncation+:} false; then :
6836
+ $as_echo_n "(cached) " >&6
6837
+ else
6838
+ pgac_save_CFLAGS=$CFLAGS
6839
+ pgac_save_CC=$CC
6840
+ CC=${CLANG}
6841
+ CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
6842
+ ac_save_c_werror_flag=$ac_c_werror_flag
6843
+ ac_c_werror_flag=yes
6844
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6845
+ /* end confdefs.h. */
6846
+
6847
+ int
6848
+ main ()
6849
+ {
6850
+
6851
+ ;
6852
+ return 0;
6853
+ }
6854
+ _ACEOF
6855
+ if ac_fn_c_try_compile "$LINENO"; then :
6856
+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=yes
6857
+ else
6858
+ pgac_cv_prog_CLANG_cflags__Wstringop_truncation=no
6859
+ fi
6860
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6861
+ ac_c_werror_flag=$ac_save_c_werror_flag
6862
+ CFLAGS="$pgac_save_CFLAGS"
6863
+ CC="$pgac_save_CC"
6864
+ fi
6865
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&5
6866
+ $as_echo "$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&6; }
6867
+ if test x"$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" = x"yes"; then
6868
+ NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
6869
+ fi
6870
+
6871
+ if test -n "$NOT_THE_CFLAGS"; then
6872
+ BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-stringop-truncation"
6873
+ fi
6698
6874
fi
6699
6875
6700
6876
# supply -g if --enable-debug
0 commit comments