svn commit: r264506 - stable/9/lib/libelf

Tijl Coosemans tijl at FreeBSD.org
Tue Apr 15 16:10:48 UTC 2014


Author: tijl
Date: Tue Apr 15 16:10:47 2014
New Revision: 264506
URL: http://svnweb.freebsd.org/changeset/base/264506

Log:
  MFC r237528:
  
  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.
  
  MFC r237531:
  
  Add the sys directory we create to the list of items to clean.
  
  MFC r238741:
  
  Don't ever build files depending on the directory where they are placed in.
  It is obvious that its modification time will change with each such file
  builded.
  This bug cause whole libelf to rebuild itself each second make run
  (and relink that files on each first make run) in the loop.

Modified:
  stable/9/lib/libelf/Makefile
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libelf/   (props changed)

Modified: stable/9/lib/libelf/Makefile
==============================================================================
--- stable/9/lib/libelf/Makefile	Tue Apr 15 15:58:06 2014	(r264505)
+++ stable/9/lib/libelf/Makefile	Tue Apr 15 16:10:47 2014	(r264506)
@@ -55,9 +55,22 @@ 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
+CLEANDIRS=	sys
+CFLAGS+=	-I${.CURDIR} -I.
+
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
+	mkdir -p ${.OBJDIR}/sys
+	ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
 
 SHLIB_MAJOR=	1
 


More information about the svn-src-stable-9 mailing list