-
Notifications
You must be signed in to change notification settings - Fork 13.4k
openbsd: pass stdc++ library path after LVVM library path #29794
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
Conversation
under openbsd, the library path of libstdc++ need to be explicit (due to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9). but when a recent LLVM is installed, rustc compilation pikes the bad LLVM version (which live in /usr/local/lib, which is same directory of libestdc++.so for gcc-4.9). this patch move the libstdc++ path from RUST_FLAGS_<target> to special variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in arguments.
@@ -128,7 +129,9 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \ | |||
$$(TSREQ$(1)_T_$(2)_H_$(3)) \ | |||
| $$(TBIN$(1)_T_$(2)_H_$(3))/ | |||
@$$(call E, rustc: $$@) | |||
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4) | |||
$$(STAGE$(1)_T_$(2)_H_$(3)) \ | |||
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this necessary to compile correctly? No other extra flags are passed in here so I'm a little wary this should be needed for correctness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. In this target, we do the final linking of a tool binary. So the path for libstdc++ has to be know.
Before, the value came from RUST_FLAGS_<target>
. Now we need to explicitly add it.
The error without it is:
note: /usr/bin/ld: cannot find -lestdc++
collect2: ld returned 1 exit status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm right, I guess maybe this'll all be nice to look at one day...
under openbsd, the library path of libstdc++ need to be explicit (due to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9). but when a recent LLVM is installed, rustc compilation pikes the bad LLVM version (which live in /usr/local/lib, which is same directory of libestdc++.so for gcc-4.9). this patch move the libstdc++ path from RUST_FLAGS_<target> to special variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in arguments. r? @alexcrichton
under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker
cc
is gcc-4.2, and not gcc-4.9).but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).
this patch move the libstdc++ path from RUST_FLAGS_ to special
variable, and use it after LLVM_LIBDIR_RUSTFLAGS_ in
arguments.
r? @alexcrichton