aboutsummaryrefslogtreecommitdiffstats
path: root/lang/icc
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2002-05-14 21:17:05 +0800
committernetchild <netchild@FreeBSD.org>2002-05-14 21:17:05 +0800
commit0ad0c9deb51b955aa470b31c9b6e50f6a332b59b (patch)
tree875622b8464d6cbdbcd074652bb6b6ee0a0f8b71 /lang/icc
parent3b14bc527c0b26466221b4f59420bd0b7f1ab516 (diff)
downloadfreebsd-ports-gnome-0ad0c9deb51b955aa470b31c9b6e50f6a332b59b.tar.gz
freebsd-ports-gnome-0ad0c9deb51b955aa470b31c9b6e50f6a332b59b.tar.zst
freebsd-ports-gnome-0ad0c9deb51b955aa470b31c9b6e50f6a332b59b.zip
Wrapper script for ld, needed to link native binaries.
Diffstat (limited to 'lang/icc')
-rw-r--r--lang/icc/files/ld65
1 files changed, 65 insertions, 0 deletions
diff --git a/lang/icc/files/ld b/lang/icc/files/ld
new file mode 100644
index 000000000000..7482473ba62c
--- /dev/null
+++ b/lang/icc/files/ld
@@ -0,0 +1,65 @@
+#! /bin/sh
+# icc custom ld script; fiddles with the ld commandline. This is done
+# by shifting through the entire argument list. If we like the arg, we
+# append it to the end of the arglist via 'set'. If not, we don't
+# append anything, and the arg is shifted out of existence.
+
+# Written by Dan Nelson <dnelson@allantgroup.com> with some modifications
+# by Alexander Leidinger <netchild@FreeBSD.org>.
+
+PREFIX=@@PREFIX@@
+
+i=0
+argc=$#
+# prepend "-m elf_i386" to the commandline
+set -- "$@" -m elf_i386
+while [ $i -lt $argc ] ; do
+ val=$1
+ shift
+ case $val in
+ -limf|-lirc|-lcprts|-lunwind|\
+ ${PREFIX}/intel/compiler60/ia32/lib/icrt.link|\
+ -Qy\
+ )
+ # libs that have Linux lib dependencies
+ # possibly unneeded .link file?
+ # obsolete flag
+ unset val
+ ;;
+ /lib/ld-linux.so.2)
+ # switch it
+ val=/usr/libexec/ld-elf.so.1
+ ;;
+ -L/usr/lib)
+ # remove this, and replace with FreeBSD's lib paths
+ unset val
+ set -- "$@" -L/usr/libexec/elf -L/usr/libexec -L/usr/lib
+ ;;
+ ${PREFIX}/intel/compiler60/ia32/lib/crtxi.o)
+ # switch it
+ val=/usr/lib/crtbegin.o
+ ;;
+ ${PREFIX}/intel/compiler60/ia32/lib/crtxn.o)
+ # switch it good
+ val=/usr/lib/crtend.o
+ ;;
+ -Bdynamic)
+ # Force libcxa to static linkage, since the dynamic
+ # version has a linux glibc dependency. This might not
+ # fully work, as when it does call libc stuff it could
+ # fail. I haven't been able to make it happen though.
+ if [ "$1" == "-lcxa" ] ; then
+ val=-Bstatic
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ # append our new $val to the end of argv, if it still exists.
+ if [ ${#val} -gt 0 ] ; then
+ set -- "$@" "$val"
+ fi
+ let i=i+1
+done
+# run FreeBSD's ld with our new args
+exec ${PREFIX}/intel/compiler60/ia32/bin/real/ld "$@"