aboutsummaryrefslogtreecommitdiff
path: root/lang/icc7/files
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2002-09-17 12:10:46 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2002-09-17 12:10:46 +0000
commit9d47e3f9b5b2722771b9c9154e275f2d79f9f58e (patch)
tree2bd9e420d1aa1b144a3b363491e21e3eb0cf73f5 /lang/icc7/files
parent4d8f578da7819767e377616346d368de52bc5383 (diff)
downloadports-9d47e3f9b5b2722771b9c9154e275f2d79f9f58e.tar.gz
ports-9d47e3f9b5b2722771b9c9154e275f2d79f9f58e.zip
Notes
Diffstat (limited to 'lang/icc7/files')
-rw-r--r--lang/icc7/files/cxa_atexit.c24
-rw-r--r--lang/icc7/files/cxa_finalize.c38
-rw-r--r--lang/icc7/files/errno_location.c37
-rw-r--r--lang/icc7/files/ld128
-rw-r--r--lang/icc7/files/ld.c404
-rw-r--r--lang/icc7/files/patch-icc38
-rw-r--r--lang/icc7/files/patch-icpc41
-rw-r--r--lang/icc7/files/patch-include38
-rw-r--r--lang/icc7/files/stderr.c2
9 files changed, 613 insertions, 137 deletions
diff --git a/lang/icc7/files/cxa_atexit.c b/lang/icc7/files/cxa_atexit.c
index 2d9ce3d9160e..d9dd1d0a1700 100644
--- a/lang/icc7/files/cxa_atexit.c
+++ b/lang/icc7/files/cxa_atexit.c
@@ -1,4 +1,4 @@
-/*-
+/*
* Copyright (c) 2002 Marius Strobl
* All rights reserved.
*
@@ -28,11 +28,25 @@
#include <stdlib.h>
-void *__dso_handle = NULL;
-
+/*
+ * The __cxa_atexit() function and friends are needed for full (IA64) C++ ABI
+ * compatibility but FreeBSD doesn't have implemented them, yet. In addition
+ * to the classic atexit() it is not only used to register functions to be
+ * called at program exit but also to call them (C++ destructors in that case)
+ * when a shared object is unloaded. For the later to work the dynamic linker
+ * assigns a unique dynamic shared object handle to every shared object while
+ * a handle of NULL represents a main program. When __cxa_finalize() is called
+ * with a specific (non-NULL) handle as an argument all functions registered
+ * via __cxa_atexit() and having the same handle are called.
+ * The best we can do here to emulate that behaviour until FreeBSD supports
+ * this is to register the functions via atexit(). While this certainly is a
+ * bad hack it seems to work, even the current dynamic linker is assigning
+ * the handles. I didn't see a function getting registered with an argument
+ * so far.
+ */
int
-__cxa_atexit(void (*fn)(), void *arg, void *d)
+__cxa_atexit(void (*fn)(), void *arg, void *handle)
{
- return (atexit(fn));
+ return (handle ? atexit(fn) : 0);
}
diff --git a/lang/icc7/files/cxa_finalize.c b/lang/icc7/files/cxa_finalize.c
new file mode 100644
index 000000000000..5865a2f7138f
--- /dev/null
+++ b/lang/icc7/files/cxa_finalize.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$
+ */
+
+void
+__cxa_finalize(void *handle)
+{
+
+ /*
+ * As we dared to register the functions via atexit() this job will
+ * be done by exit().
+ */
+ return;
+}
diff --git a/lang/icc7/files/errno_location.c b/lang/icc7/files/errno_location.c
new file mode 100644
index 000000000000..ba9f3d8b48bc
--- /dev/null
+++ b/lang/icc7/files/errno_location.c
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2000 Andrew Gallatin and David O'Brien
+ * 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.
+ *
+ * copied over from: FreeBSD: ports/lang/compaq-cc/files/errno_location.c,v 1.1 2000/12/08 13:27:29 obrien Exp
+ *
+ * $FreeBSD$
+ */
+
+#include <errno.h>
+
+int *
+__errno_location(void)
+{
+ return &errno;
+}
diff --git a/lang/icc7/files/ld b/lang/icc7/files/ld
deleted file mode 100644
index d25901783095..000000000000
--- a/lang/icc7/files/ld
+++ /dev/null
@@ -1,128 +0,0 @@
-#! /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>.
-# 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 in a test -lirc works here
- -limf|\
- ${PREFIX}/intel/compiler60/ia32/lib/icrt.link|\
- -Qy\
- )
- # libs that have Linux lib dependencies
- # possibly unneeded .link file?
- # 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
- ;;
- -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 \
- -L${PREFIX}/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 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
- ;;
- *)
- ;;
- esac
- # append our new $val to the end of argv, if it still exists.
- if [ ${#val} -gt 0 ] ; then
- set -- "$@" "$val"
- fi
- i=$(($i+1))
-done
-# run FreeBSD's ld with our new args
-exec ${PREFIX}/intel/compiler60/ia32/bin/real/ld "$@"
diff --git a/lang/icc7/files/ld.c b/lang/icc7/files/ld.c
new file mode 100644
index 000000000000..8bcf90797140
--- /dev/null
+++ b/lang/icc7/files/ld.c
@@ -0,0 +1,404 @@
+/*
+ * 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.
+ *
+ * Wrapper for Intel(R) C/C++ Compiler for Linux to allow linking of native
+ * FreeBSD binaries.
+ * Based on a shell-script written by Dan Nelson <dnelson@allantgroup.com>
+ * with some modifications by Alexander Leidinger <netchild@FreeBSD.org>.
+ *
+ * $FreeBSD$
+ */
+
+/* Uses code marked: */
+
+/* OpenBSD: mailwrapper.c,v 1.6 1999/12/17 05:06:28 mickey Exp */
+/* NetBSD: mailwrapper.c,v 1.3 1999/05/29 18:18:15 christos Exp */
+/* FreeBSD: src/usr.sbin/mailwrapper/mailwrapper.c,v 1.8 2002/07/11 18:27:55 alfred Exp */
+
+/*
+ * Copyright (c) 1998
+ * Perry E. Metzger. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgment:
+ * This product includes software developed for the NetBSD Project
+ * by Perry E. Metzger.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
+ */
+
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#if defined (__FreeBSD__) && __FreeBSD__ >= 2
+ #include <osreldate.h>
+#else
+ #error "Won't work here."
+#endif
+
+#define PATH_LD "/usr/bin/ld"
+
+struct arglist {
+ size_t argc, maxc;
+ char **argv;
+};
+
+static void initarg(struct arglist *al);
+static void addarg(struct arglist *al, const char *arg, int copy);
+static void freearg(struct arglist *al, int copy);
+int main(int argc, char *argv[], char *envp[]);
+
+static void
+initarg(struct arglist *al)
+{
+
+ al->argc = 0;
+ al->maxc = 10;
+ if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
+ err(1, NULL);
+}
+
+static void
+addarg(struct arglist *al, const char *arg, int copy)
+{
+ char **argv2;
+
+ if (al->argc == al->maxc) {
+ al->maxc <<= 1;
+
+ if ((argv2 = realloc(al->argv,
+ al->maxc * sizeof(char *))) == NULL) {
+ if (al->argv)
+ free(al->argv);
+ al->argv = NULL;
+ err(1, NULL);
+ } else {
+ al->argv = argv2;
+ }
+ }
+ if (copy) {
+ if ((al->argv[al->argc++] = strdup(arg)) == NULL)
+ err(1, NULL);
+ } else {
+ al->argv[al->argc++] = (char *)arg;
+ }
+}
+
+static
+void freearg(struct arglist *al, int copy)
+{
+ size_t i;
+
+ if (copy)
+ for (i = 0; i < al->argc; i++)
+ free(al->argv[i]);
+ free(al->argv);
+}
+
+int
+main(int argc, char *argv[], char *envp[])
+{
+ size_t i;
+ int bootstrap, cpp, dynamic, shared, stlinserted;
+ char *prefix;
+ struct arglist al;
+
+ if (argc == 1)
+ errx(1, "no input files");
+
+ if ((prefix = getenv("PREFIX")) == NULL)
+ errx(1, "can't get PREFIX");
+
+ initarg(&al);
+ bootstrap = cpp = dynamic = shared = stlinserted = 0;
+
+#ifdef DEBUG
+ printf("input: ");
+#endif
+
+#define ARGCMP(x) !strcmp(argv[i], (x))
+#define ARGCMPB(x, y) (strlen(x) + strlen(y) == strlen(argv[i]) && \
+ !strncmp(argv[i], (x), strlen(x)) && \
+ !strncmp(argv[i] + strlen(x), (y), strlen(y)))
+
+ /*
+ * XXX This doesn't deal with whitespace but a) the output of the
+ * compiler should be fixed and b) the real linker is also picky
+ * about whitespace.
+ */
+ for (i = 0; i < argc; i++) {
+#ifdef DEBUG
+ printf("%s ", argv[i]);
+#endif
+
+ if (ARGCMP("-CPLUSPLUS")) {
+ cpp++;
+ continue;
+ }
+
+ if (ARGCMP("-BOOTSTRAPSTLPORT")) {
+ bootstrap++;
+ continue;
+ }
+
+ if (ARGCMP("-shared")) {
+ shared++;
+ continue;
+ }
+
+ /*
+ * If the compiler was called with -static we shouldn't see
+ * "--dynamic-linker" here.
+ * Note: According to ld(1) this is "--dynamic-linker" but
+ * ICC passes "-dynamic-linker" to it.
+ */
+ if (ARGCMP("--dynamic-linker") || ARGCMP("-dynamic-linker")) {
+ dynamic++;
+ continue;
+ }
+
+ /*
+ * Just link libstlport_icc* once when compiling the stlport
+ * tests.
+ */
+ if (!strncmp(argv[i], "-lstlport_icc",
+ strlen("-lstlport_icc"))) {
+ stlinserted++;
+ continue;
+ }
+ }
+
+#ifdef DEBUG
+ printf("\ncpp: %s bootstrap: %s dynamic: %s shared: %s\n",
+ cpp ? "YES" : "NO", bootstrap ? "YES" : "NO",
+ dynamic ? "YES" : "NO", shared ? "YES" : "NO");
+#endif
+
+ if (bootstrap && !cpp)
+ errx(1, "-BOOTSTRAPSTLPORT is only valid in combination with "
+ "-CPLUSPLUS");
+
+ for (i = 0; i < argc; i++) {
+ if (ARGCMP("-CPLUSPLUS") || ARGCMP("-BOOTSTRAPSTLPORT"))
+ continue;
+
+ /* prepend "-melf_i386" to the commandline */
+ if (i == 0) {
+ addarg(&al, argv[0], 1);
+ addarg(&al, "-melf_i386", 1);
+ continue;
+ }
+
+ /*
+ * "-u ___pseudo_link" triggers linking of additional objects
+ * from libcxa which seem to bloat the binaries, i.e. they
+ * perfectly work without it. Intel Support promised to look
+ * up what this servers for...
+ */
+ if (ARGCMP("-u") || ARGCMP("___pseudo_link"))
+ continue;
+
+ /* Don't add obsolete flag "-Qy". */
+ if (ARGCMP("-Qy"))
+ continue;
+
+ /*
+ * Because of a nasty behaviour (bug?) of binutils/ld 2.12.[0,1]
+ * we must not statically link libcxa and libunwind to shared
+ * objects, e.g. our STL replacement. Doing so causes broken
+ * exception handling amongst some other strange reactions.
+ * This perfectly worked with binutils/ld 2.11.2.
+ */
+ if (cpp && shared && (ARGCMP("-lcxa") || ARGCMP("-lunwind")))
+ continue;
+
+ /* Libunwind is only needed when compiling C++ source. */
+ if (!cpp && ARGCMP("-lunwind"))
+ continue;
+
+ /*
+ * Replace libcprts with libstlport_icc. The Dinkumware STL
+ * shipping with ICC has unresolvable glibc dependencies
+ * in both, the static and the dynamic, versions.
+ */
+ if (ARGCMP("-lcprts")) {
+ if (cpp && !bootstrap && !stlinserted) {
+ addarg(&al,
+ dynamic ? "-Bdynamic" : "-Bstatic", 1);
+ addarg(&al, "-lstlport_icc", 1);
+ stlinserted++;
+ }
+ continue;
+ }
+
+ /*
+ * Libcxa and libunwind depend on libc_r when compiling C++
+ * source.
+ */
+ if (cpp && ARGCMP("-lc")) {
+ if (al.argc > 0 &&
+ strncmp(al.argv[al.argc - 1], "-B", strlen("-B")))
+ addarg(&al,
+ dynamic ? "-Bdynamic" : "-Bstatic", 1);
+#if __FreeBSD_version < 500016
+ addarg(&al, "-lc_r", 1);
+#else
+ addarg(&al, "-lc", 1);
+ addarg(&al, dynamic ? "-Bdynamic" : "-Bstatic", 1);
+ addarg(&al, "-lc_r", 1);
+#endif
+ continue;
+ }
+
+ /* Switch Linux stuff to FreeBSD counterparts. */
+ if (ARGCMP("/lib/ld-linux.so.2")) {
+ addarg(&al, "/usr/libexec/ld-elf.so.1", 1);
+ continue;
+ }
+ if (ARGCMP("-L/usr/lib")) {
+ char *temp;
+
+ if ((temp = (char *) malloc(strlen("-L") +
+ strlen(prefix) + strlen("/lib") + 1)) == NULL)
+ err(1, NULL);
+
+ addarg(&al, "-L/usr/libexec/elf", 1);
+ addarg(&al, "-L/usr/libexec", 1);
+ addarg(&al, "-L/usr/lib", 1);
+ snprintf(temp, strlen("-L") + strlen(prefix) +
+ strlen("/lib") + 1, "-L%s/lib", prefix);
+ addarg(&al, temp, 1);
+ free(temp);
+ continue;
+ }
+
+ /*
+ * Link and map files for C++ exception handling, C++ ABI stuff.
+ */
+ if (!cpp &&
+ (ARGCMP("--version-script") ||
+ ARGCMPB(prefix, "/intel/compiler60/ia32/lib/icrt.link") ||
+ ARGCMPB(prefix,
+ "/intel/compiler60/ia32/lib/icrt.internal.map") ||
+ ARGCMPB(prefix, "/intel/compiler60/ia32/lib/crtxi.o") ||
+ ARGCMPB(prefix, "/intel/compiler60/ia32/lib/crtxn.o"))) {
+ continue;
+ }
+
+ /*
+ * Force libcxa and libunwind to static linkage, since the
+ * dynamic versions have glibc dependencies.
+ * Don't add superfluous -Bdynamic.
+ */
+ if (ARGCMP("-Bdynamic") && i <= argc + 1) {
+ if (!shared && (!strcmp(argv[i + 1], "-lcxa") ||
+ (cpp && !strcmp(argv[i + 1], "-lunwind")))) {
+ addarg(&al, "-Bstatic", 1);
+ continue;
+ }
+
+ if (!strcmp(argv[i + 1], "-lcprts") ||
+ !strcmp(argv[i + 1], "-lcxa") ||
+ !strcmp(argv[i + 1], "-lunwind"))
+ continue;
+ }
+
+ /* Don't add superfluous -Bstatic. */
+ if (ARGCMP("-Bstatic") && i <= argc + 1 &&
+ (!strcmp(argv[i + 1], "-lcprts") ||
+ (!cpp && !strcmp(argv[i + 1], "-lunwind"))))
+ continue;
+
+ /*
+ * Sanity check if every lib is prepended by a linkage option,
+ * add if missing.
+ */
+ if (!strncmp(argv[i], "-l", strlen("-l")) && al.argc > 0 &&
+ strncmp(al.argv[al.argc - 1], "-B", strlen("-B"))) {
+ if (!strcmp(argv[i], "-lcxa") ||
+ !strcmp(argv[i], "-limf") ||
+ !strcmp(argv[i], "-lirc") ||
+ !strcmp(argv[i], "-lunwind"))
+ addarg(&al, "-Bstatic", 1);
+ else
+ addarg(&al,
+ dynamic ? "-Bdynamic" : "-Bstatic", 1);
+
+ addarg(&al, argv[i], 1);
+ continue;
+ }
+
+ /* default */
+ addarg(&al, argv[i], 1);
+ }
+
+#undef ARGCMP
+#undef ARGCMPB
+
+ /* Still something to do ? */
+ if (al.argc == 1)
+ errx(1, "no input files");
+
+#ifdef DEBUG
+ printf("output: ");
+
+ for (i = 0; i < al.argc; i++)
+ printf("%s ", al.argv[i]);
+
+ printf("\n");
+#endif
+
+ addarg(&al, NULL, 0);
+
+ /* Launch the real linker */
+ if (execve(PATH_LD, al.argv, envp) == -1)
+ err(1, "execing %s", PATH_LD);
+
+ freearg(&al, 1);
+
+ exit (1);
+}
diff --git a/lang/icc7/files/patch-icc b/lang/icc7/files/patch-icc
index a6aeaf03bb9c..53426d19cbe0 100644
--- a/lang/icc7/files/patch-icc
+++ b/lang/icc7/files/patch-icc
@@ -1,9 +1,39 @@
--- 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 @@
+@@ -1,29 +1,44 @@
+ #!/bin/sh
+-INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
++PREFIX=@@PREFIX@@
++export PREFIX;
++INTEL_LICENSE_FILE=${PREFIX}/intel/licenses;
+ export INTEL_LICENSE_FILE;
+
+ if [ -z LD_LIBRARY_PATH ]
+ then
+- LD_LIBRARY_PATH=<INSTALLDIR>/compiler60/ia32/lib;
++ LD_LIBRARY_PATH=${PREFIX}/intel/compiler60/ia32/lib;
+ else
+- LD_LIBRARY_PATH=<INSTALLDIR>/compiler60/ia32/lib:$LD_LIBRARY_PATH
++ LD_LIBRARY_PATH=${PREFIX}/intel/compiler60/ia32/lib:$LD_LIBRARY_PATH
+ fi
+ export LD_LIBRARY_PATH;
+
+ if [ -z PATH ]
+ then
+- PATH=<INSTALLDIR>/compiler60/ia32/bin;
++ PATH=${PREFIX}/intel/compiler60/ia32/bin;
+ else
+- PATH=<INSTALLDIR>/compiler60/ia32/bin:$PATH;
++ PATH=${PREFIX}/intel/compiler60/ia32/bin:$PATH;
+ fi
+ export PATH;
+
+-export -n IA32ROOT; unset IA32ROOT;
+-
if [ $# != 0 ]
then
+- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin "$@";
+ i=0
+ argc=$#
+ while [ $i -lt $argc ] ; do
@@ -19,6 +49,8 @@
+ set -- "$@" "$val1"
+ i=$(($i+1))
+ done
- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin "$@";
++ exec ${PREFIX}/intel/compiler60/ia32/bin/iccbin "$@";
else
- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin;
+- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icc" <INSTALLDIR>/compiler60/ia32/bin/iccbin;
++ exec ${PREFIX}/intel/compiler60/ia32/bin/iccbin;
+ fi
diff --git a/lang/icc7/files/patch-icpc b/lang/icc7/files/patch-icpc
new file mode 100644
index 000000000000..03e4dd7c1c95
--- /dev/null
+++ b/lang/icc7/files/patch-icpc
@@ -0,0 +1,41 @@
+--- opt/intel/compiler60/ia32/bin/icpc.orig Fri Sep 6 02:18:03 2002
++++ opt/intel/compiler60/ia32/bin/icpc Tue Sep 10 18:32:59 2002
+@@ -1,29 +1,29 @@
+ #!/bin/sh
+
+-INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
++PREFIX=@@PREFIX@@
++export PREFIX;
++INTEL_LICENSE_FILE=${PREFIX}/intel/licenses;
+ export INTEL_LICENSE_FILE;
+
+ if [ -z LD_LIBRARY_PATH ]
+ then
+- LD_LIBRARY_PATH=<INSTALLDIR>/compiler60/ia32/lib;
++ LD_LIBRARY_PATH=${PREFIX}/intel/compiler60/ia32/lib;
+ else
+- LD_LIBRARY_PATH=<INSTALLDIR>/compiler60/ia32/lib:$LD_LIBRARY_PATH
++ LD_LIBRARY_PATH=${PREFIX}/intel/compiler60/ia32/lib:$LD_LIBRARY_PATH
+ fi
+ export LD_LIBRARY_PATH;
+
+ if [ -z PATH ]
+ then
+- PATH=<INSTALLDIR>/compiler60/ia32/bin;
++ PATH=${PREFIX}/intel/compiler60/ia32/bin;
+ else
+- PATH=<INSTALLDIR>/compiler60/ia32/bin:$PATH;
++ PATH=${PREFIX}/intel/compiler60/ia32/bin:$PATH;
+ fi
+ export PATH;
+
+-export -n IA32ROOT; unset IA32ROOT;
+-
+ if [ $# != 0 ]
+ then
+- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icpc" <INSTALLDIR>/compiler60/ia32/bin/icpcbin "$@";
++ exec ${PREFIX}/intel/compiler60/ia32/bin/icpcbin "$@";
+ else
+- exec -a "<INSTALLDIR>/compiler60/ia32/bin/icpc" <INSTALLDIR>/compiler60/ia32/bin/icpcbin;
++ exec ${PREFIX}/intel/compiler60/ia32/bin/icpcbin;
+ fi
diff --git a/lang/icc7/files/patch-include b/lang/icc7/files/patch-include
index c1b54eb722c0..35613dd41e4b 100644
--- a/lang/icc7/files/patch-include
+++ b/lang/icc7/files/patch-include
@@ -52,3 +52,41 @@
using ::wmemchr; using ::wmemcmp; using ::wmemcpy;
using ::wmemmove; using ::wmemset;
// using ::wcsftime;
+--- opt/intel/compiler60/ia32/include/cfloat.orig Thu Sep 12 07:08:29 2002
++++ opt/intel/compiler60/ia32/include/cfloat Thu Sep 12 08:01:57 2002
+@@ -6,35 +6,6 @@
+
+ #include <float.h>
+
+- #if __EDG__
+-_C_STD_BEGIN
+- /* TYPE DEFINITIONS */
+-typedef struct
+- { /* parameters for a floating-point type */
+- int _Ddig, _Dmdig, _Dmax10e, _Dmaxe, _Dmin10e, _Dmine;
+- union
+- { /* union of short array and all floats */
+- unsigned short _Us[8];
+- float _Float;
+- double _Double;
+- long double _Long_double;
+- } _Deps, _Dmax, _Dmin;
+- } _Dvals;
+-
+- /* DECLARATIONS */
+-_C_LIB_DECL
+-extern const _Dvals _Ldbl;
+-_END_C_LIB_DECL
+-_C_STD_END
+-
+-#undef LDBL_EPSILON /* redefine macros that use gcc extension */
+-#undef LDBL_MAX
+-#undef LDBL_MIN
+-
+-#define LDBL_EPSILON _CSTD _Ldbl._Deps._Long_double
+-#define LDBL_MAX _CSTD _Ldbl._Dmax._Long_double
+-#define LDBL_MIN _CSTD _Ldbl._Dmin._Long_double
+- #endif /* __EDG__ */
+ #endif /* _CFLOAT_ */
+
+ /*
diff --git a/lang/icc7/files/stderr.c b/lang/icc7/files/stderr.c
index aeb5013d10b4..9e463e445318 100644
--- a/lang/icc7/files/stderr.c
+++ b/lang/icc7/files/stderr.c
@@ -1,4 +1,4 @@
-/*-
+/*
* Copyright (c) 2002 Marius Strobl
* All rights reserved.
*