diff options
Diffstat (limited to 'wirish/main.cxx')
-rw-r--r-- | wirish/main.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wirish/main.cxx b/wirish/main.cxx index d13e2eb..f0158f8 100644 --- a/wirish/main.cxx +++ b/wirish/main.cxx @@ -22,9 +22,14 @@ * THE SOFTWARE.
* ****************************************************************************/
+// Force init to be called *first*, i.e. before static object allocation.
+// Otherwise, statically allocated object that need libmaple may fail.
+ __attribute__(( constructor )) void premain() {
+ init();
+}
+
int main(void)
{
- init();
setup();
while (1) {
|