aboutsummaryrefslogtreecommitdiff
path: root/lang/icc/files
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2002-08-20 10:01:58 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2002-08-20 10:01:58 +0000
commit887882215081d93dfc8b47872da6a0da64d127d2 (patch)
tree4df5a18c7216454b013562d38a596a8123d8ea55 /lang/icc/files
parent17e58aabf69c833687b203ff132f664fc5937e27 (diff)
downloadports-887882215081d93dfc8b47872da6a0da64d127d2.tar.gz
ports-887882215081d93dfc8b47872da6a0da64d127d2.zip
Notes
Diffstat (limited to 'lang/icc/files')
-rw-r--r--lang/icc/files/cxa_atexit.c38
-rw-r--r--lang/icc/files/ld82
-rw-r--r--lang/icc/files/patch-icc24
-rw-r--r--lang/icc/files/patch-include41
-rw-r--r--lang/icc/files/stderr.c32
5 files changed, 207 insertions, 10 deletions
diff --git a/lang/icc/files/cxa_atexit.c b/lang/icc/files/cxa_atexit.c
new file mode 100644
index 000000000000..2d9ce3d9160e
--- /dev/null
+++ b/lang/icc/files/cxa_atexit.c
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2002 Marius Strobl
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdlib.h>
+
+void *__dso_handle = NULL;
+
+int
+__cxa_atexit(void (*fn)(), void *arg, void *d)
+{
+
+ return (atexit(fn));
+}
diff --git a/lang/icc/files/ld b/lang/icc/files/ld
index 3c228fb5d445..d25901783095 100644
--- a/lang/icc/files/ld
+++ b/lang/icc/files/ld
@@ -6,19 +6,35 @@
# Written by Dan Nelson <dnelson@allantgroup.com> with some modifications
# by Alexander Leidinger <netchild@FreeBSD.org>.
+# C++ support by Marius Strobl <marius@alchemy.franken.de>.
PREFIX=@@PREFIX@@
i=0
argc=$#
+while [ $i -lt $argc ] ; do
+ val=$1
+ shift
+ if [ "$val" == "-CPLUSPLUS" ] ; then
+ cplusplus=1
+ elif [ "$val" == "-BOOTSTRAPSTLPORT" ] ; then
+ bootstrapstlport=1
+ else
+ set -- "$@" "$val"
+ fi
+ i=$(($i+1))
+done
+
+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
- # there was also "-lirc", but it a test with -lirc works here
- -limf|-lcprts|-lunwind|\
+ # there was also "-lirc", but in a test -lirc works here
+ -limf|\
${PREFIX}/intel/compiler60/ia32/lib/icrt.link|\
-Qy\
)
@@ -27,6 +43,22 @@ while [ $i -lt $argc ] ; do
# obsolete flag
unset val
;;
+ -lcprts|-lunwind)
+ # only needed when compiling c++ source, depend on libc_r
+ if [ ! "$cplusplus" ] ; then
+ unset val
+ fi
+ ;;
+ -lc)
+ if [ "$cplusplus" ] ; then
+ if [ "$bootstrapstlport" ] ; then
+ val=-lc_r
+ else
+ unset val
+ set -- "$@" -lc_r -lstlport_icc
+ fi
+ fi
+ ;;
/lib/ld-linux.so.2)
# switch it
val=/usr/libexec/ld-elf.so.1
@@ -34,7 +66,8 @@ while [ $i -lt $argc ] ; do
-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
+ set -- "$@" -L/usr/libexec/elf -L/usr/libexec -L/usr/lib \
+ -L${PREFIX}/lib
;;
${PREFIX}/intel/compiler60/ia32/lib/crtxi.o)
# switch it
@@ -45,13 +78,42 @@ while [ $i -lt $argc ] ; do
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
+ # Force libcprts, libcxa and libunwind to static linkage,
+ # since the dynamic versions have linux glibc
+ # dependencies. 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.
+ # ibcprts and libunwind are only needed when compiling c++
+ # source, else we remove the superfluous -Bdynamic.
+ case $1 in
+ -lcxa)
+ val=-Bstatic
+ ;;
+ -lcprts|-lunwind)
+ if [ "$cplusplus" ] ; then
+ val=-Bstatic
+ else
+ unset val
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ -Bstatic)
+ # remove superfluous -Bstatic not followed by a library
+ case $1 in
+ -limf|-lirc)
+ unset val
+ ;;
+ -lcprts|-lunwind)
+ if [ ! "$cplusplus" ] ; then
+ unset val
+ fi
+ ;;
+ *)
+ ;;
+ esac
;;
*)
;;
diff --git a/lang/icc/files/patch-icc b/lang/icc/files/patch-icc
new file mode 100644
index 000000000000..a6aeaf03bb9c
--- /dev/null
+++ b/lang/icc/files/patch-icc
@@ -0,0 +1,24 @@
+--- opt/intel/compiler60/ia32/bin/icc.orig Tue Aug 6 04:34:18 2002
++++ opt/intel/compiler60/ia32/bin/icc Tue Aug 6 04:46:51 2002
+@@ -23,6 +23,21 @@
+
+ if [ $# != 0 ]
+ then
++ i=0
++ argc=$#
++ while [ $i -lt $argc ] ; do
++ val1=$1
++ shift
++ for s in .C .cc .cpp .cxx .c++; do
++ val2=${val1%$s}
++ if [ ${#val1} -gt ${#val2} ] ; then
++ echo "Please use icpc to compile C++ source."
++ exit 1
++ fi
++ done
++ set -- "$@" "$val1"
++ i=$(($i+1))
++ done
+ exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin "$@";
+ else
+ exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin;
diff --git a/lang/icc/files/patch-include b/lang/icc/files/patch-include
index d643c57857d9..c1b54eb722c0 100644
--- a/lang/icc/files/patch-include
+++ b/lang/icc/files/patch-include
@@ -11,3 +11,44 @@
#define _CPPLIB_VER 310
#if defined(ia64) || defined(__ia64) || defined(__ia64__) /* assume Itanium */
+--- opt/intel/compiler60/ia32/include/cwchar.orig Tue Aug 6 04:32:48 2002
++++ opt/intel/compiler60/ia32/include/cwchar Tue Aug 6 05:04:09 2002
+@@ -13,25 +13,29 @@
+
+ #ifdef _GLOBAL_USING
+ _STD_BEGIN
+-using ::mbstate_t; using ::size_t; using ::tm; using ::wint_t;
++using ::mbstate_t; using ::size_t; using ::wint_t;
++// using ::tm;
+
+
+-using ::btowc;
++// using ::btowc;
+ // using ::fwide; using ::fwprintf;
+ // using ::fwscanf;
+-using ::mbrlen; using ::mbrtowc; using ::mbsrtowcs;
+-using ::mbsinit;
++// using ::mbrlen; using ::mbrtowc; using ::mbsrtowcs;
++// using ::mbsinit;
+ // using ::swprintf; using ::swscanf;
+ // using ::vfwprintf; using ::vswprintf; using ::vwprintf;
+-using ::wcrtomb;
++// using ::wcrtomb;
+ // using ::wprintf; using ::wscanf;
+-using ::wcsrtombs; using ::wcstol; using ::wcscat;
+-using ::wcschr; using ::wcscmp; using ::wcscoll;
++// using ::wcsrtombs; using ::wcstol;
++using ::wcscat;
++using ::wcschr; using ::wcscmp;
++// using ::wcscoll;
+ using ::wcscpy; using ::wcscspn; using ::wcslen;
+ using ::wcsncat; using ::wcsncmp; using ::wcsncpy;
+ using ::wcspbrk; using ::wcsrchr; using ::wcsspn;
+-using ::wcstod; using ::wcstoul; using ::wcsstr;
+-using ::wcstok; using ::wcsxfrm; using ::wctob;
++// using ::wcstod; using ::wcstoul;
++using ::wcsstr;
++// using ::wcstok; using ::wcsxfrm; using ::wctob;
+ using ::wmemchr; using ::wmemcmp; using ::wmemcpy;
+ using ::wmemmove; using ::wmemset;
+ // using ::wcsftime;
diff --git a/lang/icc/files/stderr.c b/lang/icc/files/stderr.c
new file mode 100644
index 000000000000..aeb5013d10b4
--- /dev/null
+++ b/lang/icc/files/stderr.c
@@ -0,0 +1,32 @@
+/*-
+ * Copyright (c) 2002 Marius Strobl
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+
+#undef stderr
+FILE *stderr = &__sF[2];