Bug 283840 - inline asm error on armv7: expected '%<type>' or "<type>" (port devel/outcome)
Summary: inline asm error on armv7: expected '%<type>' or "<type>" (port devel/outcome)
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-04 09:31 UTC by Yuri Victorovich
Modified: 2025-01-07 11:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2025-01-04 09:31:57 UTC
The port devel/outcome fails to build on armv7:

<inline asm>:1:41: error: expected '%<type>' or "<type>"
    1 | .pushsection ".debug_gdb_scripts", "MS",@progbits,1
      |                                         ^
<inline asm>:100:12: error: .popsection without corresponding .pushsection
  100 | .popsection
      |            ^
2 errors generated.


Log: https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/pd594ba044905_s6ea1ce222c/logs/outcome-2.2.11.log
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2025-01-04 09:35:17 UTC
Sorry, this turned out to be a bug in the upstream.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2025-01-04 11:02:40 UTC
This is easy to workaround: add a patch that changes @progbits to %progbits on armv7.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2025-01-05 21:39:01 UTC
Fixed upstream: https://github.com/ned14/outcome/issues/309#issuecomment-2571613444
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2025-01-06 15:43:50 UTC
I have prepared a workaround patch.  Is it ok if I commit the patch as a stopgap measure?  You can take it out once upstream has pushed a new release with the proper fix.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2025-01-06 18:09:18 UTC
(In reply to Robert Clausecker from comment #4)

Yes, please do it.

Thank you.
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-01-06 23:08:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=684e90ff96b5e2aba9eadb25298de1dcb54c6615

commit 684e90ff96b5e2aba9eadb25298de1dcb54c6615
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-01-04 11:24:38 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-01-06 23:06:06 +0000

    devel/outcome: fix build on armv7

    On ARM, section types are spelled with % instead of @ as @ is the
    comment characters.

    Approved by:    yuri (maintainer)
    PR:             283840
    MFH:            2025Q1

 devel/outcome/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-01-06 23:09:19 UTC
A commit in branch 2025Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=17176071892ca70f60d685b378ed99135326ee5b

commit 17176071892ca70f60d685b378ed99135326ee5b
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-01-04 11:24:38 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-01-06 23:08:00 +0000

    devel/outcome: fix build on armv7

    On ARM, section types are spelled with % instead of @ as @ is the
    comment characters.

    Approved by:    yuri (maintainer)
    PR:             283840
    MFH:            2025Q1

    (cherry picked from commit 684e90ff96b5e2aba9eadb25298de1dcb54c6615)

 devel/outcome/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2025-01-07 01:38:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=58f73c13155796f6396395b5089e474aae647055

commit 58f73c13155796f6396395b5089e474aae647055
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-01-07 01:35:20 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-01-07 01:35:20 +0000

    devel/outcome: Re-add NO_ARCH=yes

    Tests are built by default by mistake which caused the armv7
    problem from bug#283840.

    PR:             283840

 devel/outcome/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 9 commit-hook freebsd_committer freebsd_triage 2025-01-07 01:39:37 UTC
A commit in branch 2025Q1 references this bug:

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

commit d438bd61ded8201bca59690f76636b6cdf33168e
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-01-07 01:35:20 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-01-07 01:38:54 +0000

    devel/outcome: Re-add NO_ARCH=yes

    Tests are built by default by mistake which caused the armv7
    problem from bug#283840.

    PR:             283840
    (cherry picked from commit 58f73c13155796f6396395b5089e474aae647055)

 devel/outcome/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2025-01-07 09:38:37 UTC
I have removed NO_ARCH=yes because the patching is architecture-dependent.  While we currently do not make use of the NO_ARCH property, it seems like it is wrong to set it in this case.
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2025-01-07 10:20:45 UTC
(In reply to Robert Clausecker from comment #10)

It looks correct to me as it is now.

Patching is architecture-specific, which is correct, but on the other hand it doesn't install any binaries, so NO_ARCH=yes should be there.
Comment 12 Robert Clausecker freebsd_committer freebsd_triage 2025-01-07 11:19:50 UTC
The purpose of NO_ARCH=yes is that in the future, such packages can be built only once and then distributed for all architectures.  But that is not the case here: due to the patching, the package is different for armv7 compared to other architectures, so this would not work.  Right now it doesn't really matter though as that feature has never been developed.