summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2022-04-16 15:21:18 (GMT)
committerGitHub <noreply@github.com>2022-04-16 15:21:18 (GMT)
commita80897ee4944ff6008bfb3b93619ebcb58a070d1 (patch)
treef01b999aa5168e6869e4cf35c073377e3db09cd7 /configure.ac
parent463ef39bc777340b731903995a2ad416ec5e0ae4 (diff)
downloadhdf5-a80897ee4944ff6008bfb3b93619ebcb58a070d1.zip
hdf5-a80897ee4944ff6008bfb3b93619ebcb58a070d1.tar.gz
hdf5-a80897ee4944ff6008bfb3b93619ebcb58a070d1.tar.bz2
Remove H5_NO_ALIGNMENT_RESTRICTIONS (#1426)
* Do not conditionally compile code that uses a pointer dereference and assignment to copy a potentially unaligned variable to aligned automatic storage, or vice versa. Instead, always use naked `memcpy(3)`s. Disassembling the generated code reveals that the `memcpy(3)`s optimize (`-O3`) to a single `mov` instruction for x86_64, which is not strict about alignment. This change reduces the size of code and scripts by 143 lines, eases our way to cross-compilation, and avoids invoking undefined behavior. * Committing clang-format changes * Per discussion, use HD and add comments. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 0 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index d5cef35..908ece7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3990,25 +3990,6 @@ AC_ARG_ENABLE([embedded-libinfo],
## ----------------------------------------------------------------------
-## Check if pointer alignments are enforced
-##
-AC_MSG_CHECKING([if alignment restrictions are strictly enforced])
-
-TEST_SRC="`(echo \"#define H5_NO_ALIGNMENT_RESTRICTIONS_TEST 1\"; cat $srcdir/config/cmake/ConversionTests.c)`"
-
-AC_RUN_IFELSE([
- AC_LANG_SOURCE([$TEST_SRC])
- ], [
- AC_DEFINE([NO_ALIGNMENT_RESTRICTIONS], [1], [Define if we can violate pointer alignment restrictions])
- AC_MSG_RESULT([no])
- ], [
- AC_MSG_RESULT([yes])
- ], [
- AC_MSG_RESULT([unknown, assuming yes])
- ])
-
-
-## ----------------------------------------------------------------------
## Restore user's CFLAGS.
CFLAGS="$saved_user_CFLAGS"
FCFLAGS="$saved_user_FCFLAGS"