1
0
mirror of https://github.com/upx/upx.git synced 2025-08-11 22:52:30 +08:00

Added support for amd64 (aka x86_64) cross compiler.

committer: mfx <mfx> 1064515134 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2003-09-25 18:38:54 +00:00
parent f616d2edf1
commit e4f6378dfe
4 changed files with 18 additions and 14 deletions

View File

@ -213,6 +213,13 @@ endif
### Linux cross compilers
###
ifeq ($(target),cross-amd64-linux)
include $(srcdir)/Makedefs.gcc
CC = x86_64-linux-gcc
CXX = x86_64-linux-g++
##LDLIBS += -lmcheck
endif # cross-amd64-linux
ifeq ($(target),cross-m68k-linux)
include $(srcdir)/Makedefs.gcc
CC = m68k-linux-gcc

View File

@ -93,7 +93,7 @@ inline void set_be32(void *bb, unsigned v)
inline unsigned get_le16(const void *bb)
{
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
return * (const unsigned short *) bb;
#else
const unsigned char* b = (const unsigned char*) bb;
@ -106,7 +106,7 @@ inline unsigned get_le16(const void *bb)
inline void set_le16(void *bb, unsigned v)
{
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
(* (unsigned short *) bb) = (unsigned short) (v & 0xffff);
#else
unsigned char* b = (unsigned char*) bb;
@ -137,7 +137,7 @@ inline void set_le24(void *bb, unsigned v)
inline unsigned get_le32(const void *bb)
{
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
return * (const unsigned *) bb;
#else
const unsigned char* b = (const unsigned char*) bb;
@ -152,7 +152,7 @@ inline unsigned get_le32(const void *bb)
inline void set_le32(void *bb, unsigned v)
{
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
(* (unsigned *) bb) = v;
#else
unsigned char* b = (unsigned char*) bb;
@ -261,7 +261,7 @@ class LE16
public:
LE16() { }
LE16& operator = (const LE16 &v) {
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
* (unsigned short *) d = * (const unsigned short *) v.d;
#else
memcpy(d, v.d, sizeof(d));
@ -287,7 +287,7 @@ class LE32
public:
LE32() { }
LE32& operator = (const LE32 &v) {
#if (ACC_ARCH_IA32)
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
* (unsigned int *) d = * (const unsigned int *) v.d;
#else
memcpy(d, v.d, sizeof(d));
@ -372,13 +372,13 @@ int __acc_cdecl_qsort le32_compare_signed(const void *e1, const void *e2);
// just for testing...
#if (1 && ACC_ARCH_IA32 && ACC_CC_GNUC >= 0x030200)
#if (1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC >= 0x030200)
typedef unsigned short LE16_unaligned __attribute__((__aligned__(1)));
typedef unsigned int LE32_unaligned __attribute__((__aligned__(1)));
# define LE16 LE16_unaligned
# define LE32 LE32_unaligned
#endif
#if (0 && ACC_ARCH_IA32 && ACC_CC_MSC)
#if (0 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_MSC)
typedef unsigned short LE16_unaligned;
typedef unsigned int LE32_unaligned;
# define LE16 LE16_unaligned

View File

@ -36,9 +36,6 @@
// ACC
**************************************************************************/
#if 0 && defined(UPX_CONFIG_HEADER)
# define ACC_CONFIG_HEADER UPX_CONFIG_HEADER
#endif
#include "acc/acc.h"
#include "acc/acc_incd.h"
#include "acc/acc_ince.h"
@ -278,8 +275,8 @@
#undef __attribute_packed
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
# if (1 && (ACC_ARCH_IA32 || ACC_ARCH_IA64))
#if (ACC_CC_GNUC || ACC_CC_INTELC)
# if (1 && (ACC_ARCH_IA32))
# define __attribute_packed
# else
# define __attribute_packed __attribute__((__packed__,__aligned__(1)))

View File

@ -94,7 +94,7 @@ public:
using namespace std;
#elif (ACC_CC_DMC)
namespace std { class bad_alloc { }; }
#elif defined(__EMX__)
#elif (ACC_CC_GNUC && ACC_OS_EMX)
#define std
#elif (ACC_CC_SYMANTECC)
#define std