Skip to content

Commit

Permalink
Updated GENie and changed Visual Studio target to Visual Studio 2022. (
Browse files Browse the repository at this point in the history
…#13000)

* Updated to GENie 1181.
* Applied local fix for GENie resource include directory bug, sent upstream as bkaradzic/GENie#572.
* Set MSVC flags to use conformant preprocessor, standards conformance mode, and assume UTF-8 encoding.
  • Loading branch information
pmackinlay authored Nov 26, 2024
1 parent 5b1adf3 commit dc8ba81
Show file tree
Hide file tree
Showing 64 changed files with 1,743 additions and 2,705 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/bgfx/src/shader_spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace bgfx
#define SPV_OPERAND_7(_a0, _a1, _a2, _a3, _a4, _a5, _a6) SPV_OPERAND_1(_a0), SPV_OPERAND_6(_a1, _a2, _a3, _a4, _a5, _a6)
#define SPV_OPERAND_8(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) SPV_OPERAND_1(_a0), SPV_OPERAND_7(_a1, _a2, _a3, _a4, _a5, _a6, _a7)
#define SPV_OPERAND_9(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) SPV_OPERAND_1(_a0), SPV_OPERAND_8(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8)
#if BX_COMPILER_MSVC
#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) }
#else
Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/bx/include/bx/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define BX_MACROS_H_HEADER_GUARD

///
#if BX_COMPILER_MSVC
#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define BX_VA_ARGS_PASS(...) BX_VA_ARGS_PASS_1_ __VA_ARGS__ BX_VA_ARGS_PASS_2_
# define BX_VA_ARGS_PASS_1_ (
Expand Down Expand Up @@ -145,7 +145,7 @@
#define BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11) BX_UNUSED_10(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10); BX_UNUSED_1(_a11)
#define BX_UNUSED_12(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11, _a12) BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11); BX_UNUSED_1(_a12)

#if BX_COMPILER_MSVC
#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__)
#else
Expand Down Expand Up @@ -226,7 +226,7 @@
#define BX_CLASS_3(_class, _a1, _a2, _a3) BX_CLASS_2(_class, _a1, _a2); BX_CLASS_1(_class, _a3)
#define BX_CLASS_4(_class, _a1, _a2, _a3, _a4) BX_CLASS_3(_class, _a1, _a2, _a3); BX_CLASS_1(_class, _a4)

#if BX_COMPILER_MSVC
#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__) BX_VA_ARGS_PASS(_class, __VA_ARGS__)
#else
# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__)
Expand Down
20 changes: 0 additions & 20 deletions 3rdparty/genie/.travis.yml

This file was deleted.

36 changes: 25 additions & 11 deletions 3rdparty/genie/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<p align="center">
<img src="https://repository-images.githubusercontent.com/23779242/961ad700-8d21-11ea-85d3-1d64eccc4531" width="1280">
</p>

[GENie](https://github.com/bkaradzic/genie#what-is-it) - Project generator tool
===============================================================================

[![Build and Upload Artifact](https://github.com/bkaradzic/GENie/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bkaradzic/GENie/actions/workflows/build.yml)

What is it?
-----------

Expand All @@ -9,19 +15,16 @@ generates project from Lua script, making applying the same settings for
multiple projects easy.

Supported project generators:
* FASTBuild (experimental)
* GNU Makefile
* [JSON Compilation Database][jcdb]
* Ninja (experimental)
* Qbs / QtCreator (experimental)
* Visual Studio 2010, 2012, 2013, 2015, 2017, 2019
* Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022
* XCode

Download (stable)
-----------------

[![Build Status](https://travis-ci.org/bkaradzic/GENie.svg?branch=master)](https://travis-ci.org/bkaradzic/GENie)

version 1115 (commit cd9b1a624810b166d11788d01c2aa4daf2ea42e6)
version 1181 (commit 29e6832fdf3b106c0906d288c8ced6c0761b8985)

Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie
Expand All @@ -43,7 +46,11 @@ Documentation
-------------

[Scripting Reference](https://github.com/bkaradzic/genie/blob/master/docs/scripting-reference.md#scripting-reference)
[Introduction to GENie - CppCon 2016](https://onedrive.live.com/view.aspx?cid=171ee76e679935c8&page=view&resid=171EE76E679935C8!139573&parId=171EE76E679935C8!18835&authkey=!AKv_SGrgJwxDGDg&app=PowerPoint)

Introduction to GENie - CppCon 2016
<a href="http://www.youtube.com/watch?feature=player_embedded&v=_vArtdDTrTM"
target="_blank"><img src="http://img.youtube.com/vi/_vArtdDTrTM/0.jpg"
alt="Introduction to GENie - CppCon 2016" width="640" height="480" border="0" /></a>

History
-------
Expand Down Expand Up @@ -90,7 +97,7 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
- Added support for generating PS4/Orbis projects.
- Fixed PCH race when using concurrent Makefile build.
- Added Green Hills Software compiler support.
- Added edit & continue support for 64-bit builds in VS2013 upwards.
- Added edit & continue support for 64-bit builds in vs2013 upwards.
- Added `windowstargetplatformversion` to specify VS Windows target version.
- Added `NoWinRT` flag to disable WinRT CX builds.
- Added `NoBufferSecurityCheck` flag to disable security checks in VS.
Expand Down Expand Up @@ -120,17 +127,23 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
- Added `iostargetplatformversion`, `macostargetplatformversion`, and
`tvostargetplatformversion` to specify XCode OS target version.
- Removed the `xcode3`, and `xcode4` actions.
- Added the `xcode8`, `xcode9`, and `xcode10` actions.
- Added the `xcode8`, `xcode9`, `xcode10`, `xcode11` and `xcode14` actions.
- Added `systemincludedirs` that are always searched after directories added
using `includedirs`.
- Added `NoRuntimeChecks` flag to disable Basic Runtime Checks in non-optimized
Visual Studio builds.
- Added support for Nintendo Switch projects.
- Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`,
- Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`, `Cpp20`
and `CppLatest`.
- Added `xcodeprojectopts` and `xcodetargetopts`.
- Added vs2019 support.
- Added UnitySupport flag to enable Unity (Jumbo) builds in Visual Studio 2019
- Added `UnitySupport` flag to enable Unity (Jumbo) builds in vs2019
- Added the `jcdb` action for generating a [JSON compilation database][jcdb].
- Added support for generating Switch/NX32 Switch/NX64 projects.
- Removed FASTBuild.
- Removed Qbs support.
- Added vs2022 support.
- Added xcode15 action with visionOS support.

build - GENie build system scripts
----------------------------------
Expand Down Expand Up @@ -240,4 +253,5 @@ Developer Crackshell used GENie for development of games
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[jcdb]: https://clang.llvm.org/docs/JSONCompilationDatabase.html
[zbs]: https://studio.zerobrane.com
43 changes: 23 additions & 20 deletions 3rdparty/genie/build/gmake.darwin/genie.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# GNU Make project makefile autogenerated by GENie

.SUFFIXES:

ifndef config
config=release
endif
Expand Down Expand Up @@ -49,11 +52,11 @@ ifeq ($(config),release)
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6
LIBDEPS +=
Expand Down Expand Up @@ -136,11 +139,11 @@ ifeq ($(config),debug)
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6
LIBDEPS +=
Expand Down Expand Up @@ -224,11 +227,11 @@ ifeq ($(config),releaseuniv32)
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6
LIBDEPS +=
Expand Down Expand Up @@ -312,11 +315,11 @@ ifeq ($(config),debuguniv32)
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6
ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6
LIBDEPS +=
Expand Down
Loading

20 comments on commit dc8ba81

@MASHinfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new genie you can't compile a 32bit MAME version anymore. In the file 3rdparty/genie/build/gmake.windows/genie.make
it used additionally the GCC flag -m64 for x86-64 architecture. This flags must be removed.

The other problem is a wrong "return" / typo in the file 3rdparty\genie\src\host\scripts.c, which creates a broken expat.make
in build\projects\windows\mameXXXX\gmake-mingw64-gcc.
I found this by comparing the old version of scripts.c with the new one.

If you replace 'result' with 'value' in 3rdparty\genie\src\host\scripts.c and line 225:
From
gsub("\"", "\\\"")\nreturn result
to
gsub("\"", "\\\"")\nreturn value

it creates a correct expat.make.

With these two changes i have successfully compiled a 32bit version of MAME without NOWERROR=1 !!!

@pmackinlay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second change you describe would fundamentally change the meaning of the function (essentially disabling escaping of double quotation characters). The actual source is here (from actions/make/_make.lua), and it hasn't been changed in 6 years:

--
-- Escape quoted string so it can be passed as define via command line.
--

	function _MAKE.escquote(value)
		local result
		if (type(value) == "table") then
			result = { }
			for _,v in ipairs(value) do
				table.insert(result, _MAKE.escquote(v))
			end
			return result
		else
			-- handle simple replacements
			result = value:gsub(" ", "\\ ")
			result = result:gsub("\"", "\\\"")
			return result
		end
	end

What is the actual problem you encountered before you made this change?

@Robbbert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone passed this to me fwiw:

Compiling 3rdparty/expat/lib/xmlparse.c...
: error: missing terminating " character [-Werror]
cc1.exe: all warnings being treated as errors
expat.make:316: recipe for target '../../../../mingw-gcc/obj/x64/Release/3rdparty/expat/lib/xmlparse.o' failed
make[2]: *** [../../../../mingw-gcc/obj/x64/Release/3rdparty/expat/lib/xmlparse.o] Error 1
makefile:34: recipe for target 'expat' failed
make[1]: *** [expat] Error 2
makefile:1126: recipe for target 'windows_x64' failed
make: *** [windows_x64] Error 2

@MASHinfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrick Mackinlay
If you compare the old 3rdparty/genie/build/gmake.windows/genie.make with the new one, you can
see that the old version uses $(MPARAM) instead of -m64. And the defintion of MPARAM
is in MAME's makefile at line 310:

ifeq ($(ARCHITECTURE),_x86)
MPARAM := -m32
else
ifeq ($(ARCHITECTURE),_x64)
MPARAM := -m64

Can you add $(MPARAM back so we can compile a 32bit version again.

For the 2nd problem please compare MAME's old scripts.c version with the new one.
This "return value" is in the old version.

@mamehaze
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I'm seeing this too. several 'make' attempts will get past it, but it's definitely an issue.

@pmackinlay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first issue regarding $(MPARAM) is a regression, and I'll fix it, no issue, please be a bit patient while I work on the other issue to minimize churn.

For the second issue, the root cause is GENie's escaping rules not handling a specific input here. Please note that scripts.c is a generated file, so comparing/modifying it doesn't make sense unless you also update the source (which is the various .lua files in the GENie actions folder). A better hack/fix in the short term is to remove/replace the space in the line mentioned above with something else that won't trigger escaping.

I can only assume that in the previous version of our GENie code, someone modified scripts.c (but not the .lua) to hack/avoid this issue, which is why I didn't notice the change. Again, please bear with me while I try to solve the problem properly.

@MASHinfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for tackling this problem!
Let's hope that the file will be generated correctly so that xmlrole.c can be compiled again :)

@pmackinlay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully fixed here ae4e448.

@MASHinfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! Thx!
A missing hyphen... My head is spinning terribly ;)

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that building on Raspberry Pi OS fails since this commit (via bisect):
gcc complains about a wrong flag "-m64". This is obviously wrong for aarch64.

(BTW, I just installed a new Raspberry and wondered what I was doing wrong until I gave it a try with the previously working one.)

@cuavas
Copy link
Member

@cuavas cuavas commented on dc8ba81 Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it “obviously wrong”? The -m32 and -m64 flags have been supported for selecting between 32-bit and 64-bit target ISA on numerous targets (SPARC, PowerPC, x86, etc.), why is ARM the odd one out? And if it doesn’t support -m32 and -m64, how do you set the target ISA?

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understood from the options of gcc, the m32/64 options belong to x86/64, not aarch64.
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html

@cuavas
Copy link
Member

@cuavas cuavas commented on dc8ba81 Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don’t belong to x86 – they’re available for most architectures that have 32-bit and 64-bit flavours:

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I did not design the gcc, I can just report what it says, and it's
"gcc: error: unrecognized command-line option '-m64'"
since this commit.

@jackson2k2
Copy link
Contributor

@jackson2k2 jackson2k2 commented on dc8ba81 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aarch64 has optional support for 32-bit in the instruction set and requires something particular with how dynamic objects are shared, making building two separate toolchains for both 32-bit and 64-bit a requirement.

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be, but building on aarch64 did work without a problem before this commit. I did it for each of the last releases.

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I successfully compiled MAME on the Raspberry Pi with the "-m64" switches removed in gmake.linux/genie.make. Result is "ELF 64-bit LSB pie executable, ARM aarch64" as expected.

So it would be nice if you could add a check for aarch64 to omit the flag -m64, then everything seems fine again ... as far as I can see. I tried to use $(ARCH) for the check, but that did not work.

@jackson2k2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ${MPARPAM} worked because it did not add neither m64 nor m32 when on aarch64. This needs to be done for not only the genie.make for the Windows target but also for the Linux, FreeBSD, and Darwin targets.

@pmackinlay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ${MPARPAM} worked because it did not add neither m64 nor m32 when on aarch64. This needs to be done for not only the genie.make for the Windows target but also for the Linux, FreeBSD, and Darwin targets.

Done here 383c16a. I can't test those other targets, so would appreciate testing and feedback from those who can. My apologies for the oversight in accidentally reverting this local change to the GENie upstream code and causing this problem.

@mizapf
Copy link
Member

@mizapf mizapf commented on dc8ba81 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks good now. Thanks.

Please sign in to comment.