summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-12-15 08:41:18 -0500
committermidipix <writeonce@midipix.org>2017-12-15 08:41:18 -0500
commit25ca4eec0d68d389ec497412266fcb9d5e3e59cf (patch)
tree91dd5408ed23d232b11c9d118499b175b7e971d0
parent48b240ad113408eaf0ae7ab4b8da95e4d5aba511 (diff)
downloadcbb-gcc-4.6.4-25ca4eec0d68d389ec497412266fcb9d5e3e59cf.tar.bz2
cbb-gcc-4.6.4-25ca4eec0d68d389ec497412266fcb9d5e3e59cf.tar.xz
midipix targets: specs: added -mforeign and -mconsole support.
-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