From owner-svn-src-head@FreeBSD.ORG Sun Jun 24 08:43:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91AAE106566B; Sun, 24 Jun 2012 08:43:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1D08FC0A; Sun, 24 Jun 2012 08:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O8hYMw098201; Sun, 24 Jun 2012 08:43:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O8hYmo098199; Sun, 24 Jun 2012 08:43:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201206240843.q5O8hYmo098199@svn.freebsd.org> From: Andrew Turner Date: Sun, 24 Jun 2012 08:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237528 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 08:43:34 -0000 Author: andrew Date: Sun Jun 24 08:43:34 2012 New Revision: 237528 URL: http://svn.freebsd.org/changeset/base/237528 Log: Create a symlink to sys/elf32.h, sys/elf64.h, and sys/elf_common.h. When building libelf in the bootstrap stage this would include the tree versions of, for example, sys/_types.h. This would work as long as the tree's version of this file was close enough to the system's version of the file. If, however, there was a change in the tree such that the location of a typedef was moved this would cause problems. In this case the version of sys/_types.h in the tree no longer defines __wchar_t and expects it to to be defined in machine/_types.h, however we pick up machine/_types.h from the system and find it is not defined there. The solution is to restrict the parts of sys er include from the tree to those that are needed. This fixes the recent Tinderbox failure. Pointy Hat to: andrew Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Sun Jun 24 08:28:06 2012 (r237527) +++ head/lib/libelf/Makefile Sun Jun 24 08:43:34 2012 (r237528) @@ -55,9 +55,23 @@ SRCS= elf_begin.c \ ${GENSRCS} INCS= libelf.h gelf.h +# +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys +CFLAGS+= -I${.CURDIR} -I. + +sys/elf32.h sys/elf64.h sys/elf_common.h: sys + ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} + +sys: + mkdir -p ${.OBJDIR}/sys SHLIB_MAJOR= 1