ports/163562: avr-libc will not compile when using util/delay.h
bob frazier
bobf at mrp3.com
Fri Dec 23 13:00:25 UTC 2011
>Number: 163562
>Category: ports
>Synopsis: avr-libc will not compile when using util/delay.h
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Dec 23 13:00:24 UTC 2011
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list