Mednafen Members Members   Search Search   Help Help   Register Register   Login Login   Home Home
Home » Mednafen » Development » Mednafen build failing because of recent changes to MinGW_w64
Show: Today's Messages  :: Show Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Mednafen build failing because of recent changes to MinGW_w64 [message #6532] Tue, 21 September 2021 14:47 Go to next message
elmer  [PM]
In the source file mednafen/src/drivers/main.cpp, at around line 2000, reference is made to an external variable "mingw_app_type", which is then changed a few lines later on in the function main();

On 2021-06-14 one of the MinGW_w64 developers renamed the variable to "__mingw_app_type", and so mednafen builds break with the latest versions of MinGW_w64.

Please see the MinGW_w64 mailing list archive entry at ...
https://sourceforge.net/p/mingw-w64/mailman/message/37302602/


Changing the references in main.cpp to the new name allows me to build mednafen again, but there is definitely a question as to whether mednafen needs to be modifying this internal mingw crt variable.
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6538 is a reply to message #6532 ] Sat, 25 September 2021 13:54 Go to previous messageGo to next message
elmer  [PM]
FWIW, even with this change, I am no longer able to build a working version of Mednafen under MSYS2 on Windows anymore, because the build crashes on startup.

To get around this, I am following the instructions in this thread ...
https://forum.fobby.net/index.php?t=msg&&th=2004&goto=6452#msg_6452

... and am able to successfully cross-compile builds for Windows on a Linux (virtual) machine.
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6539 is a reply to message #6538 ] Sat, 25 September 2021 16:08 Go to previous messageGo to next message
Administrator  [PM]
Any messages outputted before it crashes?
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6540 is a reply to message #6539 ] Sun, 26 September 2021 23:03 Go to previous messageGo to next message
doomday45  [PM]
I use ./configure && make -j14
in Msys2 and no problem with build
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6542 is a reply to message #6540 ] Mon, 27 September 2021 11:55 Go to previous messageGo to next message
elmer  [PM]
doomday45 wrote on Sun, 26 September 2021 23:03

I use ./configure && make -j14
in Msys2 and no problem with build


I wish that I could report the same, but I just can't.

I have updated MSYS2 with the latest changes this morning, and my mednafen 1.27.1 build still won't work for me.

OTOH, mednafen 1.26.1 builds and work fine with the latest MSYS2.
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6543 is a reply to message #6539 ] Mon, 27 September 2021 12:06 Go to previous messageGo to next message
elmer  [PM]
Administrator wrote on Sat, 25 September 2021 16:08

Any messages outputted before it crashes?


I updated MSYS2 with all of the latest package changes this morning, and have run some tests with the last 3 releases of the mednafen source.

From what I can see, I *guess* that you've done some work recently to get mednafen building with unicode (16-bit-characters) on Windows.

Here are my results ...

************************

Testing Mednafen 1.24.3 ...

a) Failed to build with "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1".


b) Built without "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1", and running correctly.

Starting Mednafen 1.24.3
 Build information:
   Compiled with gcc 10.3.0
   Running with MinGW-W64 Runtime 10.0.0 (alpha - rev. 0) 0000-00-00
   Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x00000065)
   Compiled against libiconv 16.1, running with libiconv 16.1
   Compiled against SDL 2.0.14(hg-14525:e52d96ea04fc), running with SDL 2.0.14(hg-14525:e52d96ea04fc)
   Running with libsndfile-1.0.31
 Base directory: D:\retrogamedev\tools\msys64\tools\bin\mednafen
 Emulation modules: apple2 nes snes gb gba pce lynx md pcfx ngp psx ss ssfplay vb wswan sms gg snes_faust pce_fast demo cdplay
 Opening lockfile...

************************

Testing Mednafen 1.26.1 ...

a) Failed to build with "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1".


b) Built without "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1", and running correctly.

Starting Mednafen 1.26.1
 Build information:
   Compiled with gcc 10.3.0
   Running with MinGW-W64 Runtime 10.0.0 (alpha - rev. 0) 0000-00-00
   Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x00000065)
   Compiled against libiconv 16.1, running with libiconv 16.1
   Compiled against SDL 2.0.14(hg-14525:e52d96ea04fc), running with SDL 2.0.14(hg-14525:e52d96ea04fc)
   Running with libsndfile-1.0.31
 Base directory: D:\retrogamedev\tools\msys64\tools\bin\mednafen
 Emulation modules: apple2 nes snes gb gba pce lynx md pcfx ngp psx ss ssfplay vb wswan sms gg snes_faust pce_fast demo cdplay
 Opening lockfile...

************************

Testing Mednafen 1.27.1 ...

a) Build with "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1".

Starting Mednafen 1.27.1
 Build information:
   Compiled with gcc 10.3.0
   Running with MinGW-W64 Runtime 10.0.0 (alpha - rev. 0) 0000-00-00
   Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x00000065)
   Compiled against libiconv 16.1, running with libiconv 16.1
   Compiled against SDL 2.0.14(hg-14525:e52d96ea04fc), running with SDL 2.0.14(hg-14525:e52d96ea04fc)

Mednafen then crashes and the following information is shown in the dialog box ...

 Problem signature:
   Problem Event Name:	APPCRASH
   Application Name:	mednafen.exe
   Application Version:	1.27.1.2064
   Application Timestamp:	00000000
   Fault Module Name:	mednafen.exe
   Fault Module Version:	1.27.1.2064
   Fault Module Timestamp:	00000000
   Exception Code:	c0000005
   Exception Offset:	00000000004284f5
   OS Version:	6.1.7601.2.1.0.256.48
   Locale ID:	1033
   Additional Information 1:	7a1c
   Additional Information 2:	7a1c4b3312f223f36a9882319f7a4f47
   Additional Information 3:	5732
   Additional Information 4:	573215fd4a3f0ea71b54080da9fad18c


b) Built without "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1".

Mednafen detects that it is running an 8-bit-character build and exits with the message ...

 This special build of Mednafen is intended for use on Windows 98, Windows 98SE,
 and Windows Me.  It will perform suboptimally on NT-based versions of Windows.
 Download a regular Windows build from https://mednafen.github.io/releases/


c) Built without "export CPPFLAGS=-DUNICODE=1\ -D_UNICODE=1", and commenting out test in "src/drivers/main.cpp" at line 2101 ...

Starting Mednafen 1.27.1
 Build information:
   Compiled with gcc 10.3.0
   Running with MinGW-W64 Runtime 10.0.0 (alpha - rev. 0) 0000-00-00
   Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x00000065)
   Compiled against libiconv 16.1, running with libiconv 16.1
   Compiled against SDL 2.0.14(hg-14525:e52d96ea04fc), running with SDL 2.0.14(hg-14525:e52d96ea04fc)

Mednafen then crashes and the following information is shown in the dialog box ...

 Problem signature:
   Problem Event Name:	APPCRASH
   Application Name:	mednafen.exe
   Application Version:	1.27.1.98
   Application Timestamp:	00000000
   Fault Module Name:	mednafen.exe
   Fault Module Version:	1.27.1.98
   Fault Module Timestamp:	00000000
   Exception Code:	c0000005
   Exception Offset:	000000000042858d
   OS Version:	6.1.7601.2.1.0.256.48
   Locale ID:	1033
   Additional Information 1:	7a1c
   Additional Information 2:	7a1c4b3312f223f36a9882319f7a4f47
   Additional Information 3:	9351
   Additional Information 4:	93514ee8a637d97022cb0dfecc66e547
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6544 is a reply to message #6543 ] Mon, 27 September 2021 16:06 Go to previous messageGo to next message
Administrator  [PM]
libFLAC is missing a __declspec(dllimport) on the FLAC__VERSION_STRING extern, which causes a crash when a program compiled with the -mcmodel=small flag tries to access it.

https://github.com/xiph/flac/commit/b917d456d23c3268cc6f466d720605b713d7b9ff#diff-571262578c61d5280957a1a680a2f7b09f2cb558c6be95fde86857b30f41dc82

...might fix it, FWIW.
Re: Mednafen build failing because of recent changes to MinGW_w64 [message #6545 is a reply to message #6544 ] Tue, 28 September 2021 14:00 Go to previous message
elmer  [PM]
Administrator wrote on Mon, 27 September 2021 16:06

https://github.com/xiph/flac/commit/b917d456d23c3268cc6f466d720605b713d7b9ff#diff-571262578c61d5280957a1a680a2f7b09f2cb558c6be95fde86857b30f41dc82

...might fix it, FWIW.


Thank you for finding that! Very Happy

I have tried to build a new MSYS2 FLAC package with that patch applied, just to see if it works, but I cannot get it to actually build successfully. Embarassed

Since I am able to build a working version of Mednafen with your officially-approved linux cross-compile using GCC 4.9.4, I am reluctant to spend any more time (right now) trying to fix building on MSYS2.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Custom Build - Mednafen 1.26.1 Netplay Quality of Life
Next Topic:Does Mednafen support *any* compressed formats for disc-based systems?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ ]

Current Time: Sat May 4 17:29:31 CDT 2024
.:: Contact :: Home ::.

Powered by FUDforum.
Copyright © FUDforum Bulletin Board Software