Skip to content

Commit

Permalink
Do not define __NO_STRICT_ALIGNMENT for armv6. While the requirements
Browse files Browse the repository at this point in the history
are no longer natural-alignment strict, there are still some restrictions.

FreeBSD network code assumes data is naturally-aligned or is running
on a platform with no restrictions; pointers are not annotated to
indicate the data pointed to may be packed or unaligned.  The clang
optimizer can sometimes combine the load or store of a pair of adjacent
32-bit values into a single doubleword load/store, and that operation
requires at least 4-byte alignment.  __NO_STRICT_ALIGNMENT can lead
to tcp headers being only 2-byte aligned.

Note that alignment faults remain disabled on armv6, this change reverts
only the defining of the symbol which leads to some overly-agressive code
shortcuts when building common/shared drivers and network code for arm.

Approved by:	re(kib)
  • Loading branch information
Ian Lepore authored and Ian Lepore committed Jun 13, 2016
1 parent 47c5f8f commit e2a03c1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions sys/arm/include/_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
#error this file needs sys/cdefs.h as a prerequisite
#endif

#if __ARM_ARCH >= 6
#define __NO_STRICT_ALIGNMENT
#endif

/*
* Basic types upon which most other types are built.
*/
Expand Down

0 comments on commit e2a03c1

Please sign in to comment.