Compile fixes for PGI C++.

committer: mfx <mfx> 1071917829 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2003-12-20 10:57:09 +00:00
parent b9c976304a
commit 97153e8e09
14 changed files with 44 additions and 23 deletions
+11 -1
View File
@@ -210,12 +210,22 @@ endif
### ###
### linux/i386 - Portland Group PGI C++ 5.1 ### linux/i386 - Portland Group PGI C++ 5.x
### ###
ifeq ($(target),linux-pgi) ifeq ($(target),linux-pgi)
##DEPMODE := XXX_linux ## FIXME
CC = pgcc CC = pgcc
CXX = pgCC CXX = pgCC
CCARCH += -tp=p6
CFLAGS_OUTPUT = -o $@
LINK_EXE_OUTPUT = -o $@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
##CFLAGS += -Minform=info
CXXFLAGS = $(CFLAGS) -tused
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
else else
CFLAGS += -O2 CFLAGS += -O2
+2
View File
@@ -49,6 +49,8 @@
**************************************************************************/ **************************************************************************/
#if defined(__ACC_CXX_DO_NEW) #if defined(__ACC_CXX_DO_NEW)
#elif (ACC_CC_PGI)
# define __ACC_CXX_DO_NEW { return 0; }
#else #else
# define __ACC_CXX_DO_NEW ; # define __ACC_CXX_DO_NEW ;
#endif #endif
+5 -3
View File
@@ -116,10 +116,12 @@
#undef linux #undef linux
#undef small #undef small
#undef tos #undef tos
#undef unix #if defined(ACC_CC_DMC)
#if defined(__DMC__)
# undef tell # undef tell
#endif #endif
#if !defined(ACC_CC_PGI)
# undef unix
#endif
#if defined(__DJGPP__) #if defined(__DJGPP__)
# undef sopen # undef sopen
# undef __unix__ # undef __unix__
@@ -149,7 +151,7 @@
# define UPX_E_OK UCL_E_OK # define UPX_E_OK UCL_E_OK
# define UPX_E_ERROR UCL_E_ERROR # define UPX_E_ERROR UCL_E_ERROR
# define UPX_E_OUT_OF_MEMORY UCL_E_OUT_OF_MEMORY # define UPX_E_OUT_OF_MEMORY UCL_E_OUT_OF_MEMORY
# define __UPX_ENTRY __UCL_ENTRY # define __UPX_CDECL __UCL_CDECL
# endif # endif
#endif #endif
#if defined(WITH_NRV) #if defined(WITH_NRV)
+6
View File
@@ -62,6 +62,8 @@ void show_head(void)
UPX_VERSION_DATE); UPX_VERSION_DATE);
fg = con_fg(f,fg); fg = con_fg(f,fg);
#undef V #undef V
UNUSED(fg);
} }
@@ -275,6 +277,8 @@ void show_help(int x)
"\n"); "\n");
fg = con_fg(f,fg); fg = con_fg(f,fg);
#endif #endif
UNUSED(fg);
} }
@@ -314,6 +318,8 @@ void show_license(void)
" <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>\n" " <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>\n"
); );
fg = con_fg(f,fg); fg = con_fg(f,fg);
UNUSED(fg);
} }
+7 -6
View File
@@ -344,12 +344,12 @@ static void set_script_name(const char *n, bool allow_m)
fprintf(stderr,"%s: missing script name\n",argv0); fprintf(stderr,"%s: missing script name\n",argv0);
e_usage(); e_usage();
} }
if (strlen(n) >= (size_t)opt->unix.SCRIPT_MAX - 3) if (strlen(n) >= (size_t)opt->o_unix.SCRIPT_MAX - 3)
{ {
fprintf(stderr,"%s: script name too long\n",argv0); fprintf(stderr,"%s: script name too long\n",argv0);
e_usage(); e_usage();
} }
opt->unix.script_name = n; opt->o_unix.script_name = n;
done_script_name++; done_script_name++;
} }
@@ -685,18 +685,18 @@ static int do_option(int optc, const char *arg)
opt->atari_tos.split_segments = true; opt->atari_tos.split_segments = true;
break; break;
case 660: case 660:
getoptvar(&opt->unix.blocksize, 8192u, ~0u); getoptvar(&opt->o_unix.blocksize, 8192u, ~0u);
break; break;
case 661: case 661:
opt->unix.force_execve = true; opt->o_unix.force_execve = true;
break; break;
case 662: case 662:
opt->unix.script_name = "/usr/local/lib/upx/upxX"; opt->o_unix.script_name = "/usr/local/lib/upx/upxX";
if (mfx_optarg && mfx_optarg[0]) if (mfx_optarg && mfx_optarg[0])
set_script_name(mfx_optarg,1); set_script_name(mfx_optarg,1);
break; break;
case 663: case 663:
opt->unix.ptinterp = true; opt->o_unix.ptinterp = true;
break; break;
case 670: case 670:
opt->ps1_exe.no_align = true; opt->ps1_exe.no_align = true;
@@ -1242,6 +1242,7 @@ int __acc_cdecl_main main(int argc, char *argv[])
int fg = con_fg(f,FG_RED); int fg = con_fg(f,FG_RED);
con_fprintf(f,"\nWARNING: this is an unstable beta version - use for testing only! Really.\n"); con_fprintf(f,"\nWARNING: this is an unstable beta version - use for testing only! Really.\n");
fg = con_fg(f,fg); fg = con_fg(f,fg);
UNUSED(fg);
} }
#endif #endif
+1
View File
@@ -103,6 +103,7 @@ static void pr_error(const char *iname, const char *msg, bool is_warning)
fg = con_fg(stderr,fg); fg = con_fg(stderr,fg);
UNUSED(is_warning); UNUSED(is_warning);
UNUSED(fg);
} }
+1 -1
View File
@@ -117,7 +117,7 @@ struct options_t {
bool ptinterp; // is PT_INTERP, so don't adjust auxv_t bool ptinterp; // is PT_INTERP, so don't adjust auxv_t
enum { SCRIPT_MAX = 32 }; enum { SCRIPT_MAX = 32 };
const char *script_name; const char *script_name;
} unix; } o_unix;
struct { struct {
bool le; bool le;
} watcom_le; } watcom_le;
+2 -2
View File
@@ -90,7 +90,7 @@ PackLinuxI386elf::buildLoader(const Filter *ft)
unsigned char tmp[sizeof(linux_i386elf_fold)]; unsigned char tmp[sizeof(linux_i386elf_fold)];
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold)); memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
checkPatch(NULL, 0, 0, 0); // reset checkPatch(NULL, 0, 0, 0); // reset
if (opt->unix.ptinterp) { if (opt->o_unix.ptinterp) {
unsigned j; unsigned j;
for (j = 0; j < sizeof(linux_i386elf_fold)-1; ++j) { for (j = 0; j < sizeof(linux_i386elf_fold)-1; ++j) {
if (0x60==tmp[ j] if (0x60==tmp[ j]
@@ -162,7 +162,7 @@ bool PackLinuxI386elf::canPack()
assert(exetype == 1); assert(exetype == 1);
// set options // set options
opt->unix.blocksize = blocksize = file_size; opt->o_unix.blocksize = blocksize = file_size;
return true; return true;
} }
+1 -1
View File
@@ -472,7 +472,7 @@ bool PackLinuxI386::canPack()
{ {
// NOTE: ELF executables are now handled by p_lx_elf.cpp, // NOTE: ELF executables are now handled by p_lx_elf.cpp,
// so we only handle them here if force_execve // so we only handle them here if force_execve
if (elf == 0 && opt->unix.force_execve) if (elf == 0 && opt->o_unix.force_execve)
exetype = 1; exetype = 1;
} }
else if (l == 0x00640107 || l == 0x00640108 || l == 0x0064010b || l == 0x006400cc) else if (l == 0x00640107 || l == 0x00640108 || l == 0x0064010b || l == 0x006400cc)
+3 -3
View File
@@ -42,7 +42,7 @@
// //
**************************************************************************/ **************************************************************************/
//#define SCRIPT_SIZE (opt->unix.SCRIPT_MAX + sizeof(l_info)) //#define SCRIPT_SIZE (opt->o_unix.SCRIPT_MAX + sizeof(l_info))
#define SCRIPT_SIZE (32 + sizeof(l_info)) #define SCRIPT_SIZE (32 + sizeof(l_info))
const upx_byte *PackLinuxI386sep::getLoader() const const upx_byte *PackLinuxI386sep::getLoader() const
@@ -50,7 +50,7 @@ const upx_byte *PackLinuxI386sep::getLoader() const
static char script[SCRIPT_SIZE]; static char script[SCRIPT_SIZE];
memset(script, 0, sizeof(script)); memset(script, 0, sizeof(script));
char const *name = opt->unix.script_name; char const *name = opt->o_unix.script_name;
if (0==name) { if (0==name) {
name = "/usr/local/lib/upxX"; name = "/usr/local/lib/upxX";
} }
@@ -77,7 +77,7 @@ int PackLinuxI386sep::getLoaderSize() const
int PackLinuxI386sep::getLoaderPrefixSize() const int PackLinuxI386sep::getLoaderPrefixSize() const
{ {
return opt->unix.SCRIPT_MAX; return opt->o_unix.SCRIPT_MAX;
} }
void PackLinuxI386sep::patchLoader() void PackLinuxI386sep::patchLoader()
+2 -3
View File
@@ -120,8 +120,7 @@ void PackUnix::pack1(OutputFile * /*fo*/, Filter & /*ft*/)
// derived class usually provides this // derived class usually provides this
} }
int int PackUnix::getStrategy(Filter &/*ft*/)
PackUnix::getStrategy(Filter &/*ft*/)
{ {
// Called just before reading and compressing each block. // Called just before reading and compressing each block.
// Might want to adjust blocksize, etc. // Might want to adjust blocksize, etc.
@@ -250,7 +249,7 @@ void PackUnix::pack(OutputFile *fo)
progid = 0; progid = 0;
// set options // set options
blocksize = opt->unix.blocksize; blocksize = opt->o_unix.blocksize;
if (blocksize <= 0) if (blocksize <= 0)
blocksize = BLOCKSIZE; blocksize = BLOCKSIZE;
if ((off_t)blocksize > file_size) if ((off_t)blocksize > file_size)
+1 -1
View File
@@ -194,7 +194,7 @@ static Packer* try_packers(InputFile *f, try_function func)
// //
// linux // linux
// //
if (!opt->unix.force_execve) if (!opt->o_unix.force_execve)
{ {
#if 0 #if 0
if (opt->unix.script_name) if (opt->unix.script_name)
+1 -1
View File
@@ -393,7 +393,7 @@ void UiPacker::endCallback()
// the callback // the callback
**************************************************************************/ **************************************************************************/
void __UPX_ENTRY UiPacker::callback(upx_uint isize, upx_uint osize, int state, void *user) void __UPX_CDECL UiPacker::callback(upx_uint isize, upx_uint osize, int state, void *user)
{ {
//printf("%6d %6d %d\n", isize, osize, state); //printf("%6d %6d %d\n", isize, osize, state);
if (state != -1 && state != 3) return; if (state != -1 && state != 3) return;
+1 -1
View File
@@ -81,7 +81,7 @@ public:
virtual void endCallback(); virtual void endCallback();
virtual cb_t *getCallback() { return &cb; } virtual cb_t *getCallback() { return &cb; }
protected: protected:
static void __UPX_ENTRY callback(upx_uint isize, upx_uint osize, static void __UPX_CDECL callback(upx_uint isize, upx_uint osize,
int, void *); int, void *);
virtual void doCallback(unsigned isize, unsigned osize); virtual void doCallback(unsigned isize, unsigned osize);