NetBSD-Bugs archive

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

re: misc/51098: NetBSD-current fails to build on Debian 7 host



The following reply was made to PR misc/51098; it has been noted by GNATS.

From: matthew green <mrg%eterna.com.au@localhost>
To: gnats-bugs%NetBSD.org@localhost, dogcow%netbsd.org@localhost
Cc: misc-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
    netbsd-bugs%netbsd.org@localhost, gson%gson.org@localhost (Andreas Gustafsson)
Subject: re: misc/51098: NetBSD-current fails to build on Debian 7 host
Date: Tue, 03 May 2016 16:34:32 +1000

 i've tracked this down to a "missing" -D_GNU_SOURCE when host-libiberty
 is configuring.  basename(3) (and friends) are all in <string.h> but
 a the normal compilation flags don't enable things outside of some other
 standard, and so the decl is missed.  we also need to ensure that host
 programs use the host libiberty config.h.
 
 i'm not sure what the right solution to this is.  the patch below gets
 beyond the latest error, but it's kind of linux specific and not really
 something we want to commit as-is.
 
 
 .mrg.
 
 
 diff -up -r usr.bin/backend/Makefile usr.bin/backend/Makefile
 --- usr.bin/backend/Makefile	2016-03-26 18:05:34.732652354 -0700
 +++ usr.bin/backend/Makefile	2016-05-02 23:15:21.252423686 -0700
 @@ -8,6 +8,8 @@ SRCS=3D		${G_OBJS:.o=3D.c} ${G_out_file:T} r
  =
 
  BOTH_CPPFLAGS+=3D	-I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*=
 :N-I.*}
  CPPFLAGS+=3D	${BOTH_CPPFLAGS} -DTARGET_NAME=3D\"${MACHINE_GNU_PLATFORM}\"
 +HOST_CPPFLAGS+=3D	-I${HOST_LIBIBERTYOBJ}/libiberty
 +HOST_CPPFLAGS+=3D	-D_GNU_SOURCE
  HOST_CPPFLAGS+=3D	${BOTH_CPPFLAGS} -DGENERATOR_FILE
  DPSRCS+=3D	insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check=
 .h
  CPPFLAGS+=3D	-I${DIST}/libgcc
 @@ -20,6 +22,8 @@ HOSTPROG_CXX=3D	1
  =
 
  .include <bsd.own.mk>
  =
 
 +HOST_LIBIBERTYOBJ!=3D	cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
 +
  # XXX ${G_OBJS:.o=3D.c} is invalid in GCC 5.3, but work around for now
  BUILDSYMLINKS+=3D	${GNUHOSTDIST}/gcc/wide-int-print.cc wide-int-print.c
  BUILDSYMLINKS+=3D	${GNUHOSTDIST}/gcc/wide-int.cc wide-int.c
 diff -up -r usr.bin/host-libiberty/Makefile usr.bin/host-libiberty/Makefil=
 e
 --- usr.bin/host-libiberty/Makefile	2014-03-15 17:07:58.000000000 -0700
 +++ usr.bin/host-libiberty/Makefile	2016-05-02 23:04:35.488389145 -0700
 @@ -1,5 +1,7 @@
  #	$NetBSD: Makefile,v 1.3 2014/03/16 00:07:58 uwe Exp $
  =
 
 +HOST_CFLAGS+=3D	-D_GNU_SOURCE
 +
  libiberty/libiberty.a:
  	[ ! -d libiberty ] && mkdir libiberty || true
  	(cd libiberty; \
 


Home | Main Index | Thread Index | Old Index