Skip to main content

cc: seems to be a cross-compiler

Since FreeBSD still ships with csh as its default shell, I tried to compile ksh93 on FreeBSD 8.0-RC1 and this happened:

# cd /usr/ports/shells/ksh93
# make install
[...]
===>  Building for ksh93-20090505
package: update /usr/ports/shells/ksh93/work/bin/execrate
package: cc: seems to be a cross-compiler
package: set HOSTTYPE to something other than the native freebsd8.amd64
*** Error code 1
This seems to happen every now and then, but I had to go to another bugtracker to find the solution: apparently, "make install" compiles a small test-program and tries to execute it in /tmp. However, /tmp is mounted noexec and so the test-program fails to execute and in turn the build fails as well. The solution was to mount /tmp with the exec flag:
$ grep /tmp /etc/fstab 
tmpfs   /tmp   tmpfs   rw,nosuid,exec,mode=1777,size=134217728 0 0
Unfortunately, FreeBSD's tmpfs won't allow a remount - we have to umount and the mount again:
$ mount -u -o exec /tmp 
mount: tmpfs : Operation not supported

$ umount /tmp
$ mount -o exec /tmp
$ mount | grep /tmp
tmpfs on /tmp (tmpfs, local, nosuid)