[llvm-dev] How to create Debian packages for release 3.9.0

Kris van Rens via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 12 04:59:09 PST 2016


As a sidenote, I'd like to note that even for a non-specific release
the build process is flawed. When building the 3.9 branch without
being specific:

 $ debcheckout svn://anonscm.debian.org/svn/pkg-llvm/llvm-toolchain/

 $ cd llvm-toolchain/branches/

 $ sh 3.9/debian/orig-tar.sh release_39

 $ sh unpack.sh
 tar (child): llvm-toolchain-snapshot_3.9_3.9~svn288847.orig.tar.bz2:
Cannot open: No such file or directory
 tar (child): Error is not recoverable: exiting now
 tar: Child returned status 2
 tar: Error is not recoverable: exiting now

 $ ls *.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-clang.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-clang-tools-extra.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-compiler-rt.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-lldb.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-lld.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig-polly.tar.bz2
 llvm-toolchain-3.9_3.9~svn288847.orig.tar.bz2

I.e. the assumed name part 'snapshot' is not there. After removing the
'snapshot_' part from all filenames in the script, the unpacking
works.

Then, as a next step, the creating of symlinks fails due to the
filenames having the major version number in it twice (whereas the
script assumes it to be only once). After modification this works too.

Then, the next step further down the line the patching step (partly) fails:

-----
Applying patch 19-clang_debian_version.patch
patching file clang/lib/Basic/Version.cpp

Applying patch 23-strlcpy_strlcat_warning_removed.diff
patching file clang/include/clang/Basic/Builtins.def
Hunk #1 succeeded at 487 (offset -1 lines).
Hunk #2 succeeded at 834 (offset -40 lines).
patching file clang/lib/AST/Decl.cpp
Hunk #1 succeeded at 3370 (offset -85 lines).
patching file clang/lib/Sema/SemaChecking.cpp
Hunk #1 succeeded at 972 (offset -3 lines).
Hunk #2 succeeded at 2349 (offset -163 lines).
patching file clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
patching file clang/test/Sema/builtins.c
patching file clang/test/Sema/warn-strlcpycat-size.c

Applying patch 27-fix_clang_stdint.diff
patching file clang/lib/Headers/stdint.h

Applying patch 26-set-correct-float-abi.diff
patching file clang/lib/Driver/Tools.cpp
Hunk #1 succeeded at 848 (offset -125 lines).

Applying patch 0003-Debian-version-info-and-bugreport.patch
patching file lib/Support/CommandLine.cpp
Hunk #1 succeeded at 2036 (offset -10 lines).

Applying patch scan-build-clang-path.diff
patching file clang/tools/scan-build/bin/scan-build
Hunk #1 succeeded at 1414 (offset -18 lines).

Applying patch declare_clear_cache.diff
patching file lib/Support/Unix/Memory.inc
Hunk #1 succeeded at 335 (offset 16 lines).

Applying patch clang-format-version.diff
patching file clang/tools/clang-format/clang-format-diff.py
patching file clang/tools/clang-format/clang-format.el
patching file clang/tools/clang-format/clang-format.py
Hunk #1 succeeded at 34 (offset -1 lines).

Applying patch unwind-chain-inclusion.diff
patching file clang/lib/Headers/unwind.h

Applying patch hurd-pathmax.diff
patching file clang/lib/Basic/FileManager.cpp
Hunk #1 FAILED at 500.
1 out of 1 hunk FAILED -- rejects in file clang/lib/Basic/FileManager.cpp
patching file lldb/include/lldb/lldb-defines.h
Hunk #1 FAILED at 28.
1 out of 1 hunk FAILED -- rejects in file lldb/include/lldb/lldb-defines.h
patching file lib/Support/Unix/Path.inc
patching file tools/dsymutil/DwarfLinker.cpp
Patch hurd-pathmax.diff does not apply (enforce with -f)
-----

The build itself also fails, probably due to the failing patch step:

-----
[ 52%] Building CXX object tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o
cd "/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm/tools/gold"
&& /usr/bin/g++-4.8   -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS
-I"/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm/tools/gold"
-I"/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/tools/gold"
-I"/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm/include"
-I"/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/include"
 -std=c++0x -gsplit-dwarf -Wl,-fuse-ld=gold -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O2 -g
-DNDEBUG -fPIC    -fno-exceptions -o
CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o -c
"/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/tools/gold/gold-plugin.cpp"
/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/tools/gold/gold-plugin.cpp:52:24:
fatal error: plugin-api.h: No such file or directory
 #include <plugin-api.h>
                        ^
compilation terminated.
make[4]: *** [tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o] Error 1
make[4]: Leaving directory
`/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm'
make[3]: *** [tools/gold/CMakeFiles/LLVMgold.dir/all] Error 2
make[3]: Leaving directory
`/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847/build-llvm'
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory
`/data/work/clang/llvm-toolchain/branches/llvm-toolchain-3.9_3.9~svn288847'
make: *** [binary] Error 2
-----

Again, is there anyone who can help me build the debian packages for
Clang-3.9.0?

Thanks in advance, best regards,

Kris


On Thu, Dec 8, 2016 at 11:24 AM, Kris van Rens
<kris.van.rens at vinotion.nl> wrote:
> L.S.,
>
> I'm currently in the process of creating Debian packages for
> clang/llvm release 3.9.0. For this I'm using the steps as explained on
> 'http://apt.llvm.org/building-pkgs.php'. Up until now I have done:
>
> $ debcheckout svn://anonscm.debian.org/svn/pkg-llvm/llvm-toolchain/
> $ cd llvm-toolchain/branches
> $ sh 3.9/debian/orig-tar.sh RELEASE_390 final
>
> Now, as is explained, I would have to run 'unpack.sh', however, this
> script assumes the version name to be an SVN-version-based name (which
> is not the case for '3.9'). So I had to modify unpack.sh for this. Now
> for one of the last steps of unpack.sh, there is the line:
>
>   cp -R ../snapshot/debian .
>
> But this step should also be changed for a specific release version
> build, now the patches fail (and most likely the build as well, later
> on). Where can I find the properly versioned 'debian' directory for my
> specific release version build?
>
> --
> Met vriendelijke groeten / Kind regards,
> Kris van Rens
>
> ________________________________
> Ir. Kris van Rens, Team Lead Product Development
>
> ViNotion B.V. | Daalakkersweg 2-58 | Postbus 2346 | 5600 CH, EINDHOVEN
> W: www.vinotion.nl | T: +31 40 2366761 | E: kris.van.rens at vinotion.nl



-- 
Met vriendelijke groeten / Kind regards,
Kris van Rens

________________________________
Ir. Kris van Rens, Team Lead Product Development

ViNotion B.V. | Daalakkersweg 2-58 | Postbus 2346 | 5600 CH, EINDHOVEN
W: www.vinotion.nl | T: +31 40 2366761 | E: kris.van.rens at vinotion.nl


More information about the llvm-dev mailing list