Commit 14fb9d3d authored by Alex Smith's avatar Alex Smith Committed by Derek Buitenhuis

configure: Separate commonalities in msvc and icl flags

Allows for easier handling of flags that may be specific to icl or msvc.
Furthermore, simplify the handling of warnings and remarks thanks to
icl's support of -Wall on Windows.
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 0b0953ba
...@@ -2340,16 +2340,17 @@ ccc_flags(){ ...@@ -2340,16 +2340,17 @@ ccc_flags(){
done done
} }
msvc_flags(){ msvc_common_flags(){
for flag; do for flag; do
case $flag in case $flag in
# In addition to specifying certain flags under the compiler
# specific filters, they must be specified here as well or else the
# generic catch all at the bottom will print the original flag.
-Wall) ;;
-std=c99) ;;
# Common flags
-fomit-frame-pointer) echo -Oy ;; -fomit-frame-pointer) echo -Oy ;;
-g) echo -Z7 ;; -g) echo -Z7 ;;
-Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
-wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
-wd4996 -wd4273 ;;
-std=c99) ;;
-fno-math-errno) ;; -fno-math-errno) ;;
-fno-common) ;; -fno-common) ;;
-fno-signed-zeros) ;; -fno-signed-zeros) ;;
...@@ -2365,6 +2366,30 @@ msvc_flags(){ ...@@ -2365,6 +2366,30 @@ msvc_flags(){
done done
} }
msvc_flags(){
msvc_common_flags "$@"
for flag; do
case $flag in
-Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
-wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
-wd4996 -wd4273 ;;
esac
done
}
icl_flags(){
msvc_common_flags "$@"
for flag; do
case $flag in
# Despite what Intel's documentation says -Wall, which is supported
# on Windows, does enable remarks so disable them here.
-Wall) echo $flag -Qdiag-disable:remark ;;
-std=c99) echo -Qstd=c99 ;;
esac
done
}
pgi_flags(){ pgi_flags(){
for flag; do for flag; do
case $flag in case $flag in
...@@ -2590,13 +2615,13 @@ probe_cc(){ ...@@ -2590,13 +2615,13 @@ probe_cc(){
fi fi
_cc_o='-Fo $@' _cc_o='-Fo $@'
_cc_e='-P' _cc_e='-P'
_flags_filter=msvc_flags _flags_filter=icl_flags
_ld_lib='lib%.a' _ld_lib='lib%.a'
_ld_path='-libpath:' _ld_path='-libpath:'
# -Qdiag-error to make icl error when presented with certain unknown arguments # -Qdiag-error to make icl error when presented with certain unknown arguments
_flags='-nologo -Qdiag-error:10157 -Qdiag-error:4044' _flags='-nologo -Qdiag-error:10157 -Qdiag-error:4044'
# -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency with msvc which enables it by default # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency with msvc which enables it by default
_cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -Qstd=c99 -Qms0 -Qvec- -Qsimd- -GS' _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
if [ $pfx = hostcc ]; then if [ $pfx = hostcc ]; then
append _cflags -Dsnprintf=_snprintf append _cflags -Dsnprintf=_snprintf
fi fi
...@@ -3916,7 +3941,6 @@ elif enabled msvc; then ...@@ -3916,7 +3941,6 @@ elif enabled msvc; then
enabled x86_32 && disable aligned_stack enabled x86_32 && disable aligned_stack
elif enabled icl; then elif enabled icl; then
enabled x86_32 && disable aligned_stack enabled x86_32 && disable aligned_stack
check_cflags -W1 # Just warnings, no remark spam
# basically -fstrict-aliasing for icl that doesn't work (correctly) on 13.x+ # basically -fstrict-aliasing for icl that doesn't work (correctly) on 13.x+
check_cpp_condition "windows.h" "__ICL < 1300" && add_cflags -Qansi-alias check_cpp_condition "windows.h" "__ICL < 1300" && add_cflags -Qansi-alias
# icl will pass the inline asm tests but inline asm is currently not supported (build will fail) # icl will pass the inline asm tests but inline asm is currently not supported (build will fail)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment