From nobody@FreeBSD.org  Fri Dec 23 12:56:39 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED7591065672
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 12:56:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id D7EF48FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 12:56:39 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pBNCudZc034555
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 12:56:39 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pBNCud3Y034554;
	Fri, 23 Dec 2011 12:56:39 GMT
	(envelope-from nobody)
Message-Id: <201112231256.pBNCud3Y034554@red.freebsd.org>
Date: Fri, 23 Dec 2011 12:56:39 GMT
From: bob frazier <bobf@mrp3.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: avr-libc will not compile when using util/delay.h
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163562
>Category:       ports
>Synopsis:       devel/avr-libc will not compile when using util/delay.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 23 13:00:24 UTC 2011
>Closed-Date:    Fri Dec 30 09:55:26 MET 2011
>Last-Modified:  Fri Dec 30 09:00:28 UTC 2011
>Originator:     bob frazier
>Release:        7.4-STABLE
>Organization:
S.F.T. Inc.
>Environment:
FreeBSD BSDSilver.SFT.local 7.4-STABLE FreeBSD 7.4-STABLE #15: Thu Dec 15 19:14:22 PST 2011     root@BSDSilver.SFT.local:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
attempting to build code for avr using avr-gcc and avr-libc (arduino build environment).  Code that makes use of 'delay' causes several compile errors, similar to the following:

/usr/local/lib/gcc/avr/4.3.4/../../../../avr/include/util/delay.h:149: error: 'fabs' was not declared in this scope 

the problem and a workable solution are both described here
http://code.google.com/p/arduino/issues/detail?id=604

the attached patch file resolves this issue.

>How-To-Repeat:
install latest avr-libc and arduino build environment and attempt to build the 'blink' sample.

>Fix:
see attached patch file, that adds #include <math.h> to /usr/local/avr/include/util/delay.h



Patch attached with submission follows:

--- include/util/delay.h.in.orig	2010-11-09 11:39:32.000000000 -0800
+++ include/util/delay.h.in	2011-12-23 04:40:40.000000000 -0800
@@ -37,10 +37,13 @@
 
 #ifndef __HAS_DELAY_CYCLES
 #define __HAS_DELAY_CYCLES @HAS_DELAY_CYCLES@
 #endif
 
+// patch recommended by http://code.google.com/p/arduino/issues/detail?id=604
+#include <math.h>
+// end patch
 #include <inttypes.h>
 #include <util/delay_basic.h>
 
 /** \file */
 /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->joerg 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Dec 23 13:54:24 UTC 2011 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163562 
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Fri Dec 30 09:54:59 MET 2011 
State-Changed-Why:  
Resolved by upgrading to avr-libc 1.8.0. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163562 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/163562: commit references a PR
Date: Fri, 30 Dec 2011 08:54:08 +0000 (UTC)

 joerg       2011-12-30 08:53:57 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/avr-libc       Makefile distinfo pkg-plist 
   Log:
   Upgrade to avr-libc 1.8.0
   
   PR:             ports/163562
   
   Revision  Changes    Path
   1.81      +3 -2      ports/devel/avr-libc/Makefile
   1.41      +2 -2      ports/devel/avr-libc/distinfo
   1.39      +25 -0     ports/devel/avr-libc/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
