In order to allow user to override cflags, predefined flags must be inserted before user cflags.
Signed-off-by: Tristan Gingold <ging...@adacore.com> --- configure | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 598e8e1..f18ed0d 100755 --- a/configure +++ b/configure @@ -939,8 +939,10 @@ cat > $TMPC << EOF int main(void) { return 0; } EOF for flag in $gcc_flags; do - if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then - QEMU_CFLAGS="$QEMU_CFLAGS $flag" + if compile_prog "-Werror $flag $QEMU_CFLAGS" "" ; then + # Note: flag must be prepended so that they could be overriden by + # user flags (such as -fno-stack-protector) + QEMU_CFLAGS="$flag $QEMU_CFLAGS" fi done -- 1.7.3.GIT