Skip site navigation (1)Skip section navigation (2)
Date:      12 Oct 1999 03:22:24 -0000
From:      nnd@mail.nsk.ru
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/14278: 'newpcm' does'nt compile with '-fno-builtin' (patch)
Message-ID:  <19991012032224.23229.qmail@infoteka.nsk.ru>

next in thread | raw e-mail | index | archive | help

>Number:         14278
>Category:       kern
>Synopsis:       'newpcm' does'nt compile with '-fno-builtin'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 11 20:30:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Nickolay N. Dudorov
>Release:        FreeBSD-current
>Organization:
STE Infoteka
>Environment:

	FreeBSD-current with 'newpcm' and
'makeoptions CONF_CFLAGS=-fno-builtin' in kernel config file.

>Description:

	Such configured kernel does'nt linked due to
absence of 'abs' function/macro definition.

>How-To-Repeat:

	Configure the kernel with abovementioned options and try to
make it.

>Fix:
	
	The following patch add th macro 'abs' definition to two of
the files and remove 'abs' usage from the third one.
(I steal the macro definition from sys/isa/pcm.c file ;-)

====================================================================
diff -bur dev/pcm.ORIG/ac97.c dev/pcm/ac97.c
--- dev/pcm.ORIG/ac97.c	Wed Sep  1 13:58:21 1999
+++ dev/pcm/ac97.c	Tue Oct 12 10:04:17 1999
@@ -29,6 +29,8 @@
 #include <dev/pcm/sound.h>
 #include <dev/pcm/ac97.h>
 
+#define	abs(x)	(((x) < 0) ? -(x) : (x))
+
 #define AC97_MUTE	0x8000
 
 #define AC97_REG_RESET	0x00
diff -bur dev/pcm.ORIG/channel.c dev/pcm/channel.c
--- dev/pcm.ORIG/channel.c	Wed Sep 29 09:37:06 1999
+++ dev/pcm/channel.c	Tue Oct 12 10:02:56 1999
@@ -709,7 +709,7 @@
 	if (CANCHANGE(c)) {
 		c->flags &= ~CHN_F_HAS_SIZE;
 		if (blksz >= 2) c->flags |= CHN_F_HAS_SIZE;
-		blksz = abs(blksz);
+		if (blksz < 0) blksz = -blksz;
 		if (blksz < 2) blksz = (c->buffer.sample_size * c->speed) >> 2;
 		RANGE(blksz, 1024, c->buffer.bufsize / 4);
 		blksz &= ~3;
diff -bur dev/pcm.ORIG/isa/mss.c dev/pcm/isa/mss.c
--- dev/pcm.ORIG/isa/mss.c	Wed Sep 29 09:37:06 1999
+++ dev/pcm/isa/mss.c	Tue Oct 12 10:04:04 1999
@@ -30,6 +30,8 @@
 
 #include <dev/pcm/sound.h>
 
+#define	abs(x)	(((x) < 0) ? -(x) : (x))
+
 #if NPCM > 0
 
 /* board-specific include files */

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991012032224.23229.qmail>