From: Peter Tyser Date: Thu, 12 Mar 2009 18:53:53 -0500 Subject: [U-Boot] [PATCH 17/26 v2] tools/Makefile: Give precedence to U-Boot's include directory In-Reply-To: <20090312231935.3E64A832E8B8@gemini.denx.de> References: <1236887355-31359-1-git-send-email-ptyser@xes-inc.com> <1236887355-31359-17-git-send-email-ptyser@xes-inc.com> <1236887355-31359-18-git-send-email-ptyser@xes-inc.com> <200903121901.23433.vapier@gentoo.org> <20090312231935.3E64A832E8B8@gemini.denx.de> Message-ID: <1236902033.17861.54.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 2009-03-13 at 00:19 +0100, Wolfgang Denk wrote: > Dear Mike Frysinger, > > In message <200903121901.23433.vapier@gentoo.org> you wrote: > > > > On Thursday 12 March 2009 15:49:06 Peter Tyser wrote: > > > Update include search path so that the includes in U-Boot's include/ > > > directory have precedence over system includes. This allows crc32.c > > > to use U-Boot's zlib.h header which removes the previously required > > > symlinked zlib.h. > > > > this seems pretty risky. the headers in include/ are pretty much for u-boot. > > making those with the host headers seems like it's doomed to failure. > > Indeed. > > Full NAK from me, too. So what's a good fix? U-Boot's crc32() prototype uses uint32_t while the standard zlib uses ulongs (It looks like Mike tried to keep U-Boot's zlib.h header in line with the standard zlib.h, but then resorted to using uint32_t's a year ago: http://www.mail-archive.com/u-boot-users at lists.sourceforge.net/msg03726.html ). The first workarounds that popped to mind are: 1. link with zlib to provide crc32() instead of compiling u-boot's version 2. keep doing the symlink song and dance to give u-boot's zlib.h priority 3. put u-boot's crc32() prototype back in line with zlib's and implement Mike's original solution 4. put u-boot's crc32() prototype back in line with zlib's and do some preprocessor magic (look at __SIZE_TYPE__, __LONG_MAX__, etc) - not sure if this is possible/portable 5. some other idea? Thanks, Peter