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.

As I have no way to test this on alpha, I've just bootstrapped/regtested
similar change (just posted) on x86_64-linux and verified on the above
testcase that it fixes the problem in a cross to alpha-linux.

Not adding a testcase as any test which tries to compile bits/std.cc should
already catch it.

Ok for trunk?

2026-03-19  Jakub Jelinek  <[email protected]>

        PR target/124565
        * config/alpha/alpha.cc (alpha_build_builtin_va_list): Set TREE_PUBLIC
        on type_decl.

--- gcc/config/alpha/alpha.cc.jj        2026-01-02 09:56:09.944340283 +0100
+++ gcc/config/alpha/alpha.cc   2026-03-19 12:42:10.944867727 +0100
@@ -6564,6 +6564,7 @@ alpha_build_builtin_va_list (void)
   DECL_CHAIN (base) = ofs;
 
   TYPE_FIELDS (record) = base;
+  TREE_PUBLIC (type_decl) = 1;
   layout_type (record);
 
   va_list_gpr_counter_field = ofs;


        Jakub

Reply via email to