summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/i386/midipix.opt8
-rw-r--r--libc/cbb-musl-pe.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/config/i386/midipix.opt b/gcc/config/i386/midipix.opt
index 541e3cab8..3b6d4c235 100644
--- a/gcc/config/i386/midipix.opt
+++ b/gcc/config/i386/midipix.opt
@@ -59,4 +59,12 @@ mvrfs
Target
default to a virtual root file system (aka standalone application)
+mforeign
+Target
+do not link crti.o into the output executable or dynamic library
+
+mconsole
+Target
+set image subsystem to `console' (default is `windows')
+
; Retain blank line above
diff --git a/libc/cbb-musl-pe.h b/libc/cbb-musl-pe.h
index 13f25b15c..1c073930e 100644
--- a/libc/cbb-musl-pe.h
+++ b/libc/cbb-musl-pe.h
@@ -81,7 +81,7 @@ extern "C" {
" --as-needed -lldso}}}"
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%R/lib/crti.o " \
+#define STARTFILE_SPEC "%{!mforeign:%R/lib/crti.o} " \
"%{!shared:%{mposix:%R/lib/crtposix.o}} " \
"%{!shared:%{mdinga:%R/lib/crtdinga.o}} " \
"%{!shared:%{mldso:" \
@@ -134,7 +134,7 @@ extern "C" {
"%{!shared:--image-base 0x1920000} " \
"%{shared:--entry __so_entry_point} " \
"%{shared:--enable-auto-image-base} " \
- "--subsystem windows " \
+ "--subsystem %{mconsole:console;:windows} " \
LINK_DSO_SYM_SPEC
#undef SUBTARGET_EXTRA_SPECS