Skip to content

Need Support For Building Tools From Bytecode #970

@llvmbot

Description

@llvmbot
Bugzilla Link 598
Resolution LATER
Resolved on Feb 22, 2010 12:44
Version 1.0
OS All
Depends On llvm/llvm-bugzilla-archive#731
Reporter LLVM Bugzilla Contributor

Extended Description

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:

LEVEL=../..
NAME=hello
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillabuild-problemenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions