public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH 05/11] Add -fno-rtti when building plugins.
@ 2013-08-06 10:43 Dominique Dhumieres
  2013-08-06 17:58 ` David Malcolm
  2013-08-06 21:53 ` Mike Stump
  0 siblings, 2 replies; 6+ messages in thread
From: Dominique Dhumieres @ 2013-08-06 10:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: dmalcolm

> Hence plugins that create passes will need to be built with RTTI
> disabled in order to link against gcc, or they will fail to load, with
> an error like: ...

The same holds for darwin, hence the following patch is needed:

--- ../_clean/gcc/testsuite/lib/plugin-support.exp	2013-08-05 22:51:42.000000000 +0200
+++ gcc/testsuite/lib/plugin-support.exp	2013-08-06 12:36:43.000000000 +0200
@@ -101,7 +101,7 @@ proc plugin-test-execute { plugin_src pl
 		set optstr [concat $optstr " $op"]
 	    }
 	}
-	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined dynamic_lookup"]
+	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
     } else {
 	set plug_cflags $PLUGINCFLAGS 
 	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"

TIA

Dominique

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

* Re: [PATCH 05/11] Add -fno-rtti when building plugins.
  2013-08-06 10:43 [PATCH 05/11] Add -fno-rtti when building plugins Dominique Dhumieres
@ 2013-08-06 17:58 ` David Malcolm
  2013-08-06 21:53 ` Mike Stump
  1 sibling, 0 replies; 6+ messages in thread
From: David Malcolm @ 2013-08-06 17:58 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: gcc-patches

On Tue, 2013-08-06 at 12:43 +0200, Dominique Dhumieres wrote:
> > Hence plugins that create passes will need to be built with RTTI
> > disabled in order to link against gcc, or they will fail to load, with
> > an error like: ...
> 
> The same holds for darwin, hence the following patch is needed:
> 
> --- ../_clean/gcc/testsuite/lib/plugin-support.exp	2013-08-05 22:51:42.000000000 +0200
> +++ gcc/testsuite/lib/plugin-support.exp	2013-08-06 12:36:43.000000000 +0200
> @@ -101,7 +101,7 @@ proc plugin-test-execute { plugin_src pl
>  		set optstr [concat $optstr " $op"]
>  	    }
>  	}
> -	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined dynamic_lookup"]
> +	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
>      } else {
>  	set plug_cflags $PLUGINCFLAGS 
>  	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"

Sorry about that, and thanks for posting the patch.  The patch looks
correct to me, but I'm not a reviewer.

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

* Re: [PATCH 05/11] Add -fno-rtti when building plugins.
  2013-08-06 10:43 [PATCH 05/11] Add -fno-rtti when building plugins Dominique Dhumieres
  2013-08-06 17:58 ` David Malcolm
@ 2013-08-06 21:53 ` Mike Stump
  2013-08-07  1:26   ` David Malcolm
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Stump @ 2013-08-06 21:53 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: gcc-patches, dmalcolm

Ok.

On Aug 6, 2013, at 3:43 AM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
>> Hence plugins that create passes will need to be built with RTTI
>> disabled in order to link against gcc, or they will fail to load, with
>> an error like: ...
> 
> The same holds for darwin, hence the following patch is needed:
> 
> --- ../_clean/gcc/testsuite/lib/plugin-support.exp	2013-08-05 22:51:42.000000000 +0200
> +++ gcc/testsuite/lib/plugin-support.exp	2013-08-06 12:36:43.000000000 +0200
> @@ -101,7 +101,7 @@ proc plugin-test-execute { plugin_src pl
> 		set optstr [concat $optstr " $op"]
> 	    }
> 	}
> -	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined dynamic_lookup"]
> +	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
>     } else {
> 	set plug_cflags $PLUGINCFLAGS 
> 	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"
> 
> 

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

* Re: [PATCH 05/11] Add -fno-rtti when building plugins.
  2013-08-06 21:53 ` Mike Stump
@ 2013-08-07  1:26   ` David Malcolm
  0 siblings, 0 replies; 6+ messages in thread
From: David Malcolm @ 2013-08-07  1:26 UTC (permalink / raw)
  To: Mike Stump; +Cc: Dominique Dhumieres, gcc-patches

Thanks; I've committed it to trunk as r201552.

On Tue, 2013-08-06 at 14:53 -0700, Mike Stump wrote:
> Ok.
> 
> On Aug 6, 2013, at 3:43 AM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
> >> Hence plugins that create passes will need to be built with RTTI
> >> disabled in order to link against gcc, or they will fail to load, with
> >> an error like: ...
> > 
> > The same holds for darwin, hence the following patch is needed:
> > 
> > --- ../_clean/gcc/testsuite/lib/plugin-support.exp	2013-08-05 22:51:42.000000000 +0200
> > +++ gcc/testsuite/lib/plugin-support.exp	2013-08-06 12:36:43.000000000 +0200
> > @@ -101,7 +101,7 @@ proc plugin-test-execute { plugin_src pl
> > 		set optstr [concat $optstr " $op"]
> > 	    }
> > 	}
> > -	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined dynamic_lookup"]
> > +	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
> >     } else {
> > 	set plug_cflags $PLUGINCFLAGS 
> > 	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"
> > 
> > 


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

* Re: [PATCH 05/11] Add -fno-rtti when building plugins.
  2013-07-26 15:05 ` [PATCH 05/11] Add -fno-rtti when building plugins David Malcolm
@ 2013-07-29 20:24   ` Jeff Law
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Law @ 2013-07-29 20:24 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches

On 07/26/2013 09:04 AM, David Malcolm wrote:
> With the conversion of passes to C++ classes, plugins that add custom
> passes must create them by creating their own derived classes of the
> relevant subclass of opt_pass.  gcc itself is built with -fno-rtti,
> hence there is no RTTI available for the opt_pass class hierarchy.
>
> Hence plugins that create passes will need to be built with RTTI
> disabled in order to link against gcc, or they will fail to load, with
> an error like:
>        cc1: error: cannot load plugin ./selfassign.so
>        ./selfassign.so: undefined symbol: _ZTI8opt_pass
> (aka "typeinfo for opt_pass").
>
> gcc/testsuite
>
> 	* lib/plugin-support.exp (plugin-test-execute): Add -fno-rtti
> 	to optstr when building plugins.
Approved for the trunk.

jeff

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

* [PATCH 05/11] Add -fno-rtti when building plugins.
  2013-07-26 15:05 [PATCH 00/11] Rewrite of pass management David Malcolm
@ 2013-07-26 15:05 ` David Malcolm
  2013-07-29 20:24   ` Jeff Law
  0 siblings, 1 reply; 6+ messages in thread
From: David Malcolm @ 2013-07-26 15:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

With the conversion of passes to C++ classes, plugins that add custom
passes must create them by creating their own derived classes of the
relevant subclass of opt_pass.  gcc itself is built with -fno-rtti,
hence there is no RTTI available for the opt_pass class hierarchy.

Hence plugins that create passes will need to be built with RTTI
disabled in order to link against gcc, or they will fail to load, with
an error like:
      cc1: error: cannot load plugin ./selfassign.so
      ./selfassign.so: undefined symbol: _ZTI8opt_pass
(aka "typeinfo for opt_pass").

gcc/testsuite

	* lib/plugin-support.exp (plugin-test-execute): Add -fno-rtti
	to optstr when building plugins.
---
 gcc/testsuite/lib/plugin-support.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp
index 88033b3..017f3fd 100644
--- a/gcc/testsuite/lib/plugin-support.exp
+++ b/gcc/testsuite/lib/plugin-support.exp
@@ -104,7 +104,7 @@ proc plugin-test-execute { plugin_src plugin_tests } {
 	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined dynamic_lookup"]
     } else {
 	set plug_cflags $PLUGINCFLAGS 
-	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
+	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"
     }
 
     # Temporarily switch to the environment for the plugin compiler.
-- 
1.7.11.7

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

end of thread, other threads:[~2013-08-07  1:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 10:43 [PATCH 05/11] Add -fno-rtti when building plugins Dominique Dhumieres
2013-08-06 17:58 ` David Malcolm
2013-08-06 21:53 ` Mike Stump
2013-08-07  1:26   ` David Malcolm
  -- strict thread matches above, loose matches on Subject: below --
2013-07-26 15:05 [PATCH 00/11] Rewrite of pass management David Malcolm
2013-07-26 15:05 ` [PATCH 05/11] Add -fno-rtti when building plugins David Malcolm
2013-07-29 20:24   ` Jeff Law

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).