Bug 259718 - graphics/vulkan-loader: Fails to build on aarch64
Summary: graphics/vulkan-loader: Fails to build on aarch64
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: Jan Beich
URL: http://ampere2.nyi.freebsd.org/data/m...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-11-08 18:55 UTC by Mikael Urankar
Modified: 2021-11-08 21:43 UTC (History)
0 users

See Also:
jbeich: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer freebsd_triage 2021-11-08 18:55:04 UTC
Any ideas?

-- The ASM compiler identification is Clang
-- Found assembler: /usr/local/libexec/ccache/cc
-- Looking for cet.h
-- Looking for cet.h - found
CMake Warning at loader/CMakeLists.txt:233 (message):
  Could not find working x86 GAS assembler

  The build will fall back on building with C code

  Note that this may be unsafe, as the C code requires tail-call
  optimizations to remove the stack frame for certain calls.  If the compiler
  does not do this, then unknown device extensions will suffer from a
  corrupted stack.


CMake Error at loader/CMakeLists.txt:310 (target_compile_definitions):
  Cannot specify compile definitions for target "asm_offset" which is not
  built by this project.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2021-11-08 19:52:25 UTC
Previous version built fine. Seems to be a side effect of messing with __BSD_VISIBLE instead of removing _XOPEN_SOURCE (_GNU_SOURCE is already defined). File a bug upstream then CC @hikiko and me.

http://ampere2.nyi.freebsd.org/data/main-arm64-default/p106d1fb70db7_s5a95a6e8e4/logs/vulkan-loader-1.2.196.log
https://github.com/KhronosGroup/Vulkan-Loader/commit/b35527922c54
Comment 2 Jan Beich freebsd_committer freebsd_triage 2021-11-08 19:58:53 UTC
Wait. This is a regression from ports e99b707ea9df, not 1.2.197 update.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2021-11-08 21:11:01 UTC
Hmm, reverting ports e99b707ea9df also requires reverting ports 8613cb1778ca. i386 uses GCC due to bug 249527 but GCC seems to trip on _XOPEN_SOURCE.

In file included from loader/vk_loader_platform.h:179,
                 from loader/loader_common.h:32,
                 from loader/loader.h:32,
                 from loader/asm_offset.c:25:
/usr/include/sys/sysctl.h:1116:25: error: unknown type name 'u_int'; did you mean 'int'?
 1116 | int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
      |                         ^~~~~
      |                         int
In file included from loader/loader_common.h:32,
                 from loader/loader.h:32,
                 from loader/asm_offset.c:25:
loader/vk_loader_platform.h: In function 'loader_platform_executable_path':
loader/vk_loader_platform.h:193:9: warning: implicit declaration of function 'sysctl' [-Wimplicit-function-declaration]
  193 |     if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buffer, &size, NULL, 0) < 0)
      |         ^~~~~~
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-11-08 21:41:51 UTC
A commit in branch main references this bug:

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

commit d97553f6f7b1ff930036beca218bfc895c850fd4
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-11-08 20:56:12 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-11-08 21:40:14 +0000

    graphics/vulkan-loader: unbreak build on non-x86 archs after e99b707ea9df

    CMake Error at loader/CMakeLists.txt:311 (target_compile_definitions):
      Cannot specify compile definitions for target "asm_offset" which is not
      built by this project.

    This reverts commit e99b707ea9df7966f9f95e2871a053715318f00a.

    PR:             259718
    Reported by:    mikael (aarch64)

 graphics/vulkan-loader/Makefile                               |  3 ---
 graphics/vulkan-loader/distinfo                               |  2 --
 .../files/patch-loader_vk__loader__platform.h (new)           | 11 +++++++++++
 3 files changed, 11 insertions(+), 5 deletions(-)