[[!meta copyright="Copyright © 2011, 2012, 2013 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] [[!tag open_issue_llvm]] Here's what's to be done for maintaining [[/LLVM]]. Apart from the target-specific configuration machinery, there shouldn't be any major differences within LLVM between the GNU/Hurd and GNU/Linux ports, for example. Especially all the compiler magic is all the same. [[!toc levels=2]] # [[General information|/llvm]] ## Rebuild of the Debian archive with clang From [[!message-id "20120305195308.GA1904@zouish.org"]]: , . # [[Sources|source_repositories/llvm]] # Configuration Last reviewed up to the [[Git mirror's sources|source_repositories/llvm]]: llvm 0f58dbae4ab2397dc310e19d171a4bc60fc6c9a7 (2013-02-08), clang 52635ff9fb530dfdfc6a94e52a2270bf1bb8346b (2013-02-08), compiler-rt ed83584256249ee2c474fb18abf7df6aa73019b0 (2013-02-08), test-suite f621d1a62904df136cbaf4e4e63cbf9e9c45fd10 (2013-02-08). * . * [low] Some more `PATH_MAX`/`MAXPATHLEN` things. * `gs:` usage * `lib/Target/X86/`, `test/CodeGen/X86/`, `test/MC/X86/`. * `tools/clang/` tools/clang/docs/LanguageExtensions.rst: movl %gs:(%eax), %eax tools/clang/test/Sema/asm.c: asm volatile ("movb %%gs:%P2,%b0" : "=q"(b) : "0"(0), "i"(5L)); * `compiler-rt` and `test-suite` not yet examined. * [low] Linuxisms * `test/`, `unittests`, `tools/clang/test/`, `tools/clang/unittests/` not yet examined. * In clang's `test/Driver/` a lot of testing can be generalized from *Linux* to *GNU environment*, adding GNU/Hurd testing, too. * `compiler-rt` and `test-suite` not yet examined. * `/proc` usage * `compiler-rt` and `test-suite` not yet examined. * `libc++` (not currently using) Some Hurd-porting work is said to have been done as Google Summer of Code 2012 Debian project, . # Build Here's a log of a LLVM build run; this is from our [[Git repository's sources|source_repositories/llvm]], llvm 0a109de14d0ced95d99b9ec60d4ef9479d6404d3 (2013-02-08), clang 4cdb7414a1862270bbf8ff2c345aea879a64a116 (2013-02-08), compiler-rt ed83584256249ee2c474fb18abf7df6aa73019b0 (2013-02-08), test-suite d1212efdb685151165a48d0f89cf3d40154468bc (2013-02-08), run on kepler.SCHWINGE and coulomb.SCHWINGE. $ export LC_ALL=C $ (cd ../Horace_Silver/ && ln -sfn ../../../clang/tschwinge/Hank_Mobley tools/clang) $ (cd ../Horace_Silver/ && ln -sfn ../../../compiler-rt/tschwinge/Doug_Watkins projects/compiler-rt) $ (cd ../Horace_Silver/ && ln -sfn ../../../test-suite/tschwinge/Art_Blakey projects/test-suite) $ ../Horace_Silver/configure --prefix="$PWD".install --enable-optimized SHELL=/bin/dash CC=gcc-4.7 CXX=g++-4.7 2>&1 | tee log_build $ make VERBOSE=1 2>&1 | tee log_build_ Different hosts may default to different shells and compiler versions; thus harmonized. Passing `--enable-debug-symbols`, the GNU/Hurd build on coulomb.SCHWINGE terminates with a SIGBUS when linking `Release+Debug+Asserts/bin/clang` (which is bigger than 500 MiB for the corresponding GNU/Linux build). Using `--enable-debug-symbols --enable-shared`, the GNU/Hurd build hang after `make[1]: Leaving directory [...]/tools/llvm-shlib`, after (successfully) linking `Release+Debug+Asserts/lib/libLLVM-3.3svn.so` (which is bigger than 250 MiB for the corresponding GNU/Linux build). Also there is a separate `--enable-debug-runtime`. This takes up around 3 GiB, and needs roughly 1.25 h on kepler.SCHWINGE and 4.25 h on coulomb.SCHWINGE. Configuring without `--enable-optimized` even crashes mighty darnassus, probably because of too-big files when linking. Configuring with `--enable-optimized --enable-expensive-checks --disable-threads --enable-debug-symbols --enable-debug-runtime` is fine. ## Analysis $ toolchain/logs/process llvm build -checking type of operating system we're going to host on... Linux -checking type of operating system we're going to target... Linux +checking type of operating system we're going to host on... GNU +checking type of operating system we're going to target... GNU -checking mach/mach.h usability... no -checking mach/mach.h presence... no -checking for mach/mach.h... no +checking mach/mach.h usability... yes +checking mach/mach.h presence... yes +checking for mach/mach.h... yes -checking for mmap of files... yes +checking for mmap of files... no checking if /dev/zero is needed for mmap... no +configure: WARNING: mmap() of files required but not found Due to [[mmap_write-only]]. -checking type of operating system we're going to target... Linux +checking type of operating system we're going to target... Unknown +In file included from [...]/tschwinge/Horace_Silver/lib/Support/Process.cpp:29:0: +[...]/tschwinge/Horace_Silver/lib/Support/Unix/Process.inc: In function 'unsigned int getColumns(int)': +[...]/tschwinge/Horace_Silver/lib/Support/Unix/Process.inc:220:21: warning: enumeral and non-enumeral type in conditional expression [enabled b include/llvm/Config/* Makefile.config TODO # Install $ make VERBOSE=1 install 2>&1 | tee log_install This takes up around 350 MiB, and needs roughly 1 min on kepler.SCHWINGE and 12 min on coulomb.SCHWINGE. ## Analysis $ toolchain/logs/process llvm install TODO # Testsuite $ make -k VERBOSE=1 LIT_ARGS='-v --threads=1' check-all 2>&1 | tee log_test_check-all $ make -k -C projects/test-suite/ 2>&1 | tee log_test_test-suite `LIT_ARGS=-v` is default for `VERBOSE=1`, but we want only one worker thread, for stable order and usable test output log. This needs roughly 10 min (`check-all`) + 145 min (test-suite) = 155 min on kepler.SCHWINGE and 40 min (`check-all`) + 80 min (test-suite) = 120 min on coulomb.SCHWINGE. ## Analysis $ toolchain/logs/process llvm test * `LLVM :: CodeGen/X86/mult-alt-generic-i686.ll`, `LLVM :: CodeGen/X86/win_ftol2.ll` These, as well as a really large set of test from the test-suite fail on coulomb.SCHWINGE no matter whether a GNU/Hurd or GNU/Linux system is booted -- so all these are specific to the Athlon XP processor, hopefully. * `Clang :: Index/crash-recovery-modules.m` Also fails on GNU/Linux. Tested `--enable-optimized --enable-expensive-checks --disable-threads --enable-debug-symbols --enable-debug-runtime`. [[!LLVM_bug 11974]]. * `Clang :: Misc/dev-fd-fs.c` $ cat < [...]/test/Misc/dev-fd-fs.c | Release+Debug+Asserts+Checks/bin/clang -x c /dev/fd/0 -E clang: error: no such file or directory: '/dev/fd/0' clang: error: no input files Compare to: $ cat < [...]/test/Misc/dev-fd-fs.c | gcc -x c /dev/fd/0 -E gcc: error: /dev/fd/0: (ipc/mig) bad request message ID gcc: warning: '-x c' after last input file has no effect gcc: fatal error: no input files compilation terminated. These work: $ Release+Debug+Asserts+Checks/bin/clang -x c /dev/fd/0 -E < [...]/test/Misc/dev-fd-fs.c [...] int x; $ gcc -x c /dev/fd/0 -E < [...]/test/Misc/dev-fd-fs.c [...] int x; * `Clang :: Tooling/clang-check-builtin-headers.cpp` Fails: `fatal error: 'stddef.h' file not found`; succeeds when ran manually. * About 200 clang tests fail; they all seem similar. These are especially the `Clang :: Index/*` and `Clang :: Modules/*` tests. Configuring with `--enable-optimized --enable-expensive-checks --disable-threads --enable-debug-symbols --enable-debug-runtime`, these FAILs go away. * With `--enable-optimized --enable-expensive-checks --disable-threads --enable-debug-symbols --enable-debug-runtime`, there are a few new FAILs for both GNU/Linux and GNU/Hurd: * `Clang :: Tooling/auto-detect-from-source-parent-of-cwd.cpp` * `Clang :: Tooling/auto-detect-from-source-parent.cpp` * `Clang :: Tooling/clang-check-autodetect-dir.cpp` For all three, the `clang-check` invocation fails. [[!LLVM_bug 15194]]. * Several tests are not considered on GNU/Hurd. * Differences in test-suite, that are not evidently floating-point issues, GNU/Linux vs. GNU/Hurd on coulomb.SCHWINGE: gcc-4.6 -I/media/erich/home/thomas/tmp/llvm/tschwinge/Horace_Silver.build/projects/test-suite/SingleSource/UnitTests -I/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/SingleSource/UnitTests -I/home/thomas/tmp/llvm/tschwinge/Horace_Silver.build/projects/test-suite/../../../Horace_Silver/projects/test-suite/include -I../../include -I/home/thomas/tmp/llvm/tschwinge/Horace_Silver.build/include -I/home/thomas/tmp/llvm/tschwinge/Horace_Silver/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -DNDEBUG -O3 /media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/SingleSource/UnitTests/2007-04-25-weak.c -lm -o Output/2007-04-25-weak.native -lstdc++ +/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/SingleSource/UnitTests/2007-04-25-weak.c:3:1: warning: 'weak_import' attribute directive ignored [-Wattributes] +/tmp/ccWGwKvo.o: In function `main': +2007-04-25-weak.c:(.text.startup+0x7): undefined reference to `test_weak' +collect2: ld returned 1 exit status +make[2]: [Output/2007-04-25-weak.native] Error 1 (ignored) On GNU/Linux, the clamav tests are compiled with `-DC_LINUX`. +/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/MultiSource/Applications/lambda-0.1.3/lambda.cc:63:12: error: use of undeclared identifier 'MAXPATHLEN' + char buf[MAXPATHLEN+1]; ..., with follow-up failures. `projects/test-suite/MultiSource/Applications/obsequi` is not at all considered for GNU/Hurd. +/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/MultiSource/Benchmarks/Olden/voronoi/newvor.c:178:25: warning: implicit declaration of function 'memalign' is invalid in C99 [-Wimplicit-function-declaration] + char* base = (char*)memalign(align_size, alloc_size); + ^ +1 warning generated. +/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/MultiSource/Benchmarks/Prolangs-C/archie-client/get_vdir.c:213:20: error: use of undeclared identifier 'MAXPATHLEN' + char l_name[MAX_DIR_LINESIZE]; + ^ +/media/erich/home/thomas/tmp/llvm/test-suite/tschwinge/Art_Blakey/MultiSource/Benchmarks/Prolangs-C/archie-client/pprot.h:39:37: note: expanded from macro 'MAX_DIR_LINESIZE' +#define MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */ + ^ ..., and several more.