summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2012-06-24 08:43:34 +0000
committerandrew <andrew@FreeBSD.org>2012-06-24 08:43:34 +0000
commit8de91ca9a541c8f3d6346777916ef08067f4931f (patch)
tree558eca903d2518ad05a714025000ffd9cac8ac69
parentb5c3afbe7d6ad247172006c5106e9399b853ca63 (diff)
downloadFreeBSD-src-8de91ca9a541c8f3d6346777916ef08067f4931f.zip
FreeBSD-src-8de91ca9a541c8f3d6346777916ef08067f4931f.tar.gz
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
-rw-r--r--lib/libelf/Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index fe921cb..5825df1 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -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
OpenPOWER on IntegriCloud