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


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