[llvm-commits] [llvm] r144255 - in /llvm/trunk: CMakeLists.txt Makefile.rules lib/Target/LLVMBuild.txt utils/llvm-build/llvmbuild/main.py

Daniel Dunbar daniel at zuster.org
Tue May 8 11:20:40 PDT 2012


Hi Takumi,

Thanks for the report, I'll try to figure out a good solution for this...

 - Daniel

On Sat, May 5, 2012 at 7:28 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> Daniel,
>
> I found LLVMBuild might miss the new target when;
> (assume --enable-targets=all)
>
>  - configure got the new target (eg. NVPTX)
>  - Makefile.config was updated since configure had been updated.
>
> Then,
>
>  1) make (level 1) reads Makefile.config.
>      Then, TARGETS_TO_BUILD does not have NVPTX.
>  2) make (level 1) regenerates Makefile.config with newer configure.
>  3) --enable-targets "$(TARGETS_TO_BUILD)" (for Makefile.llvmbuild)
> is not expanded as the new $TARGETS_TO_BUILD.
>  X) llvm-config missed NVPTX until Makefile.llvmbuild would be updated.
>
>
> ...Takumi
>
>
> 2011/11/10 Daniel Dunbar <daniel at zuster.org>:
>> Author: ddunbar
>> Date: Wed Nov  9 19:16:48 2011
>> New Revision: 144255
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=144255&view=rev
>> Log:
>> build/Make & CMake: Pass the appropriate --native-target and --enable-targets
>> options to llvm-build, so the all-targets etc. components are defined properly.
>>
>> Modified:
>>    llvm/trunk/CMakeLists.txt
>>    llvm/trunk/Makefile.rules
>>    llvm/trunk/lib/Target/LLVMBuild.txt
>>    llvm/trunk/utils/llvm-build/llvmbuild/main.py
>>
>> Modified: llvm/trunk/CMakeLists.txt
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=144255&r1=144254&r2=144255&view=diff
>> ==============================================================================
>> --- llvm/trunk/CMakeLists.txt (original)
>> +++ llvm/trunk/CMakeLists.txt Wed Nov  9 19:16:48 2011
>> @@ -236,6 +236,8 @@
>>  message(STATUS "Constructing LLVMBuild project information")
>>  execute_process(
>>   COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL}
>> +            --native-target "${LLVM_NATIVE_ARCH}"
>> +            --enable-targets "${LLVM_TARGETS_TO_BUILD}"
>>             --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
>>             --write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
>>             ERROR_VARIABLE LLVMBUILDOUTPUT
>>
>> Modified: llvm/trunk/Makefile.rules
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=144255&r1=144254&r2=144255&view=diff
>> ==============================================================================
>> --- llvm/trunk/Makefile.rules (original)
>> +++ llvm/trunk/Makefile.rules Wed Nov  9 19:16:48 2011
>> @@ -92,6 +92,8 @@
>>  $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
>>        $(Echo) Constructing LLVMBuild project information.
>>        $(Verb) $(LLVMBuildTool) \
>> +         --native-target "$(ARCH)" \
>> +         --enable-targets "$(TARGETS_TO_BUILD)" \
>>          --write-library-table $(LLVMConfigLibraryDependenciesInc) \
>>          --write-make-fragment $(LLVMBuildMakeFrag)
>>
>>
>> Modified: llvm/trunk/lib/Target/LLVMBuild.txt
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/LLVMBuild.txt?rev=144255&r1=144254&r2=144255&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/LLVMBuild.txt (original)
>> +++ llvm/trunk/lib/Target/LLVMBuild.txt Wed Nov  9 19:16:48 2011
>> @@ -21,8 +21,9 @@
>>  parent = Libraries
>>  required_libraries = Core MC Support
>>
>> -; This is a convenient group we define (and expect targets to add to) which
>> -; makes it easy for tools to include every target.
>> +; This is a special group whose required libraries are extended (by llvm-build)
>> +; with every built target, which makes it easy for tools to include every
>> +; target.
>>  [component_1]
>>  type = LibraryGroup
>>  name = all-targets
>>
>> Modified: llvm/trunk/utils/llvm-build/llvmbuild/main.py
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=144255&r1=144254&r2=144255&view=diff
>> ==============================================================================
>> --- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
>> +++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Wed Nov  9 19:16:48 2011
>> @@ -505,7 +505,7 @@
>>     determined based on the target configuration options.
>>
>>     This currently is responsible for populating the required_libraries list of
>> -    the "Native", "NativeCodeGen", and "Engine" components.
>> +    the "all-targets", "Native", "NativeCodeGen", and "Engine" components.
>>     """
>>
>>     # Determine the available targets.
>> @@ -536,8 +536,14 @@
>>     if opts.enable_targets is None:
>>         enable_targets = available_targets.values()
>>     else:
>> +        # We support both space separated and semi-colon separated lists.
>> +        if ' ' in opts.enable_targets:
>> +            enable_target_names = opts.enable_targets.split()
>> +        else:
>> +            enable_target_names = opts.enable_targets.split(';')
>> +
>>         enable_targets = []
>> -        for name in opts.enable_targets.split():
>> +        for name in enable_target_names:
>>             target = available_targets.get(name)
>>             if target is None:
>>                 parser.error("invalid target to enable: %r (not in project)" % (
>> @@ -641,8 +647,8 @@
>>                       action="store", default=None)
>>     group.add_option("", "--enable-targets",
>>                       dest="enable_targets", metavar="NAMES",
>> -                      help=("Enable the given space separated list of targets, "
>> -                            "or all targets if not present"),
>> +                      help=("Enable the given space or semi-colon separated "
>> +                            "list of targets, or all targets if not present"),
>>                       action="store", default=None)
>>     parser.add_option_group(group)
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list