Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132628384
D8388.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D8388.diff
View Options
Index: head/Makefile.inc1
===================================================================
--- head/Makefile.inc1
+++ head/Makefile.inc1
@@ -543,8 +543,8 @@
CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \
CPP="${XCPP} ${XCFLAGS}" \
- AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
- OBJCOPY="${XOBJCOPY}" \
+ AS="${XAS}" AR="${XAR}" LD="${XLD}" LLVM_LINK="${XLLVM_LINK}" \
+ NM=${XNM} OBJCOPY="${XOBJCOPY}" \
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
SIZE="${XSIZE}"
Index: head/share/mk/bsd.lib.mk
===================================================================
--- head/share/mk/bsd.lib.mk
+++ head/share/mk/bsd.lib.mk
@@ -78,7 +78,7 @@
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
# .pico used for PIC object files
-.SUFFIXES: .out .o .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
+.SUFFIXES: .out .o .bc .ll .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
.if !defined(PICFLAG)
.if ${MACHINE_CPUARCH} == "sparc64"
@@ -199,6 +199,18 @@
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
+.if defined(LLVM_LINK)
+BCOBJS= ${OBJS:.o=.bco} ${STATICOBJS:.o=.bco}
+LLOBJS= ${OBJS:.o=.llo} ${STATICOBJS:.o=.llo}
+CLEANFILES+= ${BCOBJS} ${LLOBJS}
+
+lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS}
+ ${LLVM_LINK} -o ${.TARGET} ${BCOBJS}
+
+lib${LIB_PRIVATE}${LIB}.ll: ${LLOBJS}
+ ${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS}
+.endif
+
.if defined(SHLIB_NAME) || \
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
SOBJS+= ${OBJS:.o=.pico}
Index: head/share/mk/bsd.prog.mk
===================================================================
--- head/share/mk/bsd.prog.mk
+++ head/share/mk/bsd.prog.mk
@@ -4,7 +4,7 @@
.include <bsd.init.mk>
.include <bsd.compiler.mk>
-.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm
+.SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm
# XXX The use of COPTS in modern makefiles is discouraged.
.if defined(COPTS)
@@ -147,6 +147,19 @@
${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET}
.endif
+.if defined(LLVM_LINK)
+# LLVM bitcode / textual IR representations of the program
+BCOBJS= ${OBJS:.o=.bco}
+LLOBJS= ${OBJS:.o=.llo}
+
+${PROG_FULL}.bc: ${BCOBJS}
+ ${LLVM_LINK} -o ${.TARGET} ${BCOBJS}
+
+${PROG_FULL}.ll: ${LLOBJS}
+ ${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS}
+
+.endif # defined(LLVM_LINK)
+
.if ${MK_MAN} != "no" && !defined(MAN) && \
!defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
@@ -166,14 +179,14 @@
.endif
.if defined(PROG)
-CLEANFILES+= ${PROG}
+CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll
.if ${MK_DEBUG_FILES} != "no"
-CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug
+CLEANFILES+= ${PROG_FULL} ${PROG_FULL}.bc ${PROGNAME}.debug ${PROG_FULL}.ll
.endif
.endif
.if defined(OBJS)
-CLEANFILES+= ${OBJS}
+CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS}
.endif
.include <bsd.libnames.mk>
Index: head/share/mk/sys.mk
===================================================================
--- head/share/mk/sys.mk
+++ head/share/mk/sys.mk
@@ -231,6 +231,8 @@
MAKE ?= make
.if !defined(%POSIX)
+LLVM_LINK ?= llvm-link
+
LORDER ?= lorder
NM ?= nm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 19, 1:55 PM (13 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23909739
Default Alt Text
D8388.diff (3 KB)
Attached To
Mode
D8388: Add rules to build LLVM IR binaries and libraries.
Attached
Detach File
Event Timeline
Log In to Comment