[Buildroot] [PATCH 2/3] package/gobject-introspection: export cc in g-ir-scanner

Yann E. MORIN yann.morin.1998 at free.fr
Sun Feb 23 20:45:20 UTC 2020


Adam, All,

On 2020-02-21 14:43 -0800, aduskett at gmail.com spake thusly:
> From: Adam Duskett <Aduskett at gmail.com>
> 
> Without this export, the host variant of g-ir-scanner will call the host
> gcc for linking.
> 
> For autotools packages, this is not an issue as they use
> Makefile.introspection, which will export the cross-cc, however for meson,
> this is not the case, and linking errors occur when meson packages generate
> .gir and .typelib files.
> 
> Signed-off-by: Adam Duskett <Aduskett at gmail.com>
> ---
>  package/gobject-introspection/g-ir-scanner.in          | 2 ++
>  package/gobject-introspection/gobject-introspection.mk | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/package/gobject-introspection/g-ir-scanner.in b/package/gobject-introspection/g-ir-scanner.in
> index 9f97497b7e..c5066bd635 100644
> --- a/package/gobject-introspection/g-ir-scanner.in
> +++ b/package/gobject-introspection/g-ir-scanner.in
> @@ -1,6 +1,8 @@
>  #!/usr/bin/env bash
>  
>  export GI_SCANNER_DISABLE_CACHE=1
> +export CC="@TARGET_CC@"
> +
>  ${HOST_DIR}/bin/g-ir-scanner \
>  --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \
>  --use-binary-wrapper=$(dirname $0)/g-ir-scanner-qemuwrapper \
> diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
> index e719588437..b24441b87a 100644
> --- a/package/gobject-introspection/gobject-introspection.mk
> +++ b/package/gobject-introspection/gobject-introspection.mk
> @@ -101,6 +101,8 @@ define GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
>  		$(INSTALL) -D -m 755 \
>  			$(GOBJECT_INTROSPECTION_PKGDIR)/$(w).in $(STAGING_DIR)/usr/bin/$(w)
>  	)
> +	$(SED) "s%@TARGET_CC@%$(TARGET_CC)%g" $(STAGING_DIR)/usr/bin/g-ir-scanner

That makes the wrapper no longer relocatable... :-(

What about:

    export CC="$(dirname "${0}")/@iBASENAME_TARGET_CC@"

With:

    $(SED) "s%@BASENAME_TARGET_CC@%$(notdir $(TARGET_CC))%g" $(STAGING_DIR)/usr/bin/g-ir-scanner

Regards,
Yann E. MORIN.

>  	# Gobject-introspection installs Makefile.introspection in
>  	# $(STAGING_DIR)/usr/share which is needed for autotools-based programs to
>  	# build .gir and .typelib files. Unfortuantly, gobject-introspection-1.0.pc
> -- 
> 2.24.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list