diff --git a/compiler/amxxpc/Makefile b/compiler/amxxpc/Makefile
index c94ab5ad..e355774e 100755
--- a/compiler/amxxpc/Makefile
+++ b/compiler/amxxpc/Makefile
@@ -3,14 +3,14 @@
### EDIT BELOW FOR OTHER PROJECTS ###
-OPT_FLAGS = -O3 -fno-rtti -funroll-loops -s -pipe
+OPT_FLAGS = -O3 -funroll-loops -s -pipe
DEBUG_FLAGS = -g -ggdb3
-CPP = g++
+CPP = gcc
BINARY = amxxpc
OBJECTS = amx.cpp amxxpc.cpp Binary.cpp
-LINK = -lz
+LINK = -lz /lib/libstdc++.a
INCLUDE = -I. -L.
@@ -22,7 +22,7 @@ else
CFLAGS = $(OPT_FLAGS)
endif
-CFLAGS += -DLINUX -DNDEBUG -Wno-deprecated -fexceptions -DHAVE_STDINT_H -DAMX_ANSIONLY
+CFLAGS += -DLINUX -DNDEBUG -Wno-deprecated -fexceptions -DHAVE_STDINT_H -DAMX_ANSIONLY -fno-rtti -static-libgcc
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
diff --git a/compiler/amxxpc/amxxpc.cpp b/compiler/amxxpc/amxxpc.cpp
index 63a623eb..e405893c 100755
--- a/compiler/amxxpc/amxxpc.cpp
+++ b/compiler/amxxpc/amxxpc.cpp
@@ -99,7 +99,6 @@ int main(int argc, char **argv)
fclose(fp);
}
- dlclose(lib);
unlink(file);
HINSTANCE lib64 = 0;
@@ -108,8 +107,7 @@ int main(int argc, char **argv)
#else
lib64 = dlmount("amxxpc64.dll");
#endif
- pc_printf = (PRINTF)dlsym(lib64, "pc_printf");
- if (!lib64 || !pc_printf)
+ if (!lib64)
{
pc_printf("64bit compiler failed to instantiate.\n");
exit(0);
@@ -129,6 +127,8 @@ int main(int argc, char **argv)
sc64(argc, argv);
+ dlclose(lib64);
+
if (file == NULL)
{
pc_printf("Could not locate the output file on second pass.\n");
@@ -207,7 +207,7 @@ int main(int argc, char **argv)
pc_printf("Done.\n");
- dlclose(lib64);
+ dlclose(lib);
exit(0);
}
diff --git a/compiler/libpc300/Makefile b/compiler/libpc300/Makefile
index 36bf05bb..b60fe7b0 100755
--- a/compiler/libpc300/Makefile
+++ b/compiler/libpc300/Makefile
@@ -3,7 +3,7 @@
### EDIT BELOW FOR OTHER PROJECTS ###
-OPT_FLAGS = -O3 -fno-rtti -funroll-loops -s -pipe
+OPT_FLAGS = -O3 -funroll-loops -s -pipe
DEBUG_FLAGS = -g -ggdb3
CPP = gcc
NAME = amxxpc
@@ -25,7 +25,7 @@ else
CFLAGS += -DPAWN_CELL_SIZE=32
endif
-CFLAGS += -DLINUX -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -DENABLE_BINRELOC -DNO_MAIN -DPAWNC_DLL
+CFLAGS += -DLINUX -DNDEBUG -fPIC -DHAVE_STDINT_H -DENABLE_BINRELOC -DNO_MAIN -DPAWNC_DLL -static-libgcc
CFLAGS += $(OPT_FLAGS)
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
@@ -42,9 +42,6 @@ all:
pawn_make: $(OBJ_LINUX)
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
-pawn64:
- $(MAKE) pawn_make PAWN64=true
-
debug:
$(MAKE) all DEBUG=true
diff --git a/compiler/libpc300/libpc300.vcproj b/compiler/libpc300/libpc300.vcproj
index ce25e04d..cf897b05 100755
--- a/compiler/libpc300/libpc300.vcproj
+++ b/compiler/libpc300/libpc300.vcproj
@@ -247,6 +247,9 @@
+
+
diff --git a/compiler/libpc300/sc.h b/compiler/libpc300/sc.h
index 88a9dfc4..6d885527 100755
--- a/compiler/libpc300/sc.h
+++ b/compiler/libpc300/sc.h
@@ -629,11 +629,7 @@ SC_FUNC void jmp_eq0(int number);
SC_FUNC void outval(cell val,int newline);
/* function prototypes in SC5.C */
-#ifdef __linux__
-SC_FUNC int error(int number,...) __attribute__((visibility("internal")));
-#else
-SC_FUNC int error(int number,...)
-#endif
+SC_FUNC int error(int number,...) __attribute__((visibility("protected")));
SC_FUNC void errorset(int code);
/* function prototypes in SC6.C */
diff --git a/compiler/libpc300/sc1.c b/compiler/libpc300/sc1.c
index 82889cb1..2fff3a93 100755
--- a/compiler/libpc300/sc1.c
+++ b/compiler/libpc300/sc1.c
@@ -654,7 +654,6 @@ cleanup:
int flag_exceed=0;
if (sc_amxlimit > 0 && (long)(hdrsize+code_idx+glb_declared*sizeof(cell)+sc_stksize*sizeof(cell)) >= sc_amxlimit)
flag_exceed=1;
-#if PAWN_CELL_SIZE==32
if ((sc_debug & sSYMBOLIC)!=0 || verbosity>=2 || stacksize+32>=(long)sc_stksize || flag_exceed) {
pc_printf("Header size: %8ld bytes\n", (long)hdrsize);
pc_printf("Code size: %8ld bytes\n", (long)code_idx);
@@ -666,7 +665,6 @@ cleanup:
pc_printf("estimated max. usage=%ld cells (%ld bytes)\n",stacksize,stacksize*sizeof(cell));
pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)sc_stksize*sizeof(cell));
} /* if */
-#endif
if (flag_exceed)
error(106,sc_amxlimit); /* this causes a jump back to label "cleanup" */
} /* if */
@@ -1921,8 +1919,8 @@ static int declloc(int fstatic)
* of a global variable or to that of a local variable at a lower
* level might indicate a bug.
*/
- if ((sym=findloc(name))!=NULL && sym->compound!=nestlevel || findglb(name)!=NULL);
- //error(219,name); /* variable shadows another symbol */
+ if ((sym=findloc(name))!=NULL && sym->compound!=nestlevel || findglb(name)!=NULL)
+ error(219,name); /* variable shadows another symbol */
while (matchtoken('[')){
ident=iARRAY;
if (numdim == sDIMEN_MAX) {
@@ -3645,8 +3643,8 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags,
if (argsym!=NULL) {
error(21,name); /* symbol already defined */
} else {
- if ((argsym=findglb(name))!=NULL && argsym->ident!=iFUNCTN) ;
- //error(219,name); /* variable shadows another symbol */
+ if ((argsym=findglb(name))!=NULL && argsym->ident!=iFUNCTN)
+ error(219,name); /* variable shadows another symbol */
/* add details of type and address */
assert(numtags>0);
argsym=addvariable(name,offset,ident,sLOCAL,tags[0],