From c0f5aeb0329d71e6b02379133c0c9c0145c9afea Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 31 Mar 2016 17:27:01 +0000 Subject: [PATCH] WITHOUT_TOOLCHAIN: Fix build of rtld. MK_TOOLCHAIN==no disables building and installing of pic archives. c_pic.a is still needed for rtld though so force it to build in lib/libc and link directly to the objdir version of it for rtld. Somehow this has been broken since r148725. Sponsored by: EMC / Isilon Storage Division --- lib/libc/Makefile | 3 +++ libexec/rtld-elf/Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 707fc1a46a18..8b3f201cd06a 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -5,6 +5,9 @@ SHLIBDIR?= /lib .include +# Force building of libc_pic.a +MK_TOOLCHAIN= yes + LIBC_SRCTOP?= ${.CURDIR} # Pick the current architecture directory for libc. In general, this is diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index ae49e9bd75a3..60e08afe867f 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -45,6 +45,9 @@ CFLAGS+= -fvisibility=hidden .endif LDFLAGS+= -shared -Wl,-Bsymbolic LIBADD= c_pic +.if ${MK_TOOLCHAIN} == "no" +LDFLAGS+= -L${LIBCDIR} +.endif .if ${MACHINE_CPUARCH} == "arm" # Some of the required math functions (div & mod) are implemented in