FIX: sysutils/xxhash on !clang archs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FIX: sysutils/xxhash on !clang archs

Brian Callahan-5
Hi ports --

gcc-4.2.1 doesn't understand the -Wvla flag. As a result, the
sysutils/xxhash build fails.
Remove the flag, it builds.

Noticed in the latest powerpc build logs. Tested on amd64 and macppc,
fine on both.

Alternative, we could set
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c
in the port Makefile.

OK for either approach?

~Brian


xxhash-gcc421.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FIX: sysutils/xxhash on !clang archs

Björn Ketelaars
On Thu 25/07/2019 19:33, Brian Callahan wrote:

> Hi ports --
>
> gcc-4.2.1 doesn't understand the -Wvla flag. As a result, the
> sysutils/xxhash build fails.
> Remove the flag, it builds.
>
> Noticed in the latest powerpc build logs. Tested on amd64 and macppc, fine
> on both.
>
> Alternative, we could set
> COMPILER = base-clang ports-gcc
> COMPILER_LANGS = c
> in the port Makefile.
>
> OK for either approach?

audio/libsndfile does the same things: it patches out the -Wvla flag.
The compiled files do not change (checked with cmp(1)), so no need to
bump REVISION.

One small nit: maybe add a comment why the flag is removed. Something
like below.

OK bket@


diff --git patches/patch-Makefile patches/patch-Makefile
index 2d793441209..f1b3c577ebe 100644
--- patches/patch-Makefile
+++ patches/patch-Makefile
@@ -1,10 +1,20 @@
 $OpenBSD: patch-Makefile,v 1.1.1.1 2019/07/11 16:28:13 bket Exp $
 
+Some compilers don't have -Wvla.
 Don't create symbolic links pointing to the shared lib.
 
 Index: Makefile
 --- Makefile.orig
 +++ Makefile
+@@ -37,7 +37,7 @@ CFLAGS ?= -O3
+ DEBUGFLAGS+=-Wall -Wextra -Wconversion -Wcast-qual -Wcast-align -Wshadow \
+             -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+             -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
+-            -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
++            -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+             -Wredundant-decls -Wstrict-overflow=5
+ CFLAGS += $(DEBUGFLAGS)
+ FLAGS   = $(CFLAGS) $(CPPFLAGS) $(MOREFLAGS)
 @@ -293,8 +293,6 @@ install: lib xxhsum
  @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
  @$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)

Reply | Threaded
Open this post in threaded view
|

Re: FIX: sysutils/xxhash on !clang archs

Brian Callahan-5


On 7/26/19 1:02 AM, Björn Ketelaars wrote:

> On Thu 25/07/2019 19:33, Brian Callahan wrote:
>> Hi ports --
>>
>> gcc-4.2.1 doesn't understand the -Wvla flag. As a result, the
>> sysutils/xxhash build fails.
>> Remove the flag, it builds.
>>
>> Noticed in the latest powerpc build logs. Tested on amd64 and macppc, fine
>> on both.
>>
>> Alternative, we could set
>> COMPILER = base-clang ports-gcc
>> COMPILER_LANGS = c
>> in the port Makefile.
>>
>> OK for either approach?
> audio/libsndfile does the same things: it patches out the -Wvla flag.
> The compiled files do not change (checked with cmp(1)), so no need to
> bump REVISION.
>
> One small nit: maybe add a comment why the flag is removed. Something
> like below.

Committed with the comment "Remove -Wvla flag; gcc-4.2.1 and earlier
don't understand it."

Thanks!

~Brian

> OK bket@
>
>
> diff --git patches/patch-Makefile patches/patch-Makefile
> index 2d793441209..f1b3c577ebe 100644
> --- patches/patch-Makefile
> +++ patches/patch-Makefile
> @@ -1,10 +1,20 @@
>   $OpenBSD: patch-Makefile,v 1.1.1.1 2019/07/11 16:28:13 bket Exp $
>  
> +Some compilers don't have -Wvla.
>   Don't create symbolic links pointing to the shared lib.
>  
>   Index: Makefile
>   --- Makefile.orig
>   +++ Makefile
> +@@ -37,7 +37,7 @@ CFLAGS ?= -O3
> + DEBUGFLAGS+=-Wall -Wextra -Wconversion -Wcast-qual -Wcast-align -Wshadow \
> +             -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
> +             -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
> +-            -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
> ++            -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
> +             -Wredundant-decls -Wstrict-overflow=5
> + CFLAGS += $(DEBUGFLAGS)
> + FLAGS   = $(CFLAGS) $(CPPFLAGS) $(MOREFLAGS)
>   @@ -293,8 +293,6 @@ install: lib xxhsum
>     @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
>     @$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)