Patchwork [05/11] Add -fno-rtti when building plugins.

login
register
mail settings
Submitter Dominique Dhumieres
Date Aug. 6, 2013, 10:43 a.m.
Message ID <20130806104305.6B7FB3BE25@mailhost.lps.ens.fr>
Download mbox | patch
Permalink /patch/264991/
State New
Headers show

Comments

Dominique Dhumieres - Aug. 6, 2013, 10:43 a.m.
> 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:


TIA

Dominique
David Malcolm - Aug. 6, 2013, 5:58 p.m.
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.
Mike Stump - Aug. 6, 2013, 9:53 p.m.
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"
> 
>
David Malcolm - Aug. 7, 2013, 1:26 a.m.
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"
> > 
> >

Patch

--- ../_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"