Skip to content

Commit

Permalink
Fix ARM NDEBUG Builds
Browse files Browse the repository at this point in the history
Change-Id: I1250744d54b75d6380393afe848a6eb8c5dc894d
  • Loading branch information
sambuc committed Mar 31, 2018
1 parent 35b65c5 commit 03ac74e
Show file tree
Hide file tree
Showing 24 changed files with 139 additions and 7 deletions.
4 changes: 4 additions & 0 deletions external/bsd/bind/bin/named/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ MAN= named.8 lwresd.8 named.conf.5
BINDIR= /usr/sbin
LINKS= ${BINDIR}/named ${BINDIR}/lwresd

.if defined(__MINIX)
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif # defined(__MINIX)

.include "${.CURDIR}/../Makefile.inc"

DIST=${IDIST}/bin/named
Expand Down
6 changes: 6 additions & 0 deletions external/bsd/bind/dist/lib/lwres/lwconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,21 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
FILE *fp = NULL;
char word[256];
lwres_result_t rval, ret;
#if !defined(NDEBUG) && defined(__minix)
lwres_conf_t *confdata;
#endif /* !defined(NDEBUG) && defined(__minix) */
int stopchar;

REQUIRE(ctx != NULL);
#if !defined(NDEBUG) && defined(__minix)
confdata = &ctx->confdata;
#endif /* !defined(NDEBUG) && defined(__minix) */

REQUIRE(filename != NULL);
REQUIRE(strlen(filename) > 0U);
#if !defined(NDEBUG) && defined(__minix)
REQUIRE(confdata != NULL);
#endif /* !defined(NDEBUG) && defined(__minix) */

errno = 0;
if ((fp = fopen(filename, "r")) == NULL)
Expand Down
5 changes: 5 additions & 0 deletions external/bsd/bind/lib/libdns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ LIB=dns

.include "${.CURDIR}/../Makefile.inc"

.if defined(__MINIX)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif # defined(__MINIX)

DIST= ${IDIST}/lib/dns
.include "${DIST}/api"
.include "${DIST}/mapapi"
Expand Down
5 changes: 5 additions & 0 deletions external/bsd/bind/lib/libisc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ LIB=isc

.include <bsd.own.mk>

.if defined(__MINIX)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif # defined(__MINIX)

.include "${.CURDIR}/../Makefile.inc"

DIST= ${IDIST}/lib/isc
Expand Down
8 changes: 8 additions & 0 deletions external/bsd/dhcp/lib/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ MAN = dhcp-options.5 dhcp-eval.5
DHCPSRCDIR= common

.include <bsd.lib.mk>

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)
4 changes: 4 additions & 0 deletions external/bsd/dhcpcd/sbin/dhcpcd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ CPPFLAGS+= -DHAVE_CONFIG_H

.include <bsd.own.mk>

.if defined(__MINIX)
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif # defined(__MINIX)

SRCS+= auth.c hmac_md5.c

USE_INET?= yes
Expand Down
8 changes: 8 additions & 0 deletions external/bsd/nvi/usr.bin/nvi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ USE_WIDECHAR?=yes

CWARNFLAGS.clang+= -Wno-uninitialized -Wno-format-security

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

CPPFLAGS+=-I${DIST}/include -I${.CURDIR} -I. -DGTAGS
#DBG=-g
#CPPFLAGS+=-DLOGDEBUG -DTRACE
Expand Down
6 changes: 6 additions & 0 deletions external/bsd/tcpdump/bin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ CWARNFLAGS.clang+= -Wno-constant-logical-operand -Wno-error=unused-function

.include <bsd.own.mk>

.if defined(__MINIX)
#LSC: -Wno-unused-but-set-variable while compiling with -DNDEBUG -O2
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -O3
CWARNFLAGS.gcc+= -Wno-unused-but-set-variable -Wno-maybe-uninitialized
.endif # defined(__MINIX)

USE_FORT?= yes # network client

BINDIR=/usr/sbin
Expand Down
8 changes: 8 additions & 0 deletions external/public-domain/sqlite/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ CLEANFILES+=sqlite3.pc

.include <bsd.lib.mk>

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

all: sqlite3.pc
dependall: all

Expand Down
8 changes: 8 additions & 0 deletions lib/libbz2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ SRCS= blocksort.c huffman.c crctable.c randtable.c compress.c \
INCS= bzlib.h
INCSDIR= /usr/include

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

# XXX huffman.c gets mis-compiled with 2.95.3
.if ${MACHINE_ARCH} == "vax"
COPTS+= -O0
Expand Down
8 changes: 8 additions & 0 deletions libexec/httpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ LDADD+= -lnbutil

.include <bsd.own.mk>

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

.if ${MKCRYPTO} != "no"

LDADD+= -lssl -lcrypto
Expand Down
8 changes: 8 additions & 0 deletions minix/net/lwip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ LDADD+= -llwip -lsockevent -lsockdriver -lchardriver -lsys -ltimers

WARNS?= 5

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

.include <minix.service.mk>
9 changes: 8 additions & 1 deletion minix/net/lwip/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,10 @@ addr_put_netmask(struct sockaddr * addr, socklen_t * addr_len, uint8_t type,
void
addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)
{
unsigned int addr_len, byte, bit;
#if !defined(NDEBUG)
unsigned int addr_len;
#endif /* !defined(NDEBUG) */
unsigned int byte, bit;
const uint8_t *srcaddr;
uint8_t type, *dstaddr;

Expand All @@ -594,7 +597,9 @@ addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)
case IPADDR_TYPE_V4:
srcaddr = (const uint8_t *)&ip_2_ip4(src)->addr;
dstaddr = (uint8_t *)&ip_2_ip4(dst)->addr;
#if !defined(NDEBUG)
addr_len = sizeof(ip_2_ip4(src)->addr);
#endif /* !defined(NDEBUG) */

break;

Expand All @@ -603,7 +608,9 @@ addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)

srcaddr = (const uint8_t *)&ip_2_ip6(src)->addr;
dstaddr = (uint8_t *)&ip_2_ip6(dst)->addr;
#if !defined(NDEBUG)
addr_len = sizeof(ip_2_ip6(src)->addr);
#endif /* !defined(NDEBUG) */

break;

Expand Down
4 changes: 2 additions & 2 deletions minix/net/lwip/lldata.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ lldata_ndp_get(lldata_ndp_num_t num, struct sockaddr_in6 * addr,
{
const ip6_addr_t *ip6addr;
ip_addr_t ipaddr;
struct netif *netif;
struct netif *netif = NULL /*gcc*/;
struct ifdev *ifdev;
const uint8_t *lladdr;
const uint8_t *lladdr = NULL /*gcc*/;
socklen_t addr_len;

ip6addr = nd6_get_neighbor_cache_entry(num, &netif, &lladdr,
Expand Down
2 changes: 1 addition & 1 deletion minix/net/lwip/rttree.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ rttree_add(struct rttree * tree, struct rttree_entry * entry,
{
struct rttree_node *node, *parent, *link;
struct rttree_entry *other_entry;
unsigned int bit, side, side2;
unsigned int bit = 0 /*gcc*/, side, side2;
int match;

assert(mask != NULL || prefix == tree->rtt_bits);
Expand Down
2 changes: 1 addition & 1 deletion minix/net/lwip/tcpisn.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ tcpisn_secret(struct rmib_call * call __unused,
struct rmib_newp * newp)
{
uint8_t secret[TCPISN_SECRET_HEX_LENGTH], byte, *p;
unsigned int i;
unsigned int i = 0 /*gcc*/;
int r;

/* First copy out the old (current) ISN secret. */
Expand Down
8 changes: 8 additions & 0 deletions minix/net/uds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ FILESDIR= /etc/system.conf.d
DPADD+= ${LIBSOCKEVENT} ${LIBSOCKDRIVER} ${LIBSYS} ${LIBTIMERS}
LDADD+= -lsockevent -lsockdriver -lsys -ltimers

.if !empty(DBG:M-Os) || !empty(CFLAGS:M-Os) || \
!empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif

WARNS?= 5

.include <minix.service.mk>
2 changes: 1 addition & 1 deletion minix/net/uds/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ uds_recv(struct sock * sock, const struct sockdriver_data * data, size_t len,
struct udssock *uds = (struct udssock *)sock;
size_t seglen, datalen, reslen = 0 /*gcc*/, credpos = 0 /*gcc*/;
unsigned int segflags;
int r, partial, may_block;
int r, partial, may_block = 0 /*gcc*/;

dprintf(("UDS: recv(%d,%zu,%zu,%u,%u,0x%x)\n",
uds_get_id(uds), len, (off != NULL) ? *off : 0, ctl_len,
Expand Down
8 changes: 8 additions & 0 deletions minix/servers/mib/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Makefile for the Management Information Base (MIB) server

.include <bsd.own.mk>

.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif

PROG= mib
SRCS= main.c tree.c remote.c kern.c vm.c hw.c proc.c minix.c

Expand Down
5 changes: 5 additions & 0 deletions minix/servers/vfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ SRCS+= gcov.c
CPPFLAGS+= -DUSE_COVERAGE
.endif

.if defined(__MINIX)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -O3
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif # defined(__MINIX)

CFLAGS+= -Wall -Wextra -Wno-sign-compare -Werror
DPADD+= ${LIBSYS} ${LIBTIMERS} ${LIBEXEC}
LDADD+= -lsys -ltimers -lexec -lmthread
Expand Down
9 changes: 8 additions & 1 deletion minix/servers/vfs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,10 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)
* The parent and child parameters tell who forked off whom. The file
* system uses the same slot numbers as the kernel. Only PM makes this call.
*/
struct fproc *cp, *pp;
struct fproc *cp;
#if !defined(NDEBUG)
struct fproc *pp;
#endif /* !defined(NDEBUG) */
int i, parentno, childno;
mutex_t c_fp_lock;

Expand All @@ -606,7 +609,9 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)

/* Increase the counters in the 'filp' table. */
cp = &fproc[childno];
#if !defined(NDEBUG)
pp = &fproc[parentno];
#endif /* !defined(NDEBUG) */

for (i = 0; i < OPEN_MAX; i++)
if (cp->fp_filp[i] != NULL) cp->fp_filp[i]->filp_count++;
Expand All @@ -615,8 +620,10 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)
cp->fp_pid = cpid;
cp->fp_endpoint = cproc;

#if !defined(NDEBUG)
/* A forking process cannot possibly be suspended on anything. */
assert(pp->fp_blocked_on == FP_BLOCKED_ON_NONE);
#endif /* !defined(NDEBUG) */

/* A child is not a process leader, not being revived, etc. */
cp->fp_flags = FP_NOFLAGS;
Expand Down
3 changes: 3 additions & 0 deletions sbin/ifconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
RUMPPRG=ifconfig
MAN= ifconfig.8

.if defined(__MINIX)
CWARNFLAGS.gcc+= -Wno-unused-but-set-variable
.endif # defined(__MINIX)
#DBG+=-g
SRCS= af_atalk.c af_link.c carp.c
.if (${USE_INET6} != "no")
Expand Down
8 changes: 8 additions & 0 deletions usr.bin/ftp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ PROG= ftp
SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
progressbar.c ruserpass.c util.c

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized -Wno-clobbered
.endif
.endif # defined(__MINIX)

# Uncomment the following to provide defaults for gate-ftp operation
#
#CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
Expand Down
8 changes: 8 additions & 0 deletions usr.bin/m4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# if you want the paste & spaste macros.
.include <bsd.own.mk>

.if defined(__MINIX)
.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
!empty(DBG:M-g) || !empty(CFLAGS:M-g)
#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
CWARNFLAGS.gcc+= -Wno-maybe-uninitialized
.endif
.endif # defined(__MINIX)

PROG= m4
CPPFLAGS+= -DEXTENDED -I${.CURDIR}/lib
SRCS= parser.y tokenizer.l eval.c expr.c look.c main.c misc.c gnum4.c trace.c
Expand Down

0 comments on commit 03ac74e

Please sign in to comment.