History

OpenBSD: x86 update

herman ten brugge committed 5 years ago

Commit cd91ea61 parent bbc70703 files · +10 −5Browse files

Unified · Split

3 files
  1. i386-gen.c +4 −4
  2. libtcc.c +5 −0
  3. tests/Makefile +1 −1
i386-gen.c+4−4
@@ -379,7 +379,7 @@ static uint8_t fastcallw_regs[2] = { TREG_ECX, TREG_EDX }; · 378 unmodified lines
379 returning via struct pointer. */379 returning via struct pointer. */
380ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize)380ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize)
381{381{
382#if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD382#if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD || TARGETOS_OpenBSD
383 int size, align;383 int size, align;
384 *ret_align = 1; // Never have to re-align return values for x86384 *ret_align = 1; // Never have to re-align return values for x86
385 *regsize = 4;385 *regsize = 4;
@@ -495,7 +495,7 @@ ST_FUNC void gfunc_call(int nb_args) · 109 unmodified lines
495 args_size -= 4;495 args_size -= 4;
496 }496 }
497 }497 }
498#if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD498#if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD || TARGETOS_OpenBSD
499 else if ((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT)499 else if ((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT)
500 args_size -= 4;500 args_size -= 4;
501#endif501#endif
@@ -545,7 +545,7 @@ ST_FUNC void gfunc_prolog(Sym *func_sym) · 43 unmodified lines
545 func_sub_sp_offset = ind;545 func_sub_sp_offset = ind;
546 /* if the function returns a structure, then add an546 /* if the function returns a structure, then add an
547 implicit pointer parameter */547 implicit pointer parameter */
548#if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD548#if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD || TARGETOS_OpenBSD
549 size = type_size(&func_vt,&align);549 size = type_size(&func_vt,&align);
550 if (((func_vt.t & VT_BTYPE) == VT_STRUCT)550 if (((func_vt.t & VT_BTYPE) == VT_STRUCT)
551 && (size > 8 || (size & (size - 1)))) {551 && (size > 8 || (size & (size - 1)))) {
@@ -586,7 +586,7 @@ ST_FUNC void gfunc_prolog(Sym *func_sym) · 34 unmodified lines
586 /* pascal type call or fastcall ? */586 /* pascal type call or fastcall ? */
587 if (func_call == FUNC_STDCALL || func_call == FUNC_FASTCALLW)587 if (func_call == FUNC_STDCALL || func_call == FUNC_FASTCALLW)
588 func_ret_sub = addr - 8;588 func_ret_sub = addr - 8;
589#if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD589#if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD || TARGETOS_OpenBSD
590 else if (func_vc)590 else if (func_vc)
591 func_ret_sub = 4;591 func_ret_sub = 4;
592#endif592#endif
libtcc.c+5−0
@@ -1477,6 +1477,11 @@ static int tcc_set_linker(TCCState *s, const char *option) · 1476 unmodified lines
1477 s->filetype |= AFF_WHOLE_ARCHIVE;1477 s->filetype |= AFF_WHOLE_ARCHIVE;
1478 else1478 else
1479 s->filetype &= ~AFF_WHOLE_ARCHIVE;1479 s->filetype &= ~AFF_WHOLE_ARCHIVE;
1480 } else if (ret = link_option(option, "z=", &p), ret) {
1481 if (!strcmp(p, "notext"))
1482 ; /* ignore */
1483 else
1484 goto err;
1480 } else if (p) {1485 } else if (p) {
1481 return 0;1486 return 0;
1482 } else {1487 } else {
tests/Makefile+1−1
@@ -56,7 +56,7 @@ endif · 55 unmodified lines
56ifeq ($(ARCH),i386)56ifeq ($(ARCH),i386)
57# tcctest.c:get_asm_string uses a construct that is checked too strictly57# tcctest.c:get_asm_string uses a construct that is checked too strictly
58# by GCC in 32bit mode when PIC is enabled.58# by GCC in 32bit mode when PIC is enabled.
59test.ref: CFLAGS+=-fno-PIC -fno-PIE59test.ref: CFLAGS+=-fno-PIC -fno-PIE -Wl,-z,notext
60endif60endif
61ifeq ($(CC_NAME),msvc)61ifeq ($(CC_NAME),msvc)
62test.ref abitest : CC = gcc62test.ref abitest : CC = gcc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t