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: Jack Howarth <howarth dot at dot gcc at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Ian Lance Taylor <ian at airs dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>, Iain Sandoe <iain at codesourcery dot com>, Mike Stump <mikestump at comcast dot net>
- Date: Tue, 31 Mar 2015 12:39:17 -0400
- 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> <20150331053855 dot GB2121 at tucnak dot redhat dot com> <CAMe9rOrm=9gkqjFwEX8GVtri3t2mSmgOqfm_Q+LizCJqbLSAKQ at mail dot gmail dot com> <CAJMcOU_Pjryr7TxKx9zYKBtVEvBj8bmXDr=UBqShyE0CPr-cOA at mail dot gmail dot com> <CAMe9rOoRkeyw9SMuEev_ATE932UNhJBUPUd+Z81Qc1L+VpVkxw at mail dot gmail dot com> <CAJMcOU915GeWmwhTOvqXPQddZfYdJdVGQJUbMWXTEiz4y0QW9w at mail dot gmail dot com> <CAMe9rOp9kPZFhEE=seWX_VXC0NndYxtJ8Opt-kkCMSteeTuRuA at mail dot gmail dot com>
On Tue, Mar 31, 2015 at 12:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Mar 31, 2015 at 9:09 AM, Jack Howarth <howarth.at.gcc@gmail.com> wrote:
>> H.J.,
>> Did you attach the correct version of the patch? I don't see
>> anything conditional on linux.
>> Jack
>
> My patch will build and install libgcc_nonshared.a for all targets. If you
> don't link against it, nothing is changed. On Linux, it is used via the
> init_spec change.
Isn't...
diff --git a/gcc/gcc.c b/gcc/gcc.c
index d956c36..3fbd549 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1566,6 +1566,7 @@ 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"
@@ -1591,6 +1592,7 @@ 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.a%s",
"libgcc_eh.a%s"
problematic for Solaris? I am unfamiliar with the Solaris spec
handling but sol2.h doesn't seem to have any instances of -lgcc which
might imply they use the stock compiler invocation which will now have
a non-existent libgcc_nonshared static library.
Also, are you leaving the cpu symbols in libgcc.a on non-linux
targets? If not, the linkage failure reported in
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01668.html will occur,
no?
Jack
>
> --
> H.J.