Changes between Version 5 and Version 6 of Ticket #54242, comment 1


Ignore:
Timestamp:
Jul 20, 2017, 7:27:51 AM (7 years ago)
Author:
kencu (Ken)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #54242, comment 1

    v5 v6  
    1 First of all, for anyone who would like to duplicate this build, to get to this point, a few preliminary steps are needed, as outlined here [ticket:53184]. Also, if I can fix this one last issue, I'll make available a port file that installs llvm-3.8 and clang-3.8 automatically on 10.5 PPC, as there are a few tiny adjustments needed during the PPC build. If you want to see the current Portfile and patch tree, it is in <http://github.com/kencu/LeopardPorts>
    2 
    3 
    4 During configuration, this is noted:
     1To generate the libclang_rt.builtins library for ppc, go into the build directory:
    52{{{
    6 CMake Warning at projects/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake:33 (message):
    7   Detecting supported architectures from 'ld -v' failed.  Returning default
    8   set.
    9 Call Stack (most recent call first):
    10   projects/compiler-rt/cmake/config-ix.cmake:347 (darwin_get_toolchain_supported_archs)
    11   projects/compiler-rt/CMakeLists.txt:206 (include)
    12 
    13 
    14 -- Toolchain supported arches: i386;x86_64;ppc;ppc64;armv7;armv7s;arm64
    15 -- Finding valid architectures for osx...
    16 -- OSX supported arches:
    17 -- Finding valid architectures for 10.4...
    18 -- OSX 10.4 supported arches: i386;x86_64;ppc;ppc64
    19 -- Compiler-RT supported architectures:
    20 CMake Warning at projects/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake:216 (message):
    21   Not generating lipo target for clang_rt.cc_kext because no input libraries
    22   exist.
    23 Call Stack (most recent call first):
    24   projects/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake:334 (darwin_lipo_libs)
    25   projects/compiler-rt/lib/builtins/CMakeLists.txt:364 (darwin_add_builtin_libraries)
    26 
    27 
    28 CMake Warning at projects/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake:216 (message):
    29   Not generating lipo target for clang_rt.osx because no input libraries
    30   exist.
     3cd /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins
    314}}}
    325
    33 And this generated file from cmake: `./build/projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.10.4.dir/build.make` contains references to i386 and x86_64:
     6and manually make the file. Note that the name of the file suggests it's i386 code, but this is not right -- it's ppc code.
    347{{{
    35 lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a: lib/libclang_rt.builtins_i386_10.4.a
    36 lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a: lib/libclang_rt.builtins_x86_64_10.4.a
    37         @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating ../../../../lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a"
    38         cd /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && /opt/local/bin/cmake -E make_directory /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin
    39         cd /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && lipo -output /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch i386 /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a -arch x86_64 /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_x86_64_10.4.a
     8lipo -output /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch ppc /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a
    409}}}
    41 which leads to the failure line noted above.
    42 
    43 The first issue is that both of the generated libclang_rt.builtins* files are ppc (neither is ppc64), and neither is the i386 or x86_64 code they are labelled as being, but that's not too important as for now we're only after ppc anyway.
    44 {{{
    45 $ cd `port work clang-3.8`
    46 $ lipo -info ./build/lib/libclang_rt.builtins_i386_10.4.a
    47 input file ./build/lib/libclang_rt.builtins_i386_10.4.a is not a fat file
    48 Non-fat file: ./build/lib/libclang_rt.builtins_i386_10.4.a is architecture: ppc
    49 $ lipo -info ./build/lib/libclang_rt.builtins_x86_64_10.4.a
    50 input file ./build/lib/libclang_rt.builtins_x86_64_10.4.a is not a fat file
    51 Non-fat file: ./build/lib/libclang_rt.builtins_x86_64_10.4.a is architecture: ppc
    52 }}}
    53 
    54 The second issue is that the -arch for the libclang_rt.builtins_i386_10.4.a has to be `ppc`.
    55 
    56 To generate the libclang_rt.builtins library for ppc, edit the
    57 `./build/projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.10.4.dir/build.make`
    58 
    59 and change this line (note I'm in a custom repo here -- your file path will be a bit different):
    60 {{{
    61 cd /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && lipo -output /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch i386 /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a -arch x86_64 /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_x86_64_10.4.a
    62 }}}
    63 
    64 to this, updating the arch type from `-create -arch i386` to `-create -arch ppc`  (leave the file name alone, although it's incorrect), and deleting the second arch (as it is also ppc, and we only want one ppc architecture):
    65 {{{
    66 cd /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && lipo -output /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch ppc /opt/local/var/macports/build/_opt_LeopardPorts_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a
    67 }}}