[LLVMbugs] [Bug 598] NEW: Need Support For Building Tools From Bytecode

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jul 17 16:30:47 PDT 2005


           Summary: Need Support For Building Tools From Bytecode
           Product: Build scripts
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Makefiles
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com

Currently the makefile system doesn't help much when it comes to building tools
that involve bytecode. In particular the USEDLIBS feature doesn't allow a
bytecode library (.bca) or a bytecode module (.bc) to be specified. Although
compilation to bytecode (BYTECODE_LIBRARY and MODULE_NAME keywords) is
supported, there is no link time support that can use the bytecode files. These
should probably make use of llvmc and/or llvm-ld to accomplish the task.

In a case in point, Sean Peisert was attempting to get a very simple project
done and the makefiles got in the way. The task was simple: (a) write a pass
that instruments code with calls to a runtime library, (b) write the runtime
library, (c) write a simple test case, (d) compile it all so that the effect of
the pass on the test case can be explored.  

The LLVM makefile system works well for all of this except when it comes time to
compile/link the test program. In this particular situation, we had to use a
Makefile with the following content in order to get things to work:

include $(LEVEL)/Makefile.common

all:: $(ToolDir)/$(NAME)

$(ToolDir)/$(NAME): $(PROJ_SRC_DIR)/hello.c $(ToolDir)/.dir
        $(LLVMGCC) -o $(ToolDir)/hello $(PROJ_SRC_DIR)/hello.c \
        $(LibDir)/getalloca.bc -Wa,-disable-opt

Something like this (with much better dependency checking) is needed in
Makefile.rules so that tools with bytecode linked in can be constructed.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list