Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#6524: Fix udivmoddi4.c 32-bit linux build fail and semantics #6526

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions third_party/libgcc/README.dynamorio
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions third_party/libgcc/udivmoddi4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
xdje42 marked this conversation as resolved.
Show resolved Hide resolved
<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
Expand Down
Loading