This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jack Howarth <howarth dot at dot gcc at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 31 Mar 2015 07:38:55 +0200
- Subject: Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE
- Authentication-results: sourceware.org; auth=none
- References: <20150330022527 dot GA4148 at gmail dot com> <CAMe9rOrUpMmt8XyqO9fXZB-Bn+tRs-AKHTaQzu7jeGCZFXen8g at mail dot gmail dot com> <CAMe9rOp_LfJ8C4Xh4NoRD=rTutNCeqwN_OV=8+c5rFfnRHbV_g at mail dot gmail dot com> <CAMe9rOrGCRJhWpNT0hMJwKCG2+vaDsaRou7JV0tdjiANnmRm=g at mail dot gmail dot com> <CAJMcOU8nON6S=+be8C94F_tB8-VPCusa8VrEq_f5P2PZCdk7vg at mail dot gmail dot com> <CAMe9rOo2ORmyvndySKr3vzEQmZScpKQfnVVw7HW94BXvPFJqdQ at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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