[llvm-dev] distributed thinlto usage

David Callahan via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 8 14:38:29 PST 2019


        I am trying to work through the usage of thinlto for distributed builds.



        Here is the simple thinlto usage, just add -flto=thin everywhere, easy:



        clang++  -flto=thin -O3 -c -o CreateWay_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else CreateWay_.cpp

        clang++  -flto=thin -O3 -c -o Places_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Places_.cpp

        clang++  -flto=thin -O3 -c -o RegBounds_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegBounds_.cpp

        clang++  -flto=thin -O3 -c -o RegMng_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegMng_.cpp

        clang++  -flto=thin -O3 -c -o Way2_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Way2_.cpp

        clang++  -flto=thin -O3 -c -o WayInit_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else WayInit_.cpp

        clang++  -flto=thin -O3 -c -o Library.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Library.cpp

        clang++  -flto=thin -O3 -c -o Random.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Random.cpp

        clang++  -flto=thin -O3 -c -o Region_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Region_.cpp

        clang++  -flto=thin -O3 -c -o RegWay_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegWay_.cpp

        clang++  -flto=thin -O3 -c -o Way_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Way_.cpp

        clang++ -flto=thin -O3 -o astar.thin  CreateWay_.o Places_.o RegBounds_.o RegMng_.o Way2_.o WayInit_.o Library.o Random.o Region_.o RegWay_.o Way_.o





        My understanding is for the distributed, you need to do the inital compiles as above,

        then a special link to get the thinlto index files, then compile again to get

        native files, and then a final link. This looks like the following but

        it does not work:



        clang++  -flto=thin -O3 -c -o CreateWay_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else CreateWay_.cpp

        clang++  -flto=thin -O3 -c -o Places_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Places_.cpp

        clang++  -flto=thin -O3 -c -o RegBounds_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegBounds_.cpp

        clang++  -flto=thin -O3 -c -o RegMng_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegMng_.cpp

        clang++  -flto=thin -O3 -c -o Way2_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Way2_.cpp

        clang++  -flto=thin -O3 -c -o WayInit_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else WayInit_.cpp

        clang++  -flto=thin -O3 -c -o Library.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Library.cpp

        clang++  -flto=thin -O3 -c -o Random.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Random.cpp

        clang++  -flto=thin -O3 -c -o Region_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Region_.cpp

        clang++  -flto=thin -O3 -c -o RegWay_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else RegWay_.cpp

        clang++  -flto=thin -O3 -c -o Way_.o -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LITTLE_ENDIAN -Wno-dangling-else Way_.cpp

        clang++ -flto=thin -O3 -o thinlto.objects  -Wl,-plugin-opt,thinlto-index-only=thinlto.objects CreateWay_.o Places_.o RegBounds_.o RegMng_.o Way2_.o WayInit_.o Library.o Random.o Region_.o RegWay_.o Way_.o

        clang++ -c -x ir CreateWay_.o -O3 -o CreateWay_-native.o -fthinlto-index=CreateWay_.o.thinlto.bc

        clang++ -c -x ir Places_.o -O3 -o Places_-native.o -fthinlto-index=Places_.o.thinlto.bc

        clang++ -c -x ir RegBounds_.o -O3 -o RegBounds_-native.o -fthinlto-index=RegBounds_.o.thinlto.bc

        clang++ -c -x ir RegMng_.o -O3 -o RegMng_-native.o -fthinlto-index=RegMng_.o.thinlto.bc

        clang++ -c -x ir Way2_.o -O3 -o Way2_-native.o -fthinlto-index=Way2_.o.thinlto.bc

        clang++ -c -x ir WayInit_.o -O3 -o WayInit_-native.o -fthinlto-index=WayInit_.o.thinlto.bc

        clang++ -c -x ir Library.o -O3 -o Library-native.o -fthinlto-index=Library.o.thinlto.bc

        clang++ -c -x ir Random.o -O3 -o Random-native.o -fthinlto-index=Random.o.thinlto.bc

        clang++ -c -x ir Region_.o -O3 -o Region_-native.o -fthinlto-index=Region_.o.thinlto.bc

        clang++ -c -x ir RegWay_.o -O3 -o RegWay_-native.o -fthinlto-index=RegWay_.o.thinlto.bc

        clang++ -c -x ir Way_.o -O3 -o Way_-native.o -fthinlto-index=Way_.o.thinlto.bc

        clang++ -o astar CreateWay_-native.o Places_-native.o RegBounds_-native.o RegMng_-native.o Way2_-native.o WayInit_-native.o Library-native.o Random-native.o Region_-native.o RegWay_-native.o Way_-native.o

        Library-native.o:(.data+0x0): undefined reference to `vtable for regwayobj'

        clang-8: error: linker command failed with exit code 1 (use -v to see invocation)

        make: *** [astar] Error 1



        Did I miss a step?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190108/7ab86f3e/attachment.html>


More information about the llvm-dev mailing list