Skip to content

Commit

Permalink
literal in vararg sysv
Browse files Browse the repository at this point in the history
  • Loading branch information
John Hankinson committed Jun 7, 2017
1 parent 35009de commit 10b8722
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions NIX64_Makefile
@@ -0,0 +1,60 @@

# This makefile creates the HJWasm Elf binary for Linux/FreeBSD.

TARGET1=hjwasm

ifndef DEBUG
DEBUG=0
endif

inc_dirs = -IH

#cflags stuff

ifeq ($(DEBUG),0)
extra_c_flags = -DNDEBUG -O2 -ansi -funsigned-char -fwritable-strings
OUTD=GccUnixR
else
extra_c_flags = -DDEBUG_OUT -g
OUTD=GccUnixD
endif

c_flags =-D __UNIX__ $(extra_c_flags)

CC = clang-3.8

.SUFFIXES:
.SUFFIXES: .c .o

include gccmod.inc

#.c.o:
# $(CC) -c $(inc_dirs) $(c_flags) -o $(OUTD)/$*.o $<
$(OUTD)/%.o: %.c
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $(OUTD)/$*.o $<

all: $(OUTD) $(OUTD)/$(TARGET1)

$(OUTD):
mkdir $(OUTD)

$(OUTD)/$(TARGET1) : $(OUTD)/main.o $(proj_obj)
ifeq ($(DEBUG),0)
$(CC) -D __UNIX__ $(OUTD)/main.o $(proj_obj) -s -o $@ -Wl,-Map,$(OUTD)/$(TARGET1).map
else
$(CC) -D __UNIX__ $(OUTD)/main.o $(proj_obj) -o $@ -Wl,-Map,$(OUTD)/$(TARGET1).map
endif

$(OUTD)/msgtext.o: msgtext.c H/msgdef.h
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $*.o msgtext.c

$(OUTD)/reswords.o: reswords.c H/instruct.h H/special.h H/directve.h H/opndcls.h H/instravx.h
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $*.o reswords.c

######

clean:
rm $(OUTD)/$(TARGET1)
rm $(OUTD)/*.o
rm $(OUTD)/*.map

2 changes: 1 addition & 1 deletion invoke.c
Expand Up @@ -2661,7 +2661,7 @@ static int sysv_param(struct dsym const *proc, int index, struct dsym *param, bo
psize = SizeFromRegister(opnd->base_reg->tokval);
else if (opnd->mem_type != MT_EMPTY)
psize = SizeFromMemtype(opnd->mem_type, USE64, opnd->type);
if (addr)
if (addr || opnd->instr == T_OFFSET)
psize = 8;
if (param->sym.mem_type == MT_PTR && psize != 8)
{
Expand Down

0 comments on commit 10b8722

Please sign in to comment.