Bug 200954 - [NEW PORT] lang/cloudabi-clang
Summary: [NEW PORT] lang/cloudabi-clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-18 15:20 UTC by Ed Schouten
Modified: 2015-06-23 08:39 UTC (History)
0 users

See Also:


Attachments
Shell archive of lang/cloudabi-clang (1.52 KB, text/plain)
2015-06-19 11:45 UTC, Ed Schouten
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Schouten freebsd_committer freebsd_triage 2015-06-18 15:20:17 UTC
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
Comment 1 Ed Schouten freebsd_committer freebsd_triage 2015-06-19 11:45:09 UTC
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.
Comment 2 Ed Schouten freebsd_committer freebsd_triage 2015-06-22 20:12:26 UTC
Sent out a code review: https://reviews.freebsd.org/D2885

Will close this bug once I got the approval.
Comment 3 Ed Schouten freebsd_committer freebsd_triage 2015-06-22 20:13:08 UTC
Whoops. Accidentally closed it.
Comment 4 Ed Schouten freebsd_committer freebsd_triage 2015-06-23 08:38:15 UTC
Submitted as r390358.
Comment 5 commit-hook freebsd_committer freebsd_triage 2015-06-23 08:39:02 UTC
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