diff mbox

Use a specfile that actually allows building programs on NetBSD

Message ID 20170104112426.GA1051@SDF.ORG
State New
Headers show

Commit Message

Maya Rashish Jan. 4, 2017, 11:24 a.m. UTC
Like most operating systems, NetBSD has a libc which contains
stuff it needs for most programs to work, and people expect
it to be linked without explicitly specifying -lc.

This patch is needed for just about any program to work.

---
 gcc/config/netbsd.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Maya Rashish Jan. 4, 2017, 12:39 p.m. UTC | #1
Identical patch was committed to NetBSD in April 28, 2008.
https://github.com/jsonn/src/commit/7105def538f68e0a0034f5c93ec7fc384ca849b2
Maya Rashish Jan. 9, 2017, 10:31 p.m. UTC | #2
3 month ping, 1 week ping (trying again), etc...

This patch has zero affect on non-netbsd users and was already
accepted in NetBSD years ago.

On Wed, Jan 04, 2017 at 11:24:27AM +0000, coypu wrote:
> Like most operating systems, NetBSD has a libc which contains
> stuff it needs for most programs to work, and people expect
> it to be linked without explicitly specifying -lc.
> 
> This patch is needed for just about any program to work.
> 
> ---
>  gcc/config/netbsd.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h
> index f2d6cc6..65ce943 100644
> --- a/gcc/config/netbsd.h
> +++ b/gcc/config/netbsd.h
> @@ -96,6 +96,7 @@ along with GCC; see the file COPYING3.  If not see
>         %{!pg:-lposix}}		\
>       %{p:-lposix_p}		\
>       %{pg:-lposix_p}}		\
> +   %{shared:-lc}		\
>     %{!shared:			\
>       %{!symbolic:		\
>         %{!p:			\
> @@ -109,6 +110,7 @@ along with GCC; see the file COPYING3.  If not see
>         %{!pg:-lposix}}		\
>       %{p:-lposix_p}		\
>       %{pg:-lposix_p}}		\
> +   %{shared:-lc}		\
>     %{!shared:			\
>       %{!symbolic:		\
>         %{!p:			\
> -- 
> 2.9.0
Krister Walfridsson Jan. 11, 2017, 3:41 p.m. UTC | #3
On Mon, 9 Jan 2017, coypu@SDF.ORG wrote:

> 3 month ping, 1 week ping (trying again), etc...

Apologies for not getting back to you sooner.


> Like most operating systems, NetBSD has a libc which contains
> stuff it needs for most programs to work, and people expect
> it to be linked without explicitly specifying -lc.

Well, most programs already get -lc automatically -- it is only when you 
pass -shared that it fails... :-)

But I'll fix this, together with some other SPEC issues, in a few days.

    /Krister
Maya Rashish Jan. 11, 2017, 4:40 p.m. UTC | #4
On Wed, Jan 11, 2017 at 04:41:44PM +0100, Krister Walfridsson wrote:
> On Mon, 9 Jan 2017, coypu@SDF.ORG wrote:
> 
> >3 month ping, 1 week ping (trying again), etc...
> 
> Apologies for not getting back to you sooner.
> 
> 
> >Like most operating systems, NetBSD has a libc which contains
> >stuff it needs for most programs to work, and people expect
> >it to be linked without explicitly specifying -lc.
> 
> Well, most programs already get -lc automatically -- it is only when you
> pass -shared that it fails... :-)
> 
> But I'll fix this, together with some other SPEC issues, in a few days.
> 
>    /Krister

yay! thanks

netbsd patches stuff a lot more here, but I try not to upstream
stuff I don't understand and did not need. I've done this to get
gcc from pkgsrc working more, and it does for x86, but not for
any other archs yet.
diff mbox

Patch

diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h
index f2d6cc6..65ce943 100644
--- a/gcc/config/netbsd.h
+++ b/gcc/config/netbsd.h
@@ -96,6 +96,7 @@  along with GCC; see the file COPYING3.  If not see
        %{!pg:-lposix}}		\
      %{p:-lposix_p}		\
      %{pg:-lposix_p}}		\
+   %{shared:-lc}		\
    %{!shared:			\
      %{!symbolic:		\
        %{!p:			\
@@ -109,6 +110,7 @@  along with GCC; see the file COPYING3.  If not see
        %{!pg:-lposix}}		\
      %{p:-lposix_p}		\
      %{pg:-lposix_p}}		\
+   %{shared:-lc}		\
    %{!shared:			\
      %{!symbolic:		\
        %{!p:			\