Skip to content

mesa/st: Fix building tests on macOS

Alyssa Rosenzweig requested to merge asahi/mesa:fix-build into main

Due to an upstream bug, macOS can't link empty static libraries There is open Meson bug about this use case, though arguably the issue is macOS's implementation of ar. Of course, the functionality is mostly useless.

The removal of GLSL-to-TGSI trivialized a static library, causing linking to fail. This commit garbage collects the useless library. This fixes the build on macOS:

   FAILED: src/mesa/state_tracker/tests/libmesa_st_test_common.a
   rm -f src/mesa/state_tracker/tests/libmesa_st_test_common.a && ar csr src/mesa/state_tracker/tests/libmesa_st_test_common.a
   ar: no archive members specified
   usage:  ar -d [-TLsv] archive file ...
      ar -m [-TLsv] archive file ...
      ar -m [-abiTLsv] position archive file ...
      ar -p [-TLsv] archive [file ...]
      ar -q [-cTLsv] archive file ...
      ar -r [-cuTLsv] archive file ...
      ar -r [-abciuTLsv] position archive file ...
      ar -t [-TLsv] archive [file ...]
      ar -x [-ouTLsv] archive [file ...]

Cc @dbaker for the meson, @anholt for the commit exposing the macOS issue.

Edited by Alyssa Rosenzweig

Merge request reports