Hi there, I'm currently working on a project to slowly integrate support for CloudABI into FreeBSD. Essentially, CloudABI could be seen as a compact UNIX-like runtime that uses Capsicum. More details can be found here: https://github.com/NuxiNL/cloudlibc The first port that I want to add is a very simple one: lang/cloudabi-clang, which installs a copy of Clang that can be used to cross-compile software against CloudABI. Instead of building yet another copy of Clang, this port simply depends on clang-devel and adds symbolic links to the compiler executable. This works, as Clang has been designed to derive its target triple from the executable name. I could in theory commit this myself, but as I've never done this before, I thought I'd go through the regular process of submitting a bug. Be sure to get in touch in case there's something I can do on my part. Thanks, Ed # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # Makefile # pkg-descr # echo x - Makefile sed 's/^X//' >Makefile << 'b67911656ef5d18c4ae36cb6741b7965' X# Created by: Ed Schouten <ed@FreeBSD.org> X# $FreeBSD$ X XPORTNAME= cloudabi-clang XPORTVERSION= 1.0 XCATEGORIES= devel XMASTER_SITES= # None XDISTFILES= # None X XMAINTAINER= ed@FreeBSD.org XCOMMENT= Clang for CloudABI X XLICENSE= MIT X XRUN_DEPENDS= clang-devel:${PORTSDIR}/lang/clang-devel X XNO_BUILD= yes X XPLIST_FILES= bin/x86_64-unknown-cloudabi-cc \ X bin/x86_64-unknown-cloudabi-c++ X Xdo-install: X @${LN} -s ../llvm-devel/bin/clang \ X ${STAGEDIR}${PREFIX}/bin/x86_64-unknown-cloudabi-cc X @${LN} -s ../llvm-devel/bin/clang++ \ X ${STAGEDIR}${PREFIX}/bin/x86_64-unknown-cloudabi-c++ X X.include <bsd.port.mk> b67911656ef5d18c4ae36cb6741b7965 echo x - pkg-descr sed 's/^X//' >pkg-descr << '7f9555c3c1089940396b503dd37f3979' XThe CloudABI environment uses Clang as its C/C++ compiler. This meta Xport installs Clang and sets up symbolic links, so that Clang can be Xused as a cross compiler for CloudABI. X XWWW: https://github.com/NuxiNL/cloudlibc 7f9555c3c1089940396b503dd37f3979 exit
Created attachment 157882 [details] Shell archive of lang/cloudabi-clang Disregard the previously posted shell archive. It turns out that although the Clang binaries worked fine to compile freestanding CloudABI applications, they failed to include any header files installed in the include directory. The updated port adds an additional symbolic link, so that Clang is able to find its resources and include standard header files properly.
Sent out a code review: https://reviews.freebsd.org/D2885 Will close this bug once I got the approval.
Whoops. Accidentally closed it.
Submitted as r390358.
A commit references this bug: Author: ed Date: Tue Jun 23 08:38:02 UTC 2015 New revision: 390358 URL: https://svnweb.freebsd.org/changeset/ports/390358 Log: Add cloudabi-clang. This port adds the necessary symbolic links to make Clang work as a cross compiler for CloudABI. Clang can automatically derive its target from argv[0]. We don't need to install another copy of Clang. It is sufficient to invoke it the right way. CloudABI support is not yet part of a released version of Clang. This is why we still need to depend on llvm-devel. My intent is to stick to a fixed compiler version at one point in time. PR: 200954 Differential Revision: https://reviews.freebsd.org/D2885 Approved by: bapt Changes: head/lang/Makefile head/lang/cloudabi-clang/ head/lang/cloudabi-clang/Makefile head/lang/cloudabi-clang/pkg-descr