NetBSD Problem Report #51383

From www@NetBSD.org  Mon Aug  1 11:19:15 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 819197A2AA
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  1 Aug 2016 11:19:15 +0000 (UTC)
Message-Id: <20160801111914.8AA887A2AB@mollari.NetBSD.org>
Date: Mon,  1 Aug 2016 11:19:14 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: sys/cdefs.h not found on ubuntu
X-Send-Pr-Version: www-1.0

>Number:         51383
>Category:       pkg
>Synopsis:       sys/cdefs.h not found on ubuntu
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    linux-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 01 11:20:00 +0000 2016
>Closed-Date:    Tue Jun 19 02:38:09 +0000 2018
>Last-Modified:  Tue Jun 19 02:38:09 +0000 2018
>Originator:     Patrick Welche
>Release:        pkgsrc-current unpriviledged
>Organization:
>Environment:
Ubuntu 16.04.1 LTS
>Description:
Acquired a user login on an ubuntu 16 box, and tried out pkgsrc.
Bootstrapped --unpriviledged.
Tried to build gcc 4.8.4, but sys/cdefs.h not found:

In file included from /usr/include/stdio.h:27:0,
                 from ../../../../gcc-4.8.4/libgcc/../gcc/tsystem.h:87,
                 from ../../../../gcc-4.8.4/libgcc/libgcov.c:27:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
                         ^
compilation terminated.
...
make[4]: Leaving directory '/home/prlw1/pkgsrc/lang/gcc48/work/build/x86_64-debian-linux/libgcc'
...
$ find ~/pkg -name cdefs.h
$ find ~/pkgsrc -name cdefs.h
/home/prlw1/pkgsrc/lang/gcc48/work/gcc-4.8.4/fixincludes/tests/base/sys/cdefs.h
/home/prlw1/pkgsrc/devel/lcc/files/cdefs.h
/home/prlw1/pkgsrc/devel/bmake/files/missing/sys/cdefs.h
/home/prlw1/pkgsrc/pkgtools/libnbcompat/files/nbcompat/cdefs.h
/home/prlw1/pkgsrc/work/bmake/missing/sys/cdefs.h
/home/prlw1/pkgsrc/work/libnbcompat/nbcompat/cdefs.h
/home/prlw1/pkgsrc/work/wrk/devel/bmake/work/bmake/missing/sys/cdefs.h
/home/prlw1/pkgsrc/work/wrk/devel/bmake/work/libnbcompat/nbcompat/cdefs.h
/home/prlw1/pkgsrc/work/wrk/pkgtools/pkg_install/work/libnbcompat/nbcompat/cdefs.h
$

bmake/missing/sys/cdefs.h looks promising...
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Mon, 1 Aug 2016 17:51:14 +0000

 On Mon, Aug 01, 2016 at 11:20:00AM +0000, prlw1@cam.ac.uk wrote:
  > Acquired a user login on an ubuntu 16 box, and tried out pkgsrc.
  > Bootstrapped --unpriviledged.
  > Tried to build gcc 4.8.4, but sys/cdefs.h not found:
  > 
  > In file included from /usr/include/stdio.h:27:0,
  >                  from ../../../../gcc-4.8.4/libgcc/../gcc/tsystem.h:87,
  >                  from ../../../../gcc-4.8.4/libgcc/libgcov.c:27:
  > /usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
  >  #  include <sys/cdefs.h>

 So wait, ubuntu's own features.h includes a sys/cdefs.h they don't
 provide?

  > bmake/missing/sys/cdefs.h looks promising...

 I think the one you actually want is the nbcompat one though.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Mon, 1 Aug 2016 20:05:56 +0100

 On Mon, Aug 01, 2016 at 05:55:01PM +0000, David Holland wrote:
 >   > /usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
 >   >  #  include <sys/cdefs.h>
 >  
 >  So wait, ubuntu's own features.h includes a sys/cdefs.h they don't
 >  provide?

 Good point!

 ubuntu's /usr/include/features.h:

    364  /* This is here only because every header file already includes this one.  */
    365  #ifndef __ASSEMBLER__
    366  # ifndef _SYS_CDEFS_H
    367  #  include <sys/cdefs.h>
    368  # endif


 /usr/include/x86_64-linux-gnu/sys/cdefs.h exists.

 I'll try to figure out where it is looking...

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Mon, 1 Aug 2016 20:20:38 +0100

 On Mon, Aug 01, 2016 at 07:10:01PM +0000, Patrick Welche wrote:
 >  /usr/include/x86_64-linux-gnu/sys/cdefs.h exists.
 >  
 >  I'll try to figure out where it is looking...

 #include "..." search starts here:
 #include <...> search starts here:
  /usr/lib/gcc/x86_64-linux-gnu/5/include
  /usr/local/include
  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
  /usr/include/x86_64-linux-gnu
  /usr/include
 End of search list.

 so by default it should find it.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Wed, 3 Aug 2016 17:02:54 +0000

 On Mon, Aug 01, 2016 at 07:25:01PM +0000, Patrick Welche wrote:
  >  On Mon, Aug 01, 2016 at 07:10:01PM +0000, Patrick Welche wrote:
  >  >  /usr/include/x86_64-linux-gnu/sys/cdefs.h exists.
  >  >  
  >  >  I'll try to figure out where it is looking...
  >  
  >  #include "..." search starts here:
  >  #include <...> search starts here:
  >   /usr/lib/gcc/x86_64-linux-gnu/5/include
  >   /usr/local/include
  >   /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
  >   /usr/include/x86_64-linux-gnu
  >   /usr/include
  >  End of search list.
  >  
  >  so by default it should find it.

 Check work.log for the actual compiler invocation... you might getting
 something dumb like -nostdinc -I/usr/include. (shouldn't, but...)

 -- 
 David A. Holland
 dholland@netbsd.org

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Fri, 5 Aug 2016 10:40:42 +0100

 I should have included the line just above the errors:

 /home/prlw1/pkgsrc/lang/gcc48/work/build/./gcc/xgcc
   -B/home/prlw1/pkgsrc/lang/gcc48/work/build/./gcc/
   -B/home/prlw1/pkg/gcc48/x86_64-debian-linux/bin/
   -B/home/prlw1/pkg/gcc48/x86_64-debian-linux/lib/
   -isystem /home/prlw1/pkg/gcc48/x86_64-debian-linux/include
   -isystem /home/prlw1/pkg/gcc48/x86_64-debian-linux/sys-include
   -g -O2
   -I/usr/include
   -I/home/prlw1/pkg/include
   -O2 -g -O2
   -I/usr/include
   -I/home/prlw1/pkg/include
   -DIN_GCC
   -W -Wall
   -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
   -Wold-style-definition
   -isystem ./include
   -fpic
   -mlong-double-80
   -g
   -DIN_LIBGCC2
   -fbuilding-libgcc
   -fno-stack-protector
   -fpic
   -mlong-double-80
   -I.
   -I.
   -I../.././gcc
   -I../../../gcc-4.8.4/libgcc
   -I../../../gcc-4.8.4/libgcc/.
   -I../../../gcc-4.8.4/libgcc/../gcc
   -I../../../gcc-4.8.4/libgcc/../include
   -I../../../gcc-4.8.4/libgcc/config/libbid
   -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS
   -o _absvdi2.o
   -MT _absvdi2.o -MD -MP -MF _absvdi2.dep -DL_absvdi2
   -c ../../../gcc-4.8.4/libgcc/libgcc2.c
   -fvisibility=hidden
   -DHIDE_EXPORTS

 $ tail -2 .work.log
 [*] /home/prlw1/pkgsrc/lang/gcc48/work/.wrapper/bin/cc /home/prlw1/pkgsrc/lang/gcc48/work/.wrapper/bin/cc --version
 <.> /home/prlw1/pkgsrc/lang/gcc48/work/.gcc/bin/gcc --version -m64 -I/home/prlw1/pkgsrc/lang/gcc48/work/.buildlink/include -L/home/prlw1/pkgsrc/lang/gcc48/work/.buildlink/lib 

 (USE_CWRAPPERS=no)

 I wonder what "-fbuilding-libgcc" does...

 It doesn't look as though anything is switching off gcc version 5.4.0
 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.1)'s default search path...

 (BTW I'm only trying to do this because if you want to build anything involving
 fortran, it seems you need to PKGSRC_FORTRAN=gfortran, and that seems to insist
 on gcc48 even if gcc5 is installed - I haven't tried to build lang/gcc5 on linux
 yet, but that explains why not.)

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Fri, 5 Aug 2016 12:04:36 +0100

 On Fri, Aug 05, 2016 at 09:45:01AM +0000, Patrick Welche wrote:
 >  on gcc48 even if gcc5 is installed - I haven't tried to build lang/gcc5 on linux
 >  yet, but that explains why not.)

 Same issue for lang/gcc5:

 home/prlw1/pkgsrc/lang/gcc5/work/build/./gcc/xgcc -B/home/prlw1/pkgsrc/lang/gcc5/work/build/./gcc/ -B/home/prlw1/pkg/gcc5/x86_64-debian-linux/bin/ -B/home/prlw1/pkg/gcc5/x86_64-debian-linux/lib/ -isystem /home/prlw1/pkg/gcc5/x86_64-debian-linux/include -isystem /home/prlw1/pkg/gcc5/x86_64-debian-linux/sys-include    -g -O2 -I/usr/include -m32 -O2  -g -O2 -I/usr/include -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../../.././gcc -I../../../../gcc-5.4.0/libgcc -I../../../../gcc-5.4.0/libgcc/. -I../../../../gcc-5.4.0/libgcc/../gcc -I../../../../gcc-5.4.0/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o _gcov_merge_add.o -MT _gcov_merge_add.o -MD -MP -MF _gcov_merge_add.dep -DL_gcov_merge_add -c ../../../../gcc-5.4.0/libgcc/libgcov-merge.c
 In file included from /usr/include/stdio.h:27:0,
                  from ../../../../gcc-5.4.0/libgcc/../gcc/tsystem.h:87,
                  from ../../../../gcc-5.4.0/libgcc/libgcov.h:41,
                  from ../../../../gcc-5.4.0/libgcc/libgcov-merge.c:26:
 /usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
 compilation terminated.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Sat, 6 Aug 2016 20:31:54 +0000

 On Fri, Aug 05, 2016 at 09:45:01AM +0000, Patrick Welche wrote:
  >  I should have included the line just above the errors:
  >
  > [...]
  >    -I/usr/include
  >    -I/home/prlw1/pkg/include
  >    -isystem ./include

 This is probably the root of the problem, but I have no idea how to
 fix it :-/  gcc's build system is like poison ivy...

  >  I wonder what "-fbuilding-libgcc" does...

 Probably keeps it from optimizing libgcc functions into calls to
 themselves.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Kai-Uwe Eckhardt <kai-uwe.eckhardt@uni-rostock.de>
To: <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/51383: sys/cdefs.h not found on ubuntu
Date: Tue, 18 Oct 2016 09:51:53 +0200

 This still causes a lot of failures in pkgsrc-bulk and judging from

 http://askubuntu.com/questions/470796/fatal-error-sys-cdefs-h-no-such-file-or-directory/590832#590832

 and packages.ubuntu.com and packages.debian.org Debian/Ubuntu
 systems need

 sudo apt-get install g++-multilib

 to get a complete build system. Or pkgsrc has to fix problems with the
 multilib options of anything gcc related.

 Kai-Uwe Eckhardt

Responsible-Changed-From-To: pkg-manager->linux-pkg-people
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Tue, 18 Oct 2016 10:40:18 +0000
Responsible-Changed-Why:
Linux problem


State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 02:38:09 +0000
State-Changed-Why:
Local problem - you are missing packages. pkgsrc doesn't have a realistic way to compensate for it.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.