Skip to content

Commit

Permalink
Pass libstdc++.so path to linker under OpenBSD
Browse files Browse the repository at this point in the history
By default, the linker in use under OpenBSD is the linker of base, which
don't include /usr/local/lib where libstdc++ of gcc-4.9 lives. We need
to add this directory to linker-path-search (using -L).

Search the path of libstdc++.a, which is a known name (libstdc++.so has
SO_VERSION) in the same directory.
  • Loading branch information
semarie committed Sep 20, 2015
1 parent 25aaeb4 commit 049d76b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mk/platform.mk
Expand Up @@ -208,6 +208,14 @@ define CFG_MAKE_TOOLCHAIN

ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)

# On OpenBSD, we need to pass the path of libstdc++.so to the linker
# (use path of libstdc++.a which is a known name for the same path)
ifeq ($(OSTYPE_$(1)),unknown-openbsd)
RUSTC_FLAGS_$(1)=-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
-print-file-name=lib$(CFG_STDCPP_NAME).a))" \
$(RUSTC_FLAGS_$(1))
endif

# On Bitrig, we need the relocation model to be PIC for everything
ifeq (,$(filter $(OSTYPE_$(1)),bitrig))
LLVM_MC_RELOCATION_MODEL="pic"
Expand Down

0 comments on commit 049d76b

Please sign in to comment.