fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
848 B24 linesraw
1# ignore-cross-compile
2include ../tools.mk
3
4# ignore-windows-msvc
5
6# rustc will remove one of the two redundant references to foo below.  Depending
7# on which one gets removed, we'll get a linker error on SOME platforms (like
8# Linux).  On these platforms, when a library is referenced, the linker will
9# only pull in the symbols needed _at that point in time_.  If a later library
10# depends on additional symbols from the library, they will not have been pulled
11# in, and you'll get undefined symbols errors.
12#
13# So in this example, we need to ensure that rustc keeps the _later_ reference
14# to foo, and not the former one.
15RUSTC_FLAGS = \
16    -l static=bar \
17    -l foo \
18    -l static=baz \
19    -l foo \
20    --print link-args
21
22all: $(call DYLIB,foo) $(call STATICLIB,bar) $(call STATICLIB,baz)
23	$(RUSTC) $(RUSTC_FLAGS) main.rs
24	$(call RUN,main)