diff mbox series

[PATCH-for-5.1,1/2] configure: do not clobber CFLAGS with --enable-fuzzing

Message ID 20200708200104.21978-2-alxndr@bu.edu
State New
Headers show
Series fuzz: broken build fixes | expand

Commit Message

Alexander Bulekov July 8, 2020, 8:01 p.m. UTC
When configuring with --enable-fuzzing, we overwrote the CFLAGS
added by all the preceding checks. Instead of overwriting CFLAGS, append
the ones we need.

Fixes: adc28027ff ("fuzz: add configure flag --enable-fuzzing")
Reported-by: Li Qiang <liq3ea@163.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Li Qiang July 8, 2020, 11:49 p.m. UTC | #1
Alexander Bulekov <alxndr@bu.edu> 于2020年7月9日周四 上午4:02写道:
>
> When configuring with --enable-fuzzing, we overwrote the CFLAGS
> added by all the preceding checks. Instead of overwriting CFLAGS, append
> the ones we need.
>
> Fixes: adc28027ff ("fuzz: add configure flag --enable-fuzzing")
> Reported-by: Li Qiang <liq3ea@163.com>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>


Tested-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index ee6c3c6792..078ebaa9f3 100755
> --- a/configure
> +++ b/configure
> @@ -7898,7 +7898,7 @@ if test "$fuzzing" = "yes" ; then
>    if test "$have_fuzzer" = "yes"; then
>      FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
>      FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
> -    CFLAGS=" -fsanitize=address,fuzzer-no-link"
> +    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
>    else
>      error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
>      exit 1
> --
> 2.26.2
>
>
Philippe Mathieu-Daudé July 9, 2020, 5:01 a.m. UTC | #2
On 7/8/20 10:01 PM, Alexander Bulekov wrote:
> When configuring with --enable-fuzzing, we overwrote the CFLAGS
> added by all the preceding checks. Instead of overwriting CFLAGS, append
> the ones we need.
> 
> Fixes: adc28027ff ("fuzz: add configure flag --enable-fuzzing")
> Reported-by: Li Qiang <liq3ea@163.com>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index ee6c3c6792..078ebaa9f3 100755
> --- a/configure
> +++ b/configure
> @@ -7898,7 +7898,7 @@ if test "$fuzzing" = "yes" ; then
>    if test "$have_fuzzer" = "yes"; then
>      FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
>      FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
> -    CFLAGS=" -fsanitize=address,fuzzer-no-link"
> +    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
>    else
>      error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
>      exit 1
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/configure b/configure
index ee6c3c6792..078ebaa9f3 100755
--- a/configure
+++ b/configure
@@ -7898,7 +7898,7 @@  if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
     FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
-    CFLAGS=" -fsanitize=address,fuzzer-no-link"
+    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
   else
     error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
     exit 1