mirror of
https://github.com/DynamoRIO/dynamorio.git
synced 2026-10-12 02:02:04 +00:00
i#6524: Fix udivmoddi4.c 32-bit linux build fail and semantics (#6526)
For the targets we care about LIBGCC2_UNITS_PER_WORD == 4 (SImode in GCC parlance). Thus a double word is 8 bytes (DImode in GCC parlance). Previously, __moddi3 was using a mix of word and double word widths, causing a compilation failure on 32 bit linux with the Debian 13.2.0-4 compiler. The semantics were also incorrect: inputs and outputs should be 64 bits for the hosts we care about (x86, aarch, 32 and 64 bit, and riscv64). Fixes: #6524
This commit is contained in:
Vendored
+7
-5
@@ -50,11 +50,13 @@ as it breaks some old assemblers:
|
||||
|
||||
For udivmoddi4.c, it contains the __udivmoddi4 and __moddi3 functions extracted from
|
||||
libgcc2.c with the following lines added:
|
||||
> /* This is extracted from gcc's libgcc/libgcc2.c with these typedefs added: */
|
||||
> typedef short Wtype;
|
||||
> typedef int DWtype;
|
||||
> typedef unsigned int UWtype;
|
||||
> typedef unsigned long long UDWtype;
|
||||
> /* This is extracted from gcc's libgcc/libgcc2.c with these typedefs added.
|
||||
> Note that for current targets (x86, aarch, riscv - 32 and 64 bit)
|
||||
> LIBGCC2_UNITS_PER_WORD == 4. Thus a double word is 8 bytes. */
|
||||
> typedef int32_t Wtype;
|
||||
> typedef int64_t DWtype;
|
||||
> typedef uint32_t UWtype;
|
||||
> typedef uint64_t UDWtype;
|
||||
> #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
|
||||
> struct DWstruct {Wtype high, low;};
|
||||
> #else
|
||||
|
||||
Vendored
+9
-5
@@ -23,11 +23,15 @@ a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This is extracted from gcc's libgcc/libgcc2.c with these typedefs added: */
|
||||
typedef short Wtype;
|
||||
typedef int DWtype;
|
||||
typedef unsigned int UWtype;
|
||||
typedef unsigned long long UDWtype;
|
||||
#include <stdint.h>
|
||||
|
||||
/* This is extracted from gcc's libgcc/libgcc2.c with these typedefs added.
|
||||
Note that for current targets (x86, aarch, riscv - 32 and 64 bit)
|
||||
LIBGCC2_UNITS_PER_WORD == 4. Thus a double word is 8 bytes. */
|
||||
typedef int32_t Wtype;
|
||||
typedef int64_t DWtype;
|
||||
typedef uint32_t UWtype;
|
||||
typedef uint64_t UDWtype;
|
||||
#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
|
||||
struct DWstruct {Wtype high, low;};
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user