public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] modula-2: Module registration constructors need to be visible [PR108259].
@ 2023-01-02 11:39 Iain Sandoe
  2023-01-04 12:07 ` Gaius Mulley
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2023-01-02 11:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: gaiusmod2

Tested on x86_64-linux-gnu, x86_64,aarch64-darwin21.
There remain issues with shared libraries, but the link fails are fixed
by this.

OK for master?
Thanks
Iain

--- 8< ---

In the current design the main executable links explicitly to the module
registration construtors that it uses.  This means that they must be
visible in shared libraries.

	PR modula2/108259

gcc/m2/ChangeLog:

	* gm2-gcc/m2decl.cc (m2decl_DeclareModuleCtor): Make module
	registration constructors visible.
---
 gcc/m2/gm2-gcc/m2decl.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/m2/gm2-gcc/m2decl.cc b/gcc/m2/gm2-gcc/m2decl.cc
index 62bfefd2530..d849f8aefc4 100644
--- a/gcc/m2/gm2-gcc/m2decl.cc
+++ b/gcc/m2/gm2-gcc/m2decl.cc
@@ -276,7 +276,7 @@ m2decl_DeclareModuleCtor (tree decl)
   /* Declare module_ctor ().  */
   TREE_PUBLIC (decl) = 1;
   DECL_ARTIFICIAL (decl) = 1;
-  DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+  DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
   DECL_VISIBILITY_SPECIFIED (decl) = 1;
   DECL_STATIC_CONSTRUCTOR (decl) = 1;
   return decl;
-- 
2.37.1 (Apple Git-137.1)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] modula-2: Module registration constructors need to be visible [PR108259].
  2023-01-02 11:39 [PATCH] modula-2: Module registration constructors need to be visible [PR108259] Iain Sandoe
@ 2023-01-04 12:07 ` Gaius Mulley
  0 siblings, 0 replies; 2+ messages in thread
From: Gaius Mulley @ 2023-01-04 12:07 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: gcc-patches, iain

Iain Sandoe <iains.gcc@gmail.com> writes:

> Tested on x86_64-linux-gnu, x86_64,aarch64-darwin21.
> There remain issues with shared libraries, but the link fails are fixed
> by this.
>
> OK for master?
> Thanks
> Iain
>
> --- 8< ---
>
> In the current design the main executable links explicitly to the module
> registration construtors that it uses.  This means that they must be
> visible in shared libraries.
>
> 	PR modula2/108259
>
> gcc/m2/ChangeLog:
>
> 	* gm2-gcc/m2decl.cc (m2decl_DeclareModuleCtor): Make module
> 	registration constructors visible.
> ---
>  gcc/m2/gm2-gcc/m2decl.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/m2/gm2-gcc/m2decl.cc b/gcc/m2/gm2-gcc/m2decl.cc
> index 62bfefd2530..d849f8aefc4 100644
> --- a/gcc/m2/gm2-gcc/m2decl.cc
> +++ b/gcc/m2/gm2-gcc/m2decl.cc
> @@ -276,7 +276,7 @@ m2decl_DeclareModuleCtor (tree decl)
>    /* Declare module_ctor ().  */
>    TREE_PUBLIC (decl) = 1;
>    DECL_ARTIFICIAL (decl) = 1;
> -  DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
> +  DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
>    DECL_VISIBILITY_SPECIFIED (decl) = 1;
>    DECL_STATIC_CONSTRUCTOR (decl) = 1;
>    return decl;

LGTM thanks,

Gaius

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-04 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 11:39 [PATCH] modula-2: Module registration constructors need to be visible [PR108259] Iain Sandoe
2023-01-04 12:07 ` Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).