From a9ca11cb391455dc2e33417ea35d2ec9e2be1932 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 3 Jan 2018 17:35:38 +0000 Subject: [PATCH] Don't clobber system LDFLAGS for beri boot loaders. Prior to r325114, bsd.init.mk was included after assignments to CFLAGS and LDFLAGS in these Makefiles. After r325114, bare assignments (= rather than +=) lost system-assigned default values that are needed when compiling with an external toolchain. CFLAGS in both Makefiles already uses +=. This commit changes LDFLAGS to use +=. While here, depend on the LDFLAGS update in the parent Makefile.inc to set -nostdlib. Sponsored by: DARPA / AFRL --- stand/mips/beri/boot2/Makefile | 3 +-- stand/mips/beri/loader/Makefile | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stand/mips/beri/boot2/Makefile b/stand/mips/beri/boot2/Makefile index 4b1654f8d9da..ce09b6e3efe8 100644 --- a/stand/mips/beri/boot2/Makefile +++ b/stand/mips/beri/boot2/Makefile @@ -53,8 +53,7 @@ CFLAGS+= -I${LDRSRC} \ -fno-pic -mno-abicalls \ -g -LDFLAGS= -nostdlib \ - -static \ +LDFLAGS+= -static \ -Wl,-N \ -G0 \ -L${.CURDIR} diff --git a/stand/mips/beri/loader/Makefile b/stand/mips/beri/loader/Makefile index c791294b9746..46b927fddff2 100644 --- a/stand/mips/beri/loader/Makefile +++ b/stand/mips/beri/loader/Makefile @@ -85,8 +85,7 @@ CFLAGS+= -G0 \ -mno-abicalls \ -g -LDFLAGS= -nostdlib \ - -static \ +LDFLAGS+= -static \ -T ${.CURDIR}/loader.ldscript \ -L${.CURDIR} \ -e __start