aboutsummaryrefslogtreecommitdiffstats
path: root/lang/icc/files
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2004-11-17 04:14:47 +0800
committermarius <marius@FreeBSD.org>2004-11-17 04:14:47 +0800
commitaa676ddbc1f70f17fc674f116b494c8957f14e4e (patch)
tree7ed39b3cffb8bed04573253acbad9454b32dd8e8 /lang/icc/files
parent242db5bb42de7b056861c7b816f9caf5046dbfa5 (diff)
downloadfreebsd-ports-gnome-aa676ddbc1f70f17fc674f116b494c8957f14e4e.tar.gz
freebsd-ports-gnome-aa676ddbc1f70f17fc674f116b494c8957f14e4e.tar.zst
freebsd-ports-gnome-aa676ddbc1f70f17fc674f116b494c8957f14e4e.zip
- Update to 8.1.024.
- Declare a PATCH_DEPENDS on emulators/linux_base-8 only if actually using RTPpatch to apply an Intel provided binary patch. - Turn the GCC-compatibility of ICC on by default for FreeBSD >= 502108; except for one bug which is worked around by this port and will be fixed in src later FreeBSD gained support for using the GCC-compatibility along with the patch to compile the kernel with ICC (but the ICC 8.0 series wasn't configurable/hackable enough to actually use it on FreeBSD, which resulted into the aforementioned bug). - On FreeBSD >= 502108 default to using libstdc++ from the base as STL instead of STLport unless "-cxxlib-icc" is passed to icpc (made possible by turning on the GCC-compatibility and the compatibility to GCC 3.3 and 3.4 which was added to ICC 8.1). On FreeBSD < 502108 STLport i.e. devel/stlport-icc is and will continue to be the only STL available. Update the instructions displayed by the post-install target accordingly. - Put the wrappers for glibc specific symbols and other GNU/Linux compat hacks into their own library "libiccfbsd" and teach the ld-wrapper to injected this lib instead of adding these things to the Intel libcxa and libcxaguard. Beginning with ICC 8.1 non of the Intel libs is "guaranteed" to be linked into resulting executable (this is actually a fix in ICC as libcxa and libcxaguard are C++ only). This fixes linking against libm with icc amongst other things [1]. - Clean the ld-wrapper up a bit. Stop trying to create a perfect world for the real ld(1) regarding superfluous linkage options, ICC natively passes far to many of them to the linker that we easily could remove them all. - Change the ld-wrapper to allow for bootstrapping STLport in a bit different way that we used to do it, required to make devel/stlport-icc build correctly again. - Use fmt(1) to print the infos displayed by the post-install target so the text is formated properly after the included variables are expanded [2]. Todo: - Rework the freaking thread library selection via the PTHREAD_LIBS environment variable by the ld-wrapper, this causes really annoying problems when compiling ports with ICC. Some functionality analogous to the GCC "-pthread" option (which is also known by ICC but is not documented and doesn't do the right thing for FreeBSD) would be great. - Make devel/stlport-icc build again with ICC 8.1 after devel/stlport has been updated to 4.6.2 (PR 73604). Patch for 4.5.3 already done. Reported by: Dan Nelson <dnelson@allantgroup.com> [1] Courtesy of: netchild [2] Approved by: netchild
Diffstat (limited to 'lang/icc/files')
-rw-r--r--lang/icc/files/_types.h50
-rw-r--r--lang/icc/files/exclude1
-rw-r--r--lang/icc/files/ld.c112
-rw-r--r--lang/icc/files/patch-bin::icpc18
4 files changed, 121 insertions, 60 deletions
diff --git a/lang/icc/files/_types.h b/lang/icc/files/_types.h
new file mode 100644
index 000000000000..8133831e030f
--- /dev/null
+++ b/lang/icc/files/_types.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. 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 acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * From: FreeBSD: src/sys/i386/include/_types.h,v 1.9 2004/03/20 20:41:40 marcel Exp
+ * $FreeBSD$
+ */
+
+#ifndef __INTEL_COMPILER_MACHINE__TYPES_H_
+#define __INTEL_COMPILER_MACHINE__TYPES_H_
+
+#include_next <machine/_types.h>
+
+#if defined(__GNUC__) && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !__INTEL_COMPILER_MACHINE__TYPES_H_ */
diff --git a/lang/icc/files/exclude b/lang/icc/files/exclude
index c304cf11c1be..40278da8a9ce 100644
--- a/lang/icc/files/exclude
+++ b/lang/icc/files/exclude
@@ -71,7 +71,6 @@ lib/libguide.a
lib/libguide.so
lib/libguide_stats.a
lib/libguide_stats.so
-lib/libimf.so
lib/libompstub.a
lib/libsvml.so
lib/libunwind.so
diff --git a/lang/icc/files/ld.c b/lang/icc/files/ld.c
index 9df01de0660f..797fe7497610 100644
--- a/lang/icc/files/ld.c
+++ b/lang/icc/files/ld.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2003 Marius Strobl
+ * Copyright (c) 2002-2004 Marius Strobl
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,12 +42,12 @@ __FBSDID("$FreeBSD$");
#define PATH_LD "/usr/bin/ld"
-#define LDW_CPP (1<<0)
+#define LDW_CXXICC (1<<0)
#define LDW_DYN (1<<1)
#define LDW_GPROF (1<<2)
#define LDW_PIC (1<<3)
-#define LDW_THR (1<<4)
-#define LDW_LGCC (1<<5)
+#define LDW_STLP (1<<4)
+#define LDW_THR (1<<5)
struct arglist {
size_t argc;
@@ -105,7 +105,7 @@ main(int argc, char *argv[], char *envp[])
#endif
if (ARGCMP(i, "-CPLUSPLUS")) {
- flags |= LDW_CPP;
+ flags |= LDW_CXXICC;
continue;
}
@@ -134,6 +134,17 @@ main(int argc, char *argv[], char *envp[])
}
/*
+ * The STLport library just can be linked once otherwise
+ * we get problems with constructors and destructors of
+ * global instances.
+ */
+ if (!strncmp(argv[i], "-lstlport_icc",
+ sizeof("-lstlport_icc") - 1)) {
+ flags |= LDW_STLP;
+ continue;
+ }
+
+ /*
* Link against libc_p when "-qp" or "-p" were given,
* "/usr/lib/gcrt1.o" indicates this.
*/
@@ -141,11 +152,6 @@ main(int argc, char *argv[], char *envp[])
flags |= LDW_GPROF;
continue;
}
-
- if (ARGCMP(i, "-lgcc")) {
- flags |= LDW_LGCC;
- continue;
- }
}
/*
@@ -174,7 +180,8 @@ main(int argc, char *argv[], char *envp[])
if (!(flags & LDW_GPROF))
libc = "-lc_pic";
else {
- char *p;
+ char *p;
+
libc = "-lc_p";
asprintf(&p, "%s_p", libthr);
if (p == NULL)
@@ -190,12 +197,13 @@ main(int argc, char *argv[], char *envp[])
for (i = 0; i < argc; i++) {
if (ARGCMP(i, "-CPLUSPLUS") || ARGCMP(i, "-MT") ||
- ARGCMP(i, "-PIC") ||
- (ARGCMP(i, "-m") && i<argc-1 && ARGCMP(i+1, "elf_i386")) ||
- (ARGCMP(i, "elf_i386") && i != 0 && ARGCMP(i-1, "-m")))
+ ARGCMP(i, "-PIC"))
continue;
- /* prepend "-melf_i386" to the commandline */
+ /*
+ * Prepend "-melf_i386" and "-melf_i386_fbsd" respectively
+ * to the commandline.
+ */
if (i == 0) {
addarg(&al, argv[0]);
#if __FreeBSD_version < 500042
@@ -206,8 +214,14 @@ main(int argc, char *argv[], char *envp[])
continue;
}
- /* Don't add obsolete flag "-Qy", don't add libgcc_s. */
- if (ARGCMP(i, "-Qy") || ARGCMP(i, "-lgcc_s"))
+ /*
+ * Don't add "-m elf_i386" ICC passed to us. Don't add
+ * libgcc_eh, libgcc_s or libgcc_s_32.
+ */
+ if ((ARGCMP(i, "-m") && i < argc - 1 && ARGCMP(i + 1,
+ "elf_i386")) || (ARGCMP(i, "elf_i386") && i != 0 &&
+ ARGCMP(i - 1, "-m")) || ARGCMP(i, "-lgcc_eh") ||
+ ARGCMP(i, "-lgcc_s") || ARGCMP(i, "-lgcc_s_32"))
continue;
/*
@@ -216,7 +230,13 @@ main(int argc, char *argv[], char *envp[])
* in both, the static and the dynamic, versions.
*/
if (ARGCMP(i, "-lcprts")) {
- if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
+ if (flags & LDW_CXXICC && !(flags & LDW_STLP)) {
+ char *p;
+
+ asprintf(&p, "-L%s/lib", icc_localbase);
+ if (p == NULL)
+ err(1, NULL);
+ addarg(&al, p);
addarg(&al,
flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
addarg(&al, "-lstlport_icc");
@@ -225,16 +245,16 @@ main(int argc, char *argv[], char *envp[])
}
/*
+ * Inject the compatibility library for ICC libs on FreeBSD.
* Link against libthr when compiling multi-threaded or C++
- * code (libcxa and libunwind depend on a threads library
- * when compiling C++ source).
+ * code and not using libstdc++ (libcxa and libunwind depend
+ * on a threads library).
*/
if (ARGCMP(i, "-lc")) {
- if (al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", 2))
- addarg(&al,
- flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
- if (flags & (LDW_CPP | LDW_THR)) {
+ addarg(&al, "-Bstatic");
+ addarg(&al, "-liccfbsd");
+ addarg(&al, flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ if (flags & (LDW_CXXICC | LDW_THR)) {
addarg(&al, libthr);
#if __FreeBSD_version >= 500016
addarg(&al,
@@ -259,47 +279,29 @@ main(int argc, char *argv[], char *envp[])
addarg(&al, "-L/usr/libexec/elf");
addarg(&al, "-L/usr/libexec");
addarg(&al, "-L/usr/lib");
- if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
- char *p;
- asprintf(&p, "-L%s/lib", icc_localbase);
- if (p == NULL)
- err(1, NULL);
- addarg(&al, p);
- }
continue;
}
/*
- * Force libcxa, libcxaguard, libsvml and libunwind to static
- * linkage, since the dynamic versions have glibc dependencies.
- * Don't add superfluous -Bdynamic.
+ * Force libcxa, libcxaguard, libimf, libsvml and libunwind
+ * to static linkage, since the dynamic versions have glibc
+ * dependencies.
*/
- if (ARGCMP(i, "-Bdynamic") && i < argc - 1) {
- if (ARGCMP(i + 1, "-lcxa") ||
- ARGCMP(i + 1, "-lcxaguard") ||
- ARGCMP(i + 1, "-lsvml") ||
- ARGCMP(i + 1, "-lunwind")) {
- addarg(&al, "-Bstatic");
- continue;
- }
-
- if (ARGCMP(i + 1, "-lcprts") ||
- ARGCMP(i + 1, "-lgcc_s"))
- continue;
- }
-
- /* Don't add superfluous -Bstatic. */
- if (ARGCMP(i, "-Bstatic") && i < argc - 1 &&
- (ARGCMP(i + 1, "-lcprts") || ARGCMP(i + 1, "-lgcc_s") ||
- ARGCMP(i + 1, "-lsvml") || ARGCMP(i + 1, "-lunwind")))
+ if (ARGCMP(i, "-Bdynamic") && i < argc - 1 &&
+ (ARGCMP(i + 1, "-lcxa") || ARGCMP(i + 1, "-lcxaguard") ||
+ ARGCMP(i + 1, "-limf") || ARGCMP(i + 1, "-lsvml") ||
+ ARGCMP(i + 1, "-lunwind"))) {
+ addarg(&al, "-Bstatic");
continue;
+ }
/*
* Sanity check if every lib is prepended by a linkage option,
* add if missing.
*/
- if (!strncmp(argv[i], "-l", 2) && al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", 2)) {
+ if (!strncmp(argv[i], "-l", 2) &&
+ ((i != 0 && strncmp(argv[i - 1], "-B", 2)) ||
+ (al.argc > 0 && strncmp(al.argv[al.argc - 1], "-B", 2)))) {
if (ARGCMP(i, "-lcxa") || ARGCMP(i, "-lcxaguard") ||
ARGCMP(i, "-limf") || ARGCMP(i, "-lirc") ||
ARGCMP(i, "-lirc_s") || ARGCMP(i, "-lsvml") ||
diff --git a/lang/icc/files/patch-bin::icpc b/lang/icc/files/patch-bin::icpc
index 2c1f4483b729..04f3858d9aed 100644
--- a/lang/icc/files/patch-bin::icpc
+++ b/lang/icc/files/patch-bin::icpc
@@ -1,6 +1,6 @@
--- bin/icpc.orig Tue Dec 9 19:55:12 2003
+++ bin/icpc Tue Dec 9 20:12:01 2003
-@@ -1,6 +1,12 @@
+@@ -1,6 +1,18 @@
#!/bin/sh
-if [ -z INTEL_LICENSE_FILE ]
@@ -10,11 +10,17 @@
+GXX_ROOT=<INSTALLDIR>/lib
+export GXX_ROOT
+
++GXX_INCLUDE=%%GXX_INCLUDE%%
++if [ ! -z "$GXX_INCLUDE" ]
++then
++ export GXX_INCLUDE
++fi
++
+if [ -z "$INTEL_LICENSE_FILE" ]
then
INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
else
-@@ -8,7 +14,7 @@
+@@ -8,7 +20,7 @@
fi
export INTEL_LICENSE_FILE;
@@ -23,7 +29,7 @@
then
LD_LIBRARY_PATH=<INSTALLDIR>/lib;
else
-@@ -16,7 +22,7 @@
+@@ -16,7 +28,7 @@
fi
export LD_LIBRARY_PATH;
@@ -32,7 +38,7 @@
then
PATH=<INSTALLDIR>/bin;
else
-@@ -24,11 +30,39 @@
+@@ -24,11 +36,43 @@
fi
export PATH;
@@ -56,6 +62,10 @@
+ echo "Sorry, option '$val1' is not supported on FreeBSD."
+ exit 1
+ fi
++ if [ "${val1}" = "-cxxlib-icc" ] ; then
++ set -- "$@" "-I${ICC_LOCALBASE}/include/stlport"
++ set -- "$@" "-Qoption,ld,-CPLUSPLUS"
++ fi
+ if [ "${val1}" = "-Kpic" ] || [ "${val1}" = "-KPIC" ] || \
+ [ "${val1}" = "-fpic" ] || [ "${val1}" = "-fPIC" ] ; then
+ set -- "$@" "-Qoption,ld,-PIC"