From b74359a0a0c88893d37a2057a955773f399b6508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Sat, 19 Dec 2015 18:00:23 +0100 Subject: [PATCH] openbsd: use specific linker for building By default, rustc use `cc` as linker. Under OpenBSD, `cc` is gcc version 4.2.1. So use the compiler found at configure-time for linking: it will be gcc 4.9. It permits to resolv problem of finding -lestdc++ or -lgcc. For base gcc (4.2), there are in not standard path, whereas for ports gcc (4.9) there are in standard path. --- mk/cfg/x86_64-unknown-openbsd.mk | 1 + src/test/run-make/tools.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/mk/cfg/x86_64-unknown-openbsd.mk b/mk/cfg/x86_64-unknown-openbsd.mk index 261616ecf1fda..e6f28482284e0 100644 --- a/mk/cfg/x86_64-unknown-openbsd.mk +++ b/mk/cfg/x86_64-unknown-openbsd.mk @@ -20,3 +20,4 @@ CFG_LDPATH_x86_64-unknown-openbsd := CFG_RUN_x86_64-unknown-openbsd=$(2) CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2)) CFG_GNU_TRIPLE_x86_64-unknown-openbsd := x86_64-unknown-openbsd +RUSTC_FLAGS_x86_64-unknown-openbsd=-C linker=$(call FIND_COMPILER,$(CC)) diff --git a/src/test/run-make/tools.mk b/src/test/run-make/tools.mk index bee7936f158c5..efaf1197fbdba 100644 --- a/src/test/run-make/tools.mk +++ b/src/test/run-make/tools.mk @@ -85,6 +85,7 @@ ifeq ($(UNAME),Bitrig) else ifeq ($(UNAME),OpenBSD) EXTRACFLAGS := -lm -lpthread + RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))" else EXTRACFLAGS := -lm -lrt -ldl -lpthread EXTRACXXFLAGS := -lstdc++