Bug 271468 - emulators/mame: add arm64 support
Summary: emulators/mame: add arm64 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-17 11:47 UTC by Robert Clausecker
Modified: 2023-05-18 08:28 UTC (History)
1 user (show)

See Also:
agh: maintainer-feedback+
fuz: merge-quarterly?


Attachments
emulators/mame: add arm64 support (2.45 KB, patch)
2023-05-17 11:47 UTC, Robert Clausecker
agh: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2023-05-17 11:47:37 UTC
Created attachment 242233 [details]
emulators/mame: add arm64 support

With the attached trivial patch mame builds on arm64.
Comment 1 Alastair Hogge 2023-05-17 12:57:50 UTC
Oh fsck yeah! arm64 support, very awesome.

> @@ -52,7 +52,8 @@ MAKE_ENV=	FULLNAME="mame" \
>  		SDL_NETWORK="pcap" \
>  		SUBTARGET="${MSUBTARGET}" \
>  		TARGET="${MTARGET}" \
> -		USE_NETWORK=1
> +		USE_NETWORK=1 \
> +		SYMBOLS=1

SYMBOLS is also defined in the ${PORT_OPTIONS:MDEBUG} conditional, does it need to be defined here also?

> + freebsd_x64_clang: generate $(PROJECTDIR)/$(MAKETYPE)-freebsd-clang/Makefile
> ++	$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd-clang config=$(CONFIG)64 precompile
> ++	$(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-freebsd-clang config=$(CONFIG)64

Instead of patching the makefile, does passing PRECOMPILE=1 to ${MAKE_ENV} achieve the same? I am finding that I need to disable PRECOMPILE at the moment, I noted that pkgsrc does the same.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-05-17 13:16:36 UTC
Sorry, the bit about SYMBOLS was a local experiment to see why stripping made the build work on armv7.  Will remove that from the final patch.

> Instead of patching the makefile, does passing PRECOMPILE=1 to ${MAKE_ENV} achieve the same? I am finding that I need to disable PRECOMPILE at the moment, I noted that pkgsrc does the same.

This change adds a new make rule freebsd_arm64_clang doing the same thing as freebsd_x64_clang.  It does not add a precompile target where there previously was none.

The problem that prevented a build on arm64 was this error:

===>  Building for mame-0.254
gmake[2]: Entering directory '/usr/home/ports/main.ports/emulators/mame/work/mame-mame0254'
Clang 14.0.5 detected
gmake[2]: *** No rule to make target 'freebsd_arm64_clang', needed by 'all'.  Stop.
gmake[2]: Leaving directory '/usr/home/ports/main.ports/emulators/mame/work/mame-mame0254'
===> Compilation failed unexpectedly.


My patch fixes this error by adding the missing rule.
Comment 3 Alastair Hogge 2023-05-17 13:59:46 UTC
(In reply to Robert Clausecker from comment #2)

Wow this is great. Thanks for the explanations.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-05-17 14:16:14 UTC
Do you approve of the patch?  If yes, set maintainer-approval to +.
Comment 5 Alastair Hogge 2023-05-17 14:36:39 UTC
(In reply to Robert Clausecker from comment #4)
Sorry, done.
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-05-17 15:36:30 UTC
I meant "maintainer-approval" which is a flag on the patch (click "details" on the patch).  But I'll take that as a yes.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-05-18 08:21:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=16f071acbac17780d645ac05e734bc49d7b443c6

commit 16f071acbac17780d645ac05e734bc49d7b443c6
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-05-17 11:44:21 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-18 08:19:49 +0000

    emulators/mame: enable on arm64

    Add a missing make target, permitting compilation on arm64.

    PR:             271468
    MFH:            2023Q2
    Approved by:    agh@riseup.net (maintainer)

 emulators/mame/Makefile                   |  4 ++--
 emulators/mame/files/patch-makefile (new) | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-05-18 08:23:22 UTC
A commit in branch 2023Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0adc48d735fed7434332a53247176cfe0141b543

commit 0adc48d735fed7434332a53247176cfe0141b543
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-05-17 11:44:21 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-18 08:22:19 +0000

    emulators/mame: enable on arm64

    Add a missing make target, permitting compilation on arm64.

    PR:             271468
    MFH:            2023Q2
    Approved by:    agh@riseup.net (maintainer)

    (cherry picked from commit 16f071acbac17780d645ac05e734bc49d7b443c6)

 emulators/mame/Makefile                   |  4 ++--
 emulators/mame/files/patch-makefile (new) | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2023-05-18 08:28:15 UTC
Committed!