Skip to content

Commit

Permalink
Merge pull request #14 from sg2342/clang
Browse files Browse the repository at this point in the history
Clang support
  • Loading branch information
anttikantee committed Apr 16, 2015
2 parents 76bf228 + f1c26e5 commit 5d2208a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ The following people have contributed to this repository:
Justin Cormack <[email protected]>
Antti Kantee <[email protected]>
Stephan Renatus <[email protected]>
Stefan Grundmann <[email protected]>
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ $(foreach util,${NBUTILS},$(eval $(call NBUTIL_templ,${util},$(notdir ${util})))

INSTALL_PATH=${PWD}

${NBCC}: cc.in rump/lib/rump-cc.specs rump/lib/ld
${NBCC}: cc.in rump/lib/rump-cc.specs rump/lib/ld.rump
sed "s|@PATH@|${INSTALL_PATH}|g" $< > $@
chmod +x $@

rump/lib/ld: ld.in
rump/lib/ld.rump: ld.in
sed "s|@PATH@|${PWD}|g" $< > $@
chmod +x $@

Expand Down
4 changes: 0 additions & 4 deletions buildnb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ done
[ ! -f ./buildrump.sh/subr.sh ] && git submodule update --init buildrump.sh
. ./buildrump.sh/subr.sh

if ! ${CC:-cc} --version | grep -q 'Free Software Foundation'; then
die 'rumprun-posix currently requires CC=gcc'
fi

${MAKE} --version | grep -q 'GNU Make' \
|| die GNU Make required, '$MAKE' "(${MAKE})" is not

Expand Down
9 changes: 8 additions & 1 deletion cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ set -e
case " $* " in
*" -v "*) set -x ;;
esac
exec "${REALCC:-cc}" "$@" -specs "@PATH@/rump/lib/rump-cc.specs"
if ! ${REALCC:-cc} --version | grep -q 'Free Software Foundation'; then
export PATH=@PATH@/rump/lib:$PATH
exec "${REALCC:-cc}" -nostdinc -D__NetBSD__ -U__FreeBSD__ -Ulinux \
-U__linux -U__linux__ -U__gnu_linux__ -isystem @PATH@/rump/include \
-fuse-ld=rump -nostdlib "$@"
else
exec "${REALCC:-cc}" "$@" -specs "@PATH@/rump/lib/rump-cc.specs"
fi
2 changes: 1 addition & 1 deletion specs.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%(cc1_cpu) -nostdinc -isystem @PATH@/rump/include -isystem include%s

*linker:
@PATH@/rump/lib/ld --stunt-intermediate %g.link1 %g.link2
@PATH@/rump/lib/ld.rump --stunt-intermediate %g.link1 %g.link2

*link:
-nostdlib %s

0 comments on commit 5d2208a

Please sign in to comment.