pkgsrc-Bugs archive

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

pkg/57658: devel/binutils not sure if include/ansidecl.h should be installed



>Number:         57658
>Category:       pkg
>Synopsis:       devel/binutils not sure if include/ansidecl.h should be installed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 15 03:15:00 +0000 2023
>Originator:     David Shao
>Release:        pkgsrc current
>Organization:
>Environment:
NetBSD xxxxx@xxx 10.99.10 NetBSD 10.99.10 (GENERIC) #1: Wed Oct 11 03:08:23 PDT 2023  xxxxx@xxx:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
devel/binutils installs into $PREFIX include/ansidecl.h.  I have my doubts this is a good idea.

For example, building say lang/gcc10, it has its own ansidecl.h, and say the file

gcc-10.5.0/libiberty/objalloc.c

has a line

#include "ansidecl.h"

Unfortunately, gcc10's own ansidecl.h

gcc-10.5.0/include/ansidecl.h

is not the same as binutil's.  In particular, gcc10 defines PTR.

I actually had a reason to do this on DragonFly, but suppose one adds a single line

.include "../../devel/binutils/buildlink3.mk"

to lang/gcc10's Makefile.common.

The compilation will fail with

../../gcc-10.5.0/libiberty/objalloc.c: In function 'objalloc_create':
../../gcc-10.5.0/libiberty/objalloc.c:95:18: error: 'PTR' undeclared (first use in this function)
   95 |   ret->chunks = (PTR) malloc (CHUNK_SIZE);
      |                  ^~~
../../gcc-10.5.0/libiberty/objalloc.c:95:18: note: each undeclared identifier is reported only once for each function it appears in
../../gcc-10.5.0/libiberty/objalloc.c:95:22: error: expected ';' before 'malloc'
   95 |   ret->chunks = (PTR) malloc (CHUNK_SIZE);

What the single line 

.include "../../devel/binutils/buildlink3.mk"

does among other things is add to work/.buildlink/include

ansidecl.h -> /usr/pkg/include/ansidecl.h

The installation of ansidecl.h into /usr/pkg/include by binutils therefore seems to create a potential conflict in such situation.


>How-To-Repeat:

>Fix:
Ravenports removes ansidecl.h from STAGEDIR so that it does not get installed at all.  I don't have the impression Linux From Scratch installs this file either.



Home | Main Index | Thread Index | Old Index