Skip to content

Commit

Permalink
remove specific code for OpenBSD that define STDCPP_LIBDIR_RUSTFLAGS
Browse files Browse the repository at this point in the history
it isn't the good way to process, as it makes conflicts when building rustc while another version of rustc in installed system-wide.
  • Loading branch information
semarie committed Dec 20, 2015
1 parent 27d5511 commit e641896
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
10 changes: 0 additions & 10 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,6 @@ 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)
STDCPP_LIBDIR_RUSTFLAGS_$(1)= \
-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
-print-file-name=lib$(CFG_STDCPP_NAME).a))"
else
STDCPP_LIBDIR_RUSTFLAGS_$(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
2 changes: 0 additions & 2 deletions mk/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
$$(RUSTFLAGS_$(4)) \
$$(RUSTFLAGS$(1)_$(4)) \
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
--out-dir $$(@D) \
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
$$<
Expand Down Expand Up @@ -130,7 +129,6 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
| $$(TBIN$(1)_T_$(2)_H_$(3))/
@$$(call E, rustc: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
-o $$@ $$< --cfg $(4)

Expand Down
7 changes: 3 additions & 4 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
-L "$$(RT_OUTPUT_DIR_$(2))" \
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
$$(RUSTFLAGS_$(4)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2))
$$(RUSTFLAGS_$(4))

endef

Expand Down Expand Up @@ -664,9 +663,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
--adb-path=$(CFG_ADB) \
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(3))" \
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(2))" \
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
$$(CTEST_TESTARGS)

ifdef CFG_VALGRIND_RPASS
Expand Down
5 changes: 0 additions & 5 deletions src/test/run-make/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ ifeq ($(UNAME),Bitrig)
else
ifeq ($(UNAME),OpenBSD)
EXTRACFLAGS := -lm -lpthread
# extend search lib for found estdc++ if build using gcc from
# ports under OpenBSD. This is needed for:
# - run-make/execution-engine
# - run-make/issue-19371
RUSTC := $(RUSTC) -L/usr/local/lib
else
EXTRACFLAGS := -lm -lrt -ldl -lpthread
EXTRACXXFLAGS := -lstdc++
Expand Down

0 comments on commit e641896

Please sign in to comment.