On Thu, Mar 19, 2026 at 12:49 PM Jakub Jelinek <[email protected]> wrote:
>
> Hi!
>
>  module;
>  #include <cstdarg>
>  export module pr124565;
>  export namespace std {
>    using std::va_list;
>  }
> fails on alpha-linux with -fmodules:
> pr124565.cc:5:14: error: exporting ‘typedef __gnuc_va_list va_list’ that does 
> not have external linkage
> <built-in>: note: ‘typedef struct __va_list_tag __va_list_tag’ declared here 
> with internal linkage
>
> It doesn't fail on x86_64-linux because there va_list is __va_list_tag[]
> (i.e. array type), while on alpha-linux it is __va_list_tag itself; and the
> module code calls decl_linkage on it and returns lk_internal for C++11 and
> later.
>
> Now, decl_linkage on x86_64-linux on __va_list_tag directly also returns
> incorrectly lk_internal, and as I have no way to test alpha, I've
> bootstrapped/regtested on x86_64-linux and i686-linux the following patch.
>
> IMHO it is still desirable even there even when it is just a latent issue.
>
> Ok for trunk?
>
> 2026-03-19  Jakub Jelinek  <[email protected]>
>
>         PR target/124565
>         * config/i386/i386.cc (ix86_build_builtin_va_list_64): Set TREE_PUBLIC
>         on type_decl.

Based on the above explanation, the change seems reasonable to me.

OK for mainline and backports.

Thanks,
Uros.

>
> --- gcc/config/i386/i386.cc.jj  2026-03-04 22:38:02.421879010 +0100
> +++ gcc/config/i386/i386.cc     2026-03-19 09:30:37.446207733 +0100
> @@ -4564,6 +4564,7 @@ ix86_build_builtin_va_list_64 (void)
>    DECL_CHAIN (f_gpr) = f_fpr;
>    DECL_CHAIN (f_fpr) = f_ovf;
>    DECL_CHAIN (f_ovf) = f_sav;
> +  TREE_PUBLIC (type_decl) = 1;
>
>    layout_type (record);
>
>
>         Jakub
>

Reply via email to