crt: Simplify msvcrt.dll arm workarounds for __initenv

Remove arch specific ifdefs and instead add dummy symbols to the
arm specific import libs.

Also add a dummy symbol for __winitenv, fixing building apps
that use a wmain() function for arm/aarch64 when targeting msvcrt.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index c44de20..5e7c0c7 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -287,6 +287,7 @@
   misc/__p__fmode.c \
   misc/__p__wcmdln.c \
   misc/_getpid.c \
+  misc/initenv.c \
   stdio/_setmaxstdio.c \
   stdio/gets.c
 
@@ -382,6 +383,7 @@
   misc/__p__fmode.c \
   misc/__p__wcmdln.c \
   misc/_getpid.c \
+  misc/initenv.c \
   stdio/_setmaxstdio.c \
   stdio/gets.c
 
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index e788005..54bb204 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -34,7 +34,7 @@
 #define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
 #endif
 
-#if !defined(__initenv) && !defined(__arm__) && !defined(__aarch64__)
+#if !defined(__initenv)
 extern char *** __MINGW_IMP_SYMBOL(__initenv);
 #define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
 #endif
@@ -327,9 +327,7 @@
        gcc inserts this call automatically for a function called main, but not for wmain.  */
     mainret = wmain (argc, argv, envp);
 #else
-#if !defined(__arm__) && !defined(__aarch64__)
     __initenv = envp;
-#endif
     mainret = main (argc, argv, envp);
 #endif
     if (!managedapp)
diff --git a/mingw-w64-crt/include/internal.h b/mingw-w64-crt/include/internal.h
index 205d30d..8a7aeb1 100644
--- a/mingw-w64-crt/include/internal.h
+++ b/mingw-w64-crt/include/internal.h
@@ -101,7 +101,7 @@
 #define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
 #endif
 
-#if !defined(__initenv) && !defined(__arm__)
+#if !defined(__initenv)
 extern char *** __MINGW_IMP_SYMBOL(__initenv);
 #define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
 #endif
diff --git a/mingw-w64-crt/misc/initenv.c b/mingw-w64-crt/misc/initenv.c
new file mode 100644
index 0000000..0cfad4f
--- /dev/null
+++ b/mingw-w64-crt/misc/initenv.c
@@ -0,0 +1,12 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <wchar.h>
+
+static char ** local__initenv;
+static wchar_t ** local__winitenv;
+char *** __MINGW_IMP_SYMBOL(__initenv) = &local__initenv;
+wchar_t *** __MINGW_IMP_SYMBOL(__winitenv) = &local__winitenv;