Skip Menu |
 

Subject: Use __BIG_ENDIAN__ and __LITTLE_ENDIAN__ if available to detect endianness
The krb5 build system should (where it needs to know the endianness of the machine) prefer
the compile-time variables __BIG_ENDIAN__ and __LITTLE_ENDIAN__ over the autoconf-
generated variables if they are available. This will make cross-compilation to systems with
different endianness possible (for compilers that provide these variables).

This is needed for Darwin i386 builds.

Note that in the Darwin case, we need to check the compiler variables at compile time and
not in an autoconf test. With the Apple mach-o compiler, a single gcc invocation can build a
fat object file with code for multiple architectures (ie: "CFLAGS=-arch pcc -arch i386").

We are referring to endianness in at least two places in the 1.3 sources:
src/lib/crypto/aes/aesopt.h
src/util/db2/include/db-int.h
Subject: Or use BYTE_ORDER :-)
Darwin also seems to define the macro BYTE_ORDER (defined to either BIG_ENDIAN or
LITTLE_ENDIAN depending on the architecture) in endian.h.

Heimdal checks for the presence of BYTE_ORDER and prefers it to configure-time checks. It
does not currently check __BIG_ENDIAN__ and __LITTLE_ENDIAN__ because they are newer
gcc macros (although I think that is going to get fixed).
To: rt-comment@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #2551] Or use BYTE_ORDER :-)
From: Tom Yu <tlyu@mit.edu>
Date: Tue, 04 May 2004 15:50:50 -0400
RT-Send-Cc:
src/lib/crypto/aes/aesopt.h already checks for BYTE_ORDER, and various
other header-defined or predefined macros determining byte order. We
aren't even using the autoconf endianness tests in that directory.
src/util/db2/include/db-int.h is another matter, though.
From: raeburn@mit.edu
Subject: CVS Commit
Download (untitled) / with headers
text/plain 1.1KiB
Since the AES code builds, and doesn't do any configure-time byte order checks
that I noticed, something similar ought to work for the DB code. This is the
first cut; nightly testing builds should tell us if it's sufficient on most of
the platforms we work on.

* include/db-int.h: Include stdlib.h, and endian.h if available.
(LITTLE_ENDIAN, BIG_ENDIAN, BYTE_ORDER): If not defined, and if versions with
one or two leading underscores are defined, define the no-underscore form in
terms of the with-underscore one.
(DB_BYTE_ORDER): Define by checking LITTLE_ENDIAN, BIG_ENDIAN, and BYTE_ORDER;
report an error if that doesn't work. Don't check WORDS_BIGENDIAN.

* Makefile.in (all-prerecurse): Make sure headers generated by config.status
are up to date.
(include/config.h, $(srcdir)/include/config.h.in, include/db-config.h): New
rules.
* configure.in: Don't check byte order here. Check for endian.h.


To generate a diff of this commit:



cvs diff -r1.43 -r1.44 krb5/src/util/db2/ChangeLog
cvs diff -r1.13 -r1.14 krb5/src/util/db2/Makefile.in
cvs diff -r1.12 -r1.13 krb5/src/util/db2/configure.in
cvs diff -r1.9 -r1.10 krb5/src/util/db2/include/ChangeLog
cvs diff -r1.8 -r1.9 krb5/src/util/db2/include/db-int.h
The patch I just checked in for the db2 code doesn't check the
__FOO_ENDIAN__ macros, because we don't seem to need them so far. It
would be reasonable to update both db2 and AES to check them, but I
don't see any hurry. One minor benefit, if they're available, we could
do the test without including any additional system headers.
From: raeburn@mit.edu
Subject: CVS Commit
* configure.in: Check for machine/endian.h too.
* include/db-int.h: Include machine/endian.h if available. Check for
__LITTLE_ENDIAN__ and __BIG_ENDIAN__, _MIPSEB and _MIPSEL.


To generate a diff of this commit:



cvs diff -r1.44 -r1.45 krb5/src/util/db2/ChangeLog
cvs diff -r1.13 -r1.14 krb5/src/util/db2/configure.in
cvs diff -r1.10 -r1.11 krb5/src/util/db2/include/ChangeLog
cvs diff -r1.9 -r1.10 krb5/src/util/db2/include/db-int.h
From: raeburn@mit.edu
Subject: CVS Commit
* configure.in: Check for endian.h and machine/endian.h.
* aes/aesopt.h (PLATFORM_BYTE_ORDER): Check for _MIPSEB, _MIPSEL. If endian.h
or machine/endian.h is available, include it instead of sys/param.h. Don't
mess around with multibyte character constants.


To generate a diff of this commit:



cvs diff -r5.159 -r5.160 krb5/src/lib/crypto/ChangeLog
cvs diff -r1.33 -r1.34 krb5/src/lib/crypto/configure.in
cvs diff -r1.8 -r1.9 krb5/src/lib/crypto/aes/ChangeLog
cvs diff -r1.1 -r1.2 krb5/src/lib/crypto/aes/aesopt.h
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.1 -r1.1.2.1 krb5/src/lib/crypto/aes/aesopt.h
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.4.2.3 -r1.4.2.4 krb5/src/lib/crypto/aes/ChangeLog
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r5.136.2.11 -r5.136.2.12 krb5/src/lib/crypto/ChangeLog
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.32 -r1.32.2.1 krb5/src/lib/crypto/configure.in
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.40.2.1 -r1.40.2.2 krb5/src/util/db2/ChangeLog
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.12 -r1.12.2.1 krb5/src/util/db2/configure.in
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.9 -r1.9.2.1 krb5/src/util/db2/include/ChangeLog
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.8 -r1.8.2.1 krb5/src/util/db2/include/db-int.h
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.12.2.1 -r1.12.2.2 krb5/src/util/db2/Makefile.in
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk (this time without converting tabs to spaces...)


To generate a diff of this commit:



cvs diff -r1.12.2.2 -r1.12.2.3 krb5/src/util/db2/Makefile.in
From: lxs@mit.edu
Subject: CVS Commit
pullup from trunk (remove support for maintainer mode not on this branch)


To generate a diff of this commit:



cvs diff -r1.12.2.3 -r1.12.2.4 krb5/src/util/db2/Makefile.in