Raised This Month: $68 Target: $400
 17% 

Lots of jit errors on compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 06-16-2009 , 06:12   Lots of jit errors on compile
Reply With Quote #1

Im trying to compile my plugin for linux, and im getting spammed to death with the errors below. I dont know whats going on, as the headers are obviously being included. I went and checked and I actually dont see how jit_uint8_t is declared (i see its in helpers, but x86_macros.h doesnt include helpers) so any help on what exactly I am doing wrong would be most appreciated.

Code:
../../sourcemod-sdk/public/jit/x86/x86_macros.h: In function ‘void IA32_SetCC_Rm8(JitWriter*, int, int)’:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1517: error: ‘ia32_modrm’ was not declared in this scope
../../sourcemod-sdk/public/jit/x86/x86_macros.h: At global scope:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1520: error: ‘jit_uint8_t’ has not been declared
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1520: error: ‘jit_uint8_t’ has not been declared
../../sourcemod-sdk/public/jit/x86/x86_macros.h: In function ‘void IA32_CmovCC_Rm(JitWriter*, int, int)’:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1524: error: ‘ia32_modrm’ was not declared in this scope
../../sourcemod-sdk/public/jit/x86/x86_macros.h: At global scope:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1527: error: ‘jit_uint8_t’ has not been declared
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1527: error: ‘jit_uint8_t’ has not been declared
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1527: error: ‘jit_int8_t’ has not been declared
../../sourcemod-sdk/public/jit/x86/x86_macros.h: In function ‘void IA32_CmovCC_Rm_Disp8(JitWriter*, int, int, int)’:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1531: error: ‘ia32_modrm’ was not declared in this scope
__________________
CrimsonGT is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 06-16-2009 , 08:17   Re: Lots of jit errors on compile
Reply With Quote #2

I haven't seen these before, so a look at your Makefile would be helpful. Otherwise, make sure whatever file defines "ia32_modrm" is in your include path.
Keeper is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 06-16-2009 , 16:22   Re: Lots of jit errors on compile
Reply With Quote #3

yeah I havent either, heres my makefile. It looks like ia32_modrn is in x86_macros.h as...

inline jit_uint8_t ia32_modrm(jit_uint8_t mode, jit_uint8_t reg, jit_uint8_t rm)
{
jit_uint8_t modrm = (mode << 6);

modrm |= (reg << 3);
modrm |= (rm);

return modrm;
}

Code:
# (C)2004-2008 Metamod:Source Development Team
# Makefile written by David "BAILOPAN" Anderson

###########################################
### EDIT THESE PATHS FOR YOUR OWN SETUP ###
###########################################

HL2SDK_ORIG = ../../hl2sdk
HL2SDK_OB = ../../hl2sdk-ob
HL2SDK_L4D = ../../hl2sdk-l4d
SMSDK = ../../sourcemod-sdk
MMSOURCE17 = ../../metamod-sdk
SRCDS_BASE = ~/srcds

#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
#####################################

OBJECTS = main_mm.cpp CGameConf/gameconf.cpp CDetour/detours.cpp asm/asm.c
BINARY = main_i486.so

############################################# #
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
############################################# #

OPT_FLAGS = -O3 -funroll-loops -s -pipe
GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
DEBUG_FLAGS = -g -ggdb3 -D_DEBUG
CPP = gcc

override ENGSET = false
ifeq "$(ENGINE)" "original"
HL2SDK = $(HL2SDK_ORIG)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/linux_sdk
CFLAGS += -DSOURCE_ENGINE=1
METAMOD = $(MMSOURCE17)/core-legacy
INCLUDE += -I$(HL2SDK)/public/dlls
SRCDS = $(SRCDS_BASE)
override ENGSET = true
endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=3
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I$(HL2SDK)/public/game/server -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
SRCDS = $(SRCDS_BASE)/orangebox
override ENGSET = true
endif
ifeq "$(ENGINE)" "left4dead"
HL2SDK = $(HL2SDK_L4D)
HL2PUB = $(HL2SDK)/public
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=4
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/l4d
override ENGSET = true
endif

CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4

LINK += $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc

INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I. -I$(METAMOD) -I$(METAMOD)/sourcehook

############################################# ###
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
############################################# ###

ifeq "$(DEBUG)" "true"
BIN_DIR = Debug.$(ENGINE)
CFLAGS += $(DEBUG_FLAGS)
else
BIN_DIR = Release.$(ENGINE)
CFLAGS += $(OPT_FLAGS)
endif

GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)

CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
-Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions \
-fno-rtti -msse -m32 -fno-strict-aliasing

ifeq "$(GCC_VERSION)" "4"
CFLAGS += $(GCC4_FLAGS)
endif

OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)

$(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) -o [email protected] -c $<

all: check
mkdir -p $(BIN_DIR)
rm -f vstdlib_i486.so
rm -f tier0_i486.so
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
$(MAKE) -f Makefile sample_mm

check:
if [ "$(ENGSET)" = "false" ]; then \
echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
exit 1; \
fi

sample_mm: check $(OBJ_LINUX)
$(CPP) $(INCLUDE) -m32 $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)

default: all

clean: check
rm -rf $(BIN_DIR)/*.o
rm -rf $(BIN_DIR)/$(BINARY)
__________________
CrimsonGT is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-16-2009 , 16:31   Re: Lots of jit errors on compile
Reply With Quote #4

Code:
../../sourcemod-sdk/public/jit/x86/x86_macros.h:1520: error: ‘jit_uint8_t’ has not been declared
First guess: if that is undeclared it might be that the compiler won't want to know the modrm function which returns a jit_uint8_t .

So I'd try to grep the files for jit_uint8_t, if there's no typedef, do something like
Code:
typedef unsigned char jit_uint8_t;

(Note: Most probably this won't be your problem but it might.)
__________________
hello, i am pm
PM is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 06-16-2009 , 19:04   Re: Lots of jit errors on compile
Reply With Quote #5

That fixed it, I just added the typedefs to the top of the header file the include was in and it got rid of them. Not sure why as the jit helpers was included first so it should have been taken care of there but ah well.

Got a couple more errors I dont really know how to combat if you guys have any ideas.

Thanks again for the help, linux compiling makes me want to scream.

Code:
In file included from /usr/include/signal.h:353,
                 from ../../metamod-sdk/core/sourcehook/sh_memory.h:27,
                 from CDetour/detours.cpp:45:
/usr/include/sys/ucontext.h:168: error: expected identifier before numeric constant
/usr/include/sys/ucontext.h:168: error: expected `}' before numeric constant
/usr/include/sys/ucontext.h:168: error: expected unqualified-id before numeric constant
In file included from ../../metamod-sdk/core/sourcehook/sh_memory.h:27,
                 from CDetour/detours.cpp:45:
/usr/include/signal.h:402: error: expected declaration before ‘}’ token
make[1]: *** [Release.orangebox/CDetour/detours.o] Error 1
make[1]: Leaving directory `/home/brett/mmsource/metamod-sdk/main'
make: *** [all] Error 2
[email protected]:~/mmsource/metamod-sdk/main$
__________________
CrimsonGT is offline
BAILOPAN
Join Date: Jan 2004
Old 06-17-2009 , 07:48   Re: Lots of jit errors on compile
Reply With Quote #6

Quote:
Originally Posted by CrimsonGT View Post
That fixed it, I just added the typedefs to the top of the header file the include was in and it got rid of them. Not sure why as the jit helpers was included first so it should have been taken care of there but ah well.
It is REALLY wrong to do that! You should be including files properly. Either your include path is wrong, or you're directly including something you shouldn't. The file is jit_helpers.h in the SMSDK, and sourcehook_hookmangen.h for the MM:S SDK.
__________________
egg

Last edited by BAILOPAN; 06-17-2009 at 07:51.
BAILOPAN is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 06-18-2009 , 16:55   Re: Lots of jit errors on compile
Reply With Quote #7

If I had a nickle for everytime something I did in MMS was clearly pointed out as wrong by you, I would...probably have a dollar or two lol.

This is some code from pred I was using, that I dont think was ever tested in linux so your probably right about just a messed up include path or something.
__________________
CrimsonGT is offline
Downtown1
Veteran Member
Join Date: Mar 2004
Old 06-27-2009 , 04:20   Re: Lots of jit errors on compile
Reply With Quote #8

Did you ever figure this out? Aside from using SourceMod Extensions GPLd code in a MMS plugin .
Downtown1 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:16.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode