PATCH RFC: Add sha1 to libiberty

Ian Lance Taylor iant@google.com
Tue Mar 25 00:25:00 GMT 2008


I plan to shortly commit this patch to add sha1 to libiberty.  I'm
doing this for the GNU binutils, in order to use sha1 in gold.
Currently ld has its copy of sha1.h and sha1.c; putting it in
libiberty will permit ld and gold to share it.

The source code for sha1 comes from gnulib.

The only mildly interesting part of this patch is that sha1.h needs an
unsigned 32-bit type.  It wants to use <stdint.h>, which may not be
always available.  We already have an autoconf macro GCC_HEADER_STDINT
to create a reasonable version of stdint.h.  I changed sha1.h so that
if STDINT_H_NAME is defined, it will be included.

Tested with a bootstrap on i686-pc-linux-gnu.

Ian


include/ChangeLog:
2008-03-24  Ian Lance Taylor  <iant@google.com>

	* sha1.h: New file, from gnulib.

libiberty/ChangeLog:
2008-03-24  Ian Lance Taylor  <iant@google.com>

	* sha1.c: New file, from gnulib.
	* configure.ac: Call GCC_HEADER_STDINT(gstdint.h).  Define
	STDINT_H_NAME.
	* aclocal.m4: Include stdint.m4.
	* Makefile.in: Rebuild dependencies.
	(CFILES): Add sha1.c.
	(REQUIRED_OFILES): Add sha1.o.
	* configure, config.in: Rebuild.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 20238 bytes
Desc: Add sha1 to libiberty
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080325/c1a0dd43/attachment.bin>


More information about the Gcc-patches mailing list