Skip to content

Commit

Permalink
misc/bb: fix building on non-x86
Browse files Browse the repository at this point in the history
regparm is strictly i386, but clang allows it on amd64.

Building on other architectures fails with:
In file included from zoom.c:56:
In file included from ./zoom.h:30:
./formulas.h:53:63: error: 'regparm' is not valid on this platform
    int (*calculate) (number_t, number_t, number_t, number_t) REGISTERS(3);
                                                              ^         ~
./config.h:42:38: note: expanded from macro 'REGISTERS'

GCC builts in just fine.
  • Loading branch information
pkubaj committed Oct 22, 2021
1 parent ab46787 commit 91a4c28
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions misc/bb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libaa.so:graphics/aalib \
libmikmod.so:audio/libmikmod

BROKEN_aarch64= fails to build: regparm is not valid on this platform
BROKEN_armv6= fails to build: regparm is not valid on this platform
BROKEN_armv7= fails to build: regparm is not valid on this platform
BROKEN_riscv64= fails to build: regparm is not valid on this platform

GNU_CONFIGURE= yes
WRKSRC= ${WRKDIR}/bb-1.3.0
PORTDOCS= README
Expand All @@ -28,6 +23,12 @@ PLIST_FILES= bin/bb man/man1/bb.1.gz share/bb/bb.s3m share/bb/bb2.s3m \

OPTIONS_DEFINE= DOCS

.include <bsd.port.options.mk>

.if ${ARCH} != amd64 && ${ARCH} != i386
USES+= compiler:gcc-c++11-lib
.endif

pre-patch:
@${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -E -e "s@#include +<malloc.h>@#include <stdlib.h>@g" \
-e 's, REGISTERS \(3\),,g'
Expand Down

0 comments on commit 91a4c28

Please sign in to comment.