Skip to content

Commit

Permalink
openbsd: use specific linker for building
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
semarie committed Dec 20, 2015
1 parent e641896 commit b74359a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions mk/cfg/x86_64-unknown-openbsd.mk
Expand Up @@ -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))
1 change: 1 addition & 0 deletions src/test/run-make/tools.mk
Expand Up @@ -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++
Expand Down

0 comments on commit b74359a

Please sign in to comment.