[PATCH] configure: honor --extra-ldflags when forced to use objc_LINKER

Matt Jacobson posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260615045547.23422-1-mhjacobson@me.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
configure | 1 +
1 file changed, 1 insertion(+)
[PATCH] configure: honor --extra-ldflags when forced to use objc_LINKER
Posted by Matt Jacobson 1 month, 1 week ago
3220b38a8d had the side effect of making the individual target link steps
use objc_LINKER on macOS, because `coreaudio.m` became visible to Meson as
a source file.  (The preexisting presence of `cocoa.m` is masked by the
fact that it gets built into libsystem and then extracted back out as an
object file.)

`configure` correctly passes `$EXTRA_LDFLAGS` to the "C linker" and "C++
linker", but it neglected to do so for the "Objective-C linker".  Fix that.

Signed-off-by: Matt Jacobson <mhjacobson@me.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index d786d3a7c9..d773c3c46a 100755
--- a/configure
+++ b/configure
@@ -1849,6 +1849,7 @@ if test "$skip_meson" = no; then
   test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS $EXTRA_OBJCFLAGS)]" >> $cross
   echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross
   echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross
+  test -n "$objcc" && echo "objc_link_args = [$(meson_quote $OBJCFLAGS $LDFLAGS $EXTRA_OBJCFLAGS $EXTRA_LDFLAGS)]" >> $cross
 
   # Only enable by default for git builds and on select OSes
   echo "# environment defaults, can still be overridden on " >> $cross
-- 
2.53.0
Re: [PATCH] configure: honor --extra-ldflags when forced to use objc_LINKER
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
On 15/6/26 06:55, Matt Jacobson wrote:
> 3220b38a8d had the side effect of making the individual target link steps
> use objc_LINKER on macOS, because `coreaudio.m` became visible to Meson as
> a source file.  (The preexisting presence of `cocoa.m` is masked by the
> fact that it gets built into libsystem and then extracted back out as an
> object file.)
> 
> `configure` correctly passes `$EXTRA_LDFLAGS` to the "C linker" and "C++
> linker", but it neglected to do so for the "Objective-C linker".  Fix that.
> 
> Signed-off-by: Matt Jacobson <mhjacobson@me.com>
> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>