History

OpenBSD: Fix crt startup names - WIP

Christian Jullien committed 5 years ago

Commit dfe031c1 parent 4e12c2a2 files · +10 −2Browse files

Unified · Split

2 files
  1. libtcc.c +5 −1
  2. tccelf.c +5 −1
libtcc.c+5−1
@@ -1091,7 +1091,11 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) · 1090 unmodified lines
10911091 /* add libc crt1/crti objects */
10921092 if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) &&
10931093 !s->nostdlib) {
1094−#ifndef TCC_TARGET_MACHO
1094+#if defined(__OpenBSD__)
1095+ if (output_type != TCC_OUTPUT_DLL)
1096+ tcc_add_crt(s, "crt0.o");
1097+ tcc_add_crt(s, "crtbegin.o");
1098+#elif !defined(TCC_TARGET_MACHO)
10951099 /* Mach-O with LC_MAIN doesn't need any crt startup code. */
10961100 if (output_type != TCC_OUTPUT_DLL)
10971101 tcc_add_crt(s, "crt1.o");
tccelf.c+5−1
@@ -1429,7 +1429,11 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1428 unmodified lines
14291429 #endif
14301430 if (strlen(TCC_LIBTCC1) > 0)
14311431 tcc_add_support(s1, TCC_LIBTCC1);
1432−#ifndef TCC_TARGET_MACHO
1432+#if defined(__OpenBSD__)
1433+ /* add crt end if not memory output */
1434+ if (s1->output_type != TCC_OUTPUT_MEMORY)
1435+ tcc_add_crt(s1, "crtend.o");
1436+#elif !defined(TCC_TARGET_MACHO)
14331437 /* add crt end if not memory output */
14341438 if (s1->output_type != TCC_OUTPUT_MEMORY)
14351439 tcc_add_crt(s1, "crtn.o");

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