Skip to content

Conversation

@bulwahn
Copy link
Owner

@bulwahn bulwahn commented May 3, 2018

As compiling the kernel with clang is a recent development, we may observe different failures between the clang compiler versions.

Some kernel configurations may fail with the stable version 5.0 due to clang compiler shortcomings, that have been resolved in the later version 6.0 or in the svn tree of the clang development.

Hence, this commit provides dedicated Docker containers with clang-6.0 and clang-7 from Debian's unstable distribution, and extends the scripts select among those clang compiler versions.

As compiling the kernel with clang is a recent development, we may
observe different failures between the clang compiler versions.

Some kernel configurations may fail with the stable version 5.0
due to clang compiler shortcomings, that have been resolved in the
later version 6.0 or in the svn tree of the clang development.

Hence, this commit provides dedicated Docker containers with
clang-6.0 and clang-7 from Debian's unstable distribution, and
extends the scripts select among those clang compiler versions.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
@bulwahn
Copy link
Owner Author

bulwahn commented May 3, 2018

@phongt Would you be interested to review my proposed feature in this pull request? I am certainly interested in your expert opinion on my proposal.

@phongt
Copy link
Contributor

phongt commented May 4, 2018

@bulwahn About the clang-7, I tested the patch with stable tree (linux-4.16.y), there is a compile error with clang-7 (Debian distro repo)

  LD      arch/x86/realmode/rm/realmode.elf
  RELOCS  arch/x86/realmode/rm/realmode.relocs
Unsupported relocation type: R_386_PLT32 (4)
make[3]: *** [arch/x86/realmode/rm/Makefile:68: arch/x86/realmode/rm/realmode.relocs] Error 1
make[2]: *** [arch/x86/realmode/Makefile:20: arch/x86/realmode/rm/realmode.bin] Error 2
make[2]: *** Waiting for unfinished jobs....

As report the issue was resolved by Bug 36674. I propose that installation clang-7 (development branch) from http://apt.llvm.org/unstable/ llvm-toolchain main

Details information can be found here .

I performed an experiment with clang-7 from repo of llvm.org. some pkgs have to install like gnupg-utils, wget (for import the key), then add the llvm.org repo in sources.list update the apt-cache and install the clang-7.
for example:

RUN apt-get update && apt-get install -y \
	bc \
	bison \
	bsdmainutils \
	gnupg-utils \
	flex \
	libelf-dev \
	libssl-dev \
	make \
	wget
RUN echo "deb http://apt.llvm.org/unstable/ llvm-toolchain main" >> /etc/apt/sources.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update && apt-get install --no-install-recommends -y \
	clang-7 \
	&& rm -rf /var/lib/apt/lists/*

Result kernel can compile successfully. Hope this is informative.

@bulwahn
Copy link
Owner Author

bulwahn commented May 4, 2018

Thanks for that hint. I think I just tested v4.14.y and did not notice that issue. I agree that getting a snapshot is probably the best solution for the clang development version. We just need to make sure that the docker container is tagged with the specific commit; otherwise, it will not be possible to produce reproducible runs and reports about issues that we identify.

@bulwahn bulwahn force-pushed the support-multiple-clang-versions branch from 311dbc1 to 2b43ad0 Compare May 7, 2018 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants