NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/55594: Error creating shared library using gcc-7.5.0 on NetBSD 9.0_STABLE



On Sunday, 23 August 2020, 14:45:05 GMT+5:30, David Holland <dholland-bugs%netbsd.org@localhost> wrote:

> On Thu, Aug 20, 2020 at 01:40:02PM +0000, Rajeev V. Pillai wrote:
>  > > Looks like ``-Wl,-shared'' is not the same as ``-shared''. I
>  > > thought it was.
>  >
>  > OK. I've tried gcc-8.3.0 & gcc-10.2.0, clang-8.0.1 &
>  > clang-10.0.1. None of them accept ``-Wl,-shared'' as a synonym
>  > for ``-shared''.
>  >
>  > I'll report a bug with the ncurses maintainer, instead.
>
> -Wl,-shared means "pass -shared to the linker and do nothing else"
> while -shared means "tell the compiler driver to build a shared
> library", which includes both passing -shared to the linker and also
> doing other things. Without the other things, you'll among other
> things get the wrong crstuff and it won't work.

When discussing this issue with Tom Dickey on the ncurses mailing-list,
he pointed out that passing ``-Wl,-shared'' instead of ``-shared''
works on NetBSD-8.0 for creating a shared library. His build log is
here:

https://lists.gnu.org/archive/html/bug-ncurses/2020-08/msg00086.html

I have access to a NetBSD-8.1 system (gcc (nb3 20180905) 5.5.0) and,
I can confirm that ``-Wl,-shared'' works there, too.

Seems a bit odd, no? Can you explain what's going on here?

Thanks,
RVP



Home | Main Index | Thread Index | Old Index