[LLVMdev] Recompiling llvm+clang how-to?
Journeyer J. Joh
oosaprogrammer at gmail.com
Fri Jul 13 17:42:20 PDT 2012
Hello Mr. Ciao and people on our list
I tried this last night and now in the morning I captured the problem status.
Could you please advise me on this problem?
- I downloaded brand new clang+llvm and compiled it as instructed from
the url below.
>> http://clang.llvm.org/get_started.html
- I added some code to tools/clang/tools/driver/driver.cpp
343 int main(int argc_, const char **argv_) {
344
345 {
346 int aaa = 0, bbb = 0;
347
348 for (int i = 0; i != 1 ; ) {
349 if (aaa < 10000) aaa += 1;
350 if (bbb < 10000) bbb += aaa;
351 if (aaa > 100) aaa -= 1;
352 if (bbb > 100) bbb -= aaa;
353 }
354 }
- And after this I just tried to recompile using the very same
Makefile under build directory where I compiled the brand new
clang+llvm as show beow.
>> time make -j3
- I captured messages below when the compiler stucks in somewhere.
[$ make -j3]
…...............................................
make[3]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/driver'
llvm[4]: Compiling driver.cpp for Debug+Asserts build
llvm[4]: Linking Debug+Asserts executable clang
llvm[4]: ======= Finished Linking Debug+Asserts Executable clang
llvm[4]: Creating Debug+Asserts Alias clang++
llvm[4]: ======= Finished Creating Debug+Asserts Alias clang++
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/driver'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/libclang'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/libclang'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/c-index-test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/c-index-test'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/arcmt-test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/arcmt-test'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/c-arcmt-test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/c-arcmt-test'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/diagtool'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/diagtool'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/clang-check'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools/clang-check'
make[3]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/tools'
make[3]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/runtime'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/runtime/libcxx'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/home/hum/Projects/clang_llvm/build/tools/clang/runtime/libcxx'
make[4]: Entering directory
`/home/hum/Projects/clang_llvm/build/tools/clang/runtime/compiler-rt'
>> The compiler was compiling runtime library?? Anyway this is the last output message.
[$ ps aux | grep clang]
hum 2471 0.0 0.0 4388 8 pts/2 S+ 00:24 0:00
/bin/sh -c for dir in lib/Support lib/TableGen utils lib/VMCore lib
tools/llvm-config tools runtime docs unittests; do \? if ([ ! -f
$dir/Makefile ] || \? command test $dir/Makefile -ot
/home/hum/Projects/clang_llvm/llvm/$dir/Makefile ); then \?
/home/hum/Projects/clang_llvm/llvm/autoconf/mkinstalldirs $dir; \?
/bin/cp /home/hum/Projects/clang_llvm/llvm/$dir/Makefile
$dir/Makefile; \? fi; \? (make -C $dir all ) || exit 1; \?done
hum 2911 0.0 0.0 4388 4 pts/2 S+ 00:25 0:00
/bin/sh -c \? SD=/home/hum/Projects/clang_llvm/llvm/tools/clang; \?
DD=clang; \? if [ ! -f $SD/Makefile ]; then \? SD=clang; \?
DD=clang; \? fi; \? if ([ ! -f $DD/Makefile ] || \?
command test $DD/Makefile -ot \? $SD/Makefile );
then \? /home/hum/Projects/clang_llvm/llvm/autoconf/mkinstalldirs
$DD; \? /bin/cp $SD/Makefile $DD/Makefile; \?fi; \?make -C $DD all
hum 2916 0.0 0.0 15900 0 pts/2 S+ 00:25 0:00 make
-C clang all
hum 2918 0.0 0.0 4388 160 pts/2 S+ 00:25 0:00
/bin/sh -c for dir in utils/TableGen include lib tools runtime docs
unittests; do \? if ([ ! -f $dir/Makefile ] || \? command test
$dir/Makefile -ot
/home/hum/Projects/clang_llvm/llvm/tools/clang/$dir/Makefile ); then
\? /home/hum/Projects/clang_llvm/llvm/autoconf/mkinstalldirs $dir;
\? /bin/cp /home/hum/Projects/clang_llvm/llvm/tools/clang/$dir/Makefile
$dir/Makefile; \? fi; \? (make -C $dir all ) || exit 1; \?done
hum 3237 0.0 0.0 4388 608 pts/2 S+ 00:45 0:00
/bin/sh -c \? SD=/home/hum/Projects/clang_llvm/llvm/tools/clang/runtime/compiler-rt;
\? DD=compiler-rt; \? if [ ! -f $SD/Makefile ]; then \?
SD=compiler-rt; \? DD=compiler-rt; \? fi; \? if ([ ! -f
$DD/Makefile ] || \? command test $DD/Makefile -ot \?
$SD/Makefile ); then \?
/home/hum/Projects/clang_llvm/llvm/autoconf/mkinstalldirs $DD; \?
/bin/cp $SD/Makefile $DD/Makefile; \?fi; \?make -C $DD all
hum 3247 0.0 0.0 4388 608 pts/2 S+ 00:45 0:00
/bin/sh -c make -C
/home/hum/Projects/clang_llvm/llvm/projects/compiler-rt \?
ProjSrcRoot=/home/hum/Projects/clang_llvm/llvm/projects/compiler-rt \?
ProjObjRoot=/home/hum/Projects/clang_llvm/build/tools/clang/runtime/compiler-rt
\? CC="/home/hum/Projects/clang_llvm/build/Debug+Asserts/bin/clang"
\? clang_linux
hum 3248 0.0 0.0 15908 1356 pts/2 S+ 00:45 0:00 make
-C /home/hum/Projects/clang_llvm/llvm/projects/compiler-rt
ProjSrcRoot=/home/hum/Projects/clang_llvm/llvm/projects/compiler-rt
ProjObjRoot=/home/hum/Projects/clang_llvm/build/tools/clang/runtime/compiler-rt
CC=/home/hum/Projects/clang_llvm/build/Debug+Asserts/bin/clang
clang_linux
hum 3251 0.0 0.0 4388 604 pts/2 S+ 00:45 0:00
/bin/sh -c result=""; for arch in i386; do if
/home/hum/Projects/clang_llvm/build/Debug+Asserts/bin/clang -arch
$arch -c -integrated-as
/home/hum/Projects/clang_llvm/llvm/projects/compiler-rt/make/platform/clang_darwin_test_input.c
-isysroot /home/hum/Projects/clang_llvm/llvm/projects/compiler-rt/SDKs/darwin
-o /dev/null > /dev/null 2> /dev/null; then result="$result$arch ";
else printf 1>&2 "warning: clang_darwin.mk: dropping arch '$arch' from
lib 'eprintf'\n"; fi; done; echo $result
hum 3252 99.9 0.4 79412 9560 pts/2 R+ 00:45 497:09
/home/hum/Projects/clang_llvm/build/Debug+Asserts/bin/clang -arch i386
-c -integrated-as
/home/hum/Projects/clang_llvm/llvm/projects/compiler-rt/make/platform/clang_darwin_test_input.c
-isysroot /home/hum/Projects/clang_llvm/llvm/projects/compiler-rt/SDKs/darwin
-o /dev/null
>> I grepped 'clang' from ps aux when the compiler stucks in somewhere.
[$ top]
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3252 hum 20 0 79412 9560 9272 R 100 0.5 510:06.43 clang
1169 root 20 0 222m 47m 6588 S 3 2.4 0:50.93 Xorg
1943 hum 20 0 1033m 79m 16m R 2 4.0 0:36.01
unity-2d-shell
>> Process clang, PID 3252 spends 100% of cpu more than 7 hours
I want to debug and learn llvm+clang source code. To do this I need to
compile and modify the code frequently.
Please help me on this.
Thank you in advance.
Journeyer J. Joh
2012/7/13 Duncan Sands <baldrick at free.fr>:
> Hi Journeyer J. Joh,
>
>> I have questions about compiling Clang+llvm.
>>
>> I compile as the link below instructs.
>>
>> http://clang.llvm.org/get_started.html
>>
>> I do on Ubuntu 12.04.
>>
>> `time make -j5` prints for about 13 minutes to compile a brand new
>> version of Clang+llvm.
>> And after this I edit some C++ code(clang/tools/driver/driver.cpp) and
>> compiles using the very same makefile which was used above sentence.
>
> this is the correct procedure.
>
>> But this time the make command event NOT return for about more than 13 hours.
>
> This is not normal, you should investigate what process is stuck.
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
--
----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l d o t c o m
----------------------------------------
More information about the llvm-dev
mailing list