-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Cannot compile rustc on FreeBSD #23287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I suspect the problem stems from the curious From my testing so far (on Linux), neither However, Linux's
Produces:
Remove the |
@aidancully What versions of tools are you using? e.g.:
|
I think the $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
$$(RUST_LIB_FLAGS_ST$(1)) \
-L "$$(RT_OUTPUT_DIR_$(2))" \
-L "$$(LLVM_LIBDIR_$(2))" \
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
$$(RUSTFLAGS_$(4)) \
--out-dir $$(@D) \
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
$$< I suspect ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
LLVM_STDCPP_LOCATION_$(1) = $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
-print-file-name=libstdc++.a)
else
LLVM_STDCPP_LOCATION_$(1) =
endif |
I was able to reproduce the problem on FreeBSD 9.2. Doing so required compiling and installing libcxxrt and libc++ from the FreeBSD source tree. The important thing is that I'm inclined to say that gcc and clang are both buggy, but even if they're fixed, it would take too long to propagate fixes. I'll see how hard this is to fix in the Rust makefile. We may want to fix |
Currently, target.mk passes -L "" when LLVM_STDCPP_LOCATION_$(2) is empty. This fixes rust-lang#23287.
@rprichard I think you're right about the problem being the odd
Rustc was the stage1 rustc compiled from 95d9046. Thanks! |
Currently, target.mk passes -L \"\" when LLVM_STDCPP_LOCATION_$(2) is empty. This fixes rust-lang#23287.
Problem was introduced in 95d9046.
Command line:
Produces error:
The problem seems to be that the FreeBSD linker expects "-L" to be a single argument, while
rustc
is splitting it into two arguments, "-L" and "". Running the following command line by hand:(same as before, but with
-L
and<path>
arguments merged into a single argument)This allowed the link to succeed.
The text was updated successfully, but these errors were encountered: