Bug 280376 - www/qt6-webengine: Fix build on head after string.h changes
Summary: www/qt6-webengine: Fix build on head after string.h changes
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-19 21:02 UTC by Guido Falsi
Modified: 2024-07-22 04:45 UTC (History)
3 users (show)

See Also:
jhale: maintainer-feedback+


Attachments
patch v1 (750 bytes, patch)
2024-07-19 21:02 UTC, Guido Falsi
no flags Details | Diff
patch v2 (2.16 KB, patch)
2024-07-20 11:40 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2024-07-19 21:02:08 UTC
Created attachment 252179 [details]
patch v1

Hi,

I discovered that on recent head after the changes in [1] and/or [2] qt6-webengine fails to build with the error below.

Looks like the base change actually added mempcpy() implementation. I created a patch that conditionally fixes the embedded config.h changing the line for this.

This patch works fine here. I did choose the nearest __FreeBSD_version available


--------

In file included from ../../../../../qtwebengine-everywhere-src-6.7.2/src/3rdparty/chromium/third_party/nasm/asm/eval.c:38:
../../../../../qtwebengine-everywhere-src-6.7.2/src/3rdparty/chromium/third_party/nasm/include/compiler.h:249:21: error: static declaration of 'mempcpy' follows non-static declaration
  249 | static inline void *mempcpy(void *dst, const void *src, size_t n)
      |                     ^
/usr/include/string.h:71:8: note: previous declaration is here
   71 | void    *(mempcpy)(void * __restrict, const void * __restrict, size_t);
      |           ^
1 error generated.

--------



[1] https://github.com/freebsd/freebsd-src/commit/cf8e5289a110954600f135024d1515a77d0ae34d

[2] https://github.com/freebsd/freebsd-src/commit/0c47b9c211ede221629914ae0c5553586e772109
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2024-07-20 05:36:53 UTC
Thanks for the report and patch, but I think the underlying issue is that the regex in [1] no longer matches after [2], so HAVE_MEMPCPY=1 no longer gets defined and nasm uses it's own implementation instead. The pattern "*\*mempcpy*" will match "*mempcpy", but not "*(mempcpy)".

Since all supported versions of FreeBSD have mempcpy(3), we can probably just remove [1] entirely and that part of the patch in [3], but I haven't tested that theory yet.

These patches were taken from www/chromium, so it and other chromium-based ports like www/electron*, will also need reworked. CC'ing maintainers of those ports.

[1] https://cgit.freebsd.org/ports/tree/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_nasm_BUILD.gn#n9
[2] https://github.com/freebsd/freebsd-src/commit/0c47b9c211ede221629914ae0c5553586e772109
[3] https://cgit.freebsd.org/ports/tree/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_nasm_config_config-linux.h#n36
Comment 2 Guido Falsi freebsd_committer freebsd_triage 2024-07-20 07:03:39 UTC
(In reply to Jason E. Hale from comment #1)

Thanks for explaining this to me. I was not aware of such details. I was simply in an hurry to fix the ports build on my machine and thought I could report the issue, a patch also helps defining the issue.

Thanks for the fast feedback!
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2024-07-20 11:40:42 UTC
Created attachment 252193 [details]
patch v2

I implemented the patch as suggested by jhale.

I'm attaching it, it works fine here!

Thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-07-21 14:52:45 UTC
A commit in branch main references this bug:

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

commit 9fd42baef1d67ba2b5be74ec5ca634a044b13cb8
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2024-07-21 14:27:05 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-07-21 14:50:37 +0000

    www/qt6-webengine: Fix build on recent -CURRENT

    Due to recent changes in string.h, the regex in our local patch for the
    bundled nasm to check whether mempcpy(3) was available no longer worked.
    This caused it to use its own implementation which caused an error due
    to a declaration conflict.

    Since all currently supported versions of FreeBSD have mempcpy(3), this
    patch is no longer needed.

    PR:             280376

 ...c_3rdparty_chromium_third__party_nasm_BUILD.gn (gone) | 16 ----------------
 ...arty_chromium_third__party_nasm_config_config-linux.h | 11 ++---------
 2 files changed, 2 insertions(+), 25 deletions(-)
Comment 5 Jason E. Hale freebsd_committer freebsd_triage 2024-07-21 15:06:42 UTC
(In reply to Guido Falsi from comment #3)
Thanks, Guido! I just committed your changes.
Comment 6 Guido Falsi freebsd_committer freebsd_triage 2024-07-21 15:27:11 UTC
(In reply to Jason E. Hale from comment #5)

Thanks to you!
Comment 7 Hiroki Tagato freebsd_committer freebsd_triage 2024-07-22 04:45:01 UTC
(In reply to Guido Falsi from comment #3)

I have confirmed the same patch can be applied to devel/electron* as well. They build fine on recent 15-CURRENT with the changes.

Thanks for the heads up and the patch!