summaryrefslogtreecommitdiff
path: root/lang/icc7/files
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2002-05-14 13:17:05 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2002-05-14 13:17:05 +0000
commitec5128ef11407f88bcc04eb73ef271a0d163e789 (patch)
tree96758101193cd5afa056ea7533bd2a25dfc7e34e /lang/icc7/files
parent1) Document some steps in the targets of the Makefile. (diff)
Wrapper script for ld, needed to link native binaries.
Notes
Notes: svn path=/head/; revision=59080
Diffstat (limited to 'lang/icc7/files')
-rw-r--r--lang/icc7/files/ld65
1 files changed, 65 insertions, 0 deletions
diff --git a/lang/icc7/files/ld b/lang/icc7/files/ld
new file mode 100644
index 000000000000..7482473ba62c
--- /dev/null
+++ b/lang/icc7/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 "$@"