Skip to content

Commit b64a52d

Browse files
robarnoldbrson
authored andcommitted
Integrate libuv into the build system
1 parent 904f443 commit b64a52d

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

mk/rt.mk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ RUNTIME_HDR := rt/globals.h \
6565

6666
RUNTIME_DEF := rt/rustrt$(CFG_DEF_SUFFIX)
6767
RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash \
68-
-I $(S)src/rt/arch/i386
68+
-I $(S)src/rt/arch/i386 -I $(S)src/rt/libuv
6969
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o) $(RUNTIME_LL:.ll=.o) $(RUNTIME_S:.s=.o)
70-
RUNTIME_LIBS := $(CFG_GCCISH_POST_LIB_FLAGS)
70+
RUNTIME_LIBS := $(S)src/rt/libuv/uv.a
7171

7272

7373
rt/%.o: rt/%.cpp $(MKFILES)
@@ -92,9 +92,14 @@ rt/%.o: rt/%.ll $(MKFILES)
9292
@$(call E, llc: $@)
9393
$(Q)$(LLC) -filetype=obj -relocation-model=pic -march=x86 -o $@ $<
9494

95-
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF)
95+
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) $(RUNTIME_LIBS)
9696
@$(call E, link: $@)
97-
$(Q)$(call CFG_LINK_C,$@,$(RUNTIME_LIBS) $(RUNTIME_OBJS),$(RUNTIME_DEF))
97+
$(Q)$(call CFG_LINK_C,$@,$(CFG_GCCISH_POST_LIB_FLAGS) $(RUNTIME_LIBS) $(RUNTIME_OBJS),$(RUNTIME_DEF))
98+
99+
$(S)src/rt/libuv/uv.a: rt/libuv/LIBUV_REVISION
100+
$(Q)$(MAKE) -C $(S)src/rt/libuv CFLAGS=\"-m32\" LDFLAGS=\"-m32\"
101+
$(Q)mkdir -p rt/libuv
102+
$(Q)cp $(S)src/rt/libuv/uv.a rt/libuv/uv.a
98103

99104
# These could go in rt.mk or rustllvm.mk, they're needed for both.
100105

src/rt/libuv/LIBUV_REVISION

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This subtree is pulled from:
2+
2b5707d834a6b85b8e589ac04cb61a6db2dab94b
3+
4+
When pulling in a new version of libuv, please update this file to ensure that
5+
everyone correctly rebuilds libuv.

0 commit comments

Comments
 (0)