This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE


On Mon, Mar 30, 2015 at 07:08:00PM -0700, H.J. Lu wrote:
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -1566,11 +1566,13 @@ init_spec (void)
>  	if (in_sep && *p == '-' && strncmp (p, "-lgcc", 5) == 0)
>  	  {
>  	    init_gcc_specs (&obstack,
> +			    "-lgcc_nonshared "
>  			    "-lgcc_s"
>  #ifdef USE_LIBUNWIND_EXCEPTIONS
>  			    " -lunwind"
>  #endif
>  			    ,
> +			    "-lgcc_nonshared "
>  			    "-lgcc",
>  			    "-lgcc_eh"
>  #ifdef USE_LIBUNWIND_EXCEPTIONS
> @@ -1591,7 +1593,9 @@ init_spec (void)
>  	    /* Ug.  We don't know shared library extensions.  Hope that
>  	       systems that use this form don't do shared libraries.  */
>  	    init_gcc_specs (&obstack,
> +			    "libgcc_nonshared.a%s "
>  			    "-lgcc_s",
> +			    "libgcc_nonshared.a%s "
>  			    "libgcc.a%s",
>  			    "libgcc_eh.a%s"

Why do you need to link libgcc_nonshared.a twice here?  -lgcc_s surely won't
add any new __cpu* undefined references.

> @@ -424,3 +424,8 @@ __cpu_indicator_init (void)
>  
>    return 0;
>  }
> +
> +#if defined SHARED && !defined _WIN32
> +__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
> +__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
> +#endif

Will this work on Solaris?
I'd say you at least want to also guard with some configure check if
.symver is supported by assembler.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]