summaryrefslogtreecommitdiff
path: root/lang/icc11/files
diff options
context:
space:
mode:
authoralnsn <alnsn>2011-07-20 10:35:17 +0000
committeralnsn <alnsn>2011-07-20 10:35:17 +0000
commitc73abbaae266247794dae68f9a260cafdf3f118a (patch)
treef0d9cc8bd7c13127c449ab3014e5f890eac056ab /lang/icc11/files
parentdf5b07d55223e9805880ccddd687e53f13c530ab (diff)
downloadpkgsrc-c73abbaae266247794dae68f9a260cafdf3f118a.tar.gz
Add Intel C++ compiler version 11.1.080.
Available for NetBSD and Linux on Intel arches. Approved a while ago by wiz@.
Diffstat (limited to 'lang/icc11/files')
-rw-r--r--lang/icc11/files/Makefile122
-rw-r--r--lang/icc11/files/README.bsd18
-rw-r--r--lang/icc11/files/README.pkgsrc49
-rw-r--r--lang/icc11/files/as.c35
-rw-r--r--lang/icc11/files/icc52
-rw-r--r--lang/icc11/files/icc11bsd.c22
-rw-r--r--lang/icc11/files/ld.c45
-rw-r--r--lang/icc11/files/linux/icc24
-rw-r--r--lang/icc11/files/util.c43
-rw-r--r--lang/icc11/files/util.h3
-rw-r--r--lang/icc11/files/xiar13
11 files changed, 426 insertions, 0 deletions
diff --git a/lang/icc11/files/Makefile b/lang/icc11/files/Makefile
new file mode 100644
index 00000000000..6826e129385
--- /dev/null
+++ b/lang/icc11/files/Makefile
@@ -0,0 +1,122 @@
+linux-ia32:
+linux-intel64:
+
+netbsd-ia32: as ld redefine-syms libicc11bsd-ia32.a
+netbsd-intel64: netbsd-ia32 libicc11bsd-intel64.a
+
+.PHONY: redefine-syms
+
+redefine-syms:
+ find icc11/lib -name *.a -exec objcopy \
+ --redefine-sym __errno_location=__errno \
+ --redefine-sym __assert_fail=__assertion_failed \
+ {} \;
+
+libicc11bsd-ia32.a: icc11bsd-ia32.o
+ ar r libicc11bsd-ia32.a icc11bsd-ia32.o
+ objcopy --redefine-sym my_stderr=stderr libicc11bsd-ia32.a
+
+icc11bsd-ia32.o: icc11bsd.c
+ cc -m32 -fPIC -O icc11bsd.c -c -o icc11bsd-ia32.o
+
+libicc11bsd-intel64.a: icc11bsd-intel64.o
+ ar r libicc11bsd-intel64.a icc11bsd-intel64.o
+ objcopy --redefine-sym my_stderr=stderr libicc11bsd-intel64.a
+
+icc11bsd-intel64.o: icc11bsd.c
+ cc -m64 -fPIC -O icc11bsd.c -c -o icc11bsd-intel64.o
+
+as: as.c util.h util.c
+ cc -O as.c util.c -o as
+
+ld: ld.c util.h util.c
+ cc -O ld.c util.c -o ld
+
+install-linux-ia32: ins-common ins-common-ia32 ins-so-ia32
+install-linux-intel64: ins-common ins-common-intel64 ins-so-intel64
+install-netbsd-ia32: ins-common ins-common-ia32 ins-bsd ins-bsd-ia32
+install-netbsd-intel64: ins-common ins-common-intel64 ins-bsd ins-bsd-intel64
+
+.PHONY: ins-common ins-common-ia32 ins-common-intel64 ins-so-ia32 ins-so-intel64 ins-bsd ins-bsd-ia32 ins-bsd-intel64
+
+ins-common: ins-man ins-doc ins-examples ins-misc ins-inc ins-bin
+
+.PHONY: ins-man ins-doc ins-examples ins-misc ins-inc ins-bin
+
+ins-man:
+ install -m 755 -d ${PREFIX}/${PKGMANDIR}/man1
+ cd icc11/man/en_US && find man1 ! -type d | pax -rw -pp ${PREFIX}/${PKGMANDIR}
+
+ins-doc:
+ install -m 755 -d ${PREFIX}/share/doc/icc11
+ install -m 644 README.bsd README.pkgsrc ${PREFIX}/share/doc/icc11
+ cd icc11/Documentation && find . ! -type d | \
+ pax -rw -pp ${PREFIX}/share/doc/icc11
+
+ins-examples:
+ install -m 755 -d ${PREFIX}/share/examples/icc11
+ cd icc11/Samples && find . ! -type d | \
+ pax -rw -pp ${PREFIX}/share/examples/icc11
+
+ins-misc:
+ find icc11/substitute_headers icc11/perf_headers ! -type d | \
+ pax -rw -pp ${PREFIX}
+
+ins-inc:
+ find icc11/include -maxdepth 1 ! -type d ! -name *.orig | \
+ pax -rw -pp ${PREFIX}
+
+ins-bin:
+ find icc11/bin -maxdepth 1 ! -type d | pax -rw -pp ${PREFIX}
+ install -m 755 icc ${PREFIX}/icc11/bin
+ install -m 755 xiar ${PREFIX}/icc11/bin
+ cp -p ${PREFIX}/icc11/bin/icc ${PREFIX}/icc11/bin/icpc
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/codecov
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/prelink
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/profdcg
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/profmerge
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/proforder
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/tselect
+ cp -p ${PREFIX}/icc11/bin/xiar ${PREFIX}/icc11/bin/xild
+
+ins-common-ia32: ins-inc-ia32 ins-bin-ia32 ins-lib-ia32
+ins-common-intel64: ins-inc-intel64 ins-bin-intel64 ins-lib-intel64
+
+.PHONY: ins-inc-ia32 ins-bin-ia32 ins-lib-ia32
+.PHONY: ins-inc-intel64 ins-bin-intel64 ins-lib-intel64
+
+ins-so-ia32:
+ find icc11/lib/ia32 ! -type d | grep -w so | pax -rw -pp ${PREFIX}
+
+ins-so-intel64:
+ find icc11/lib ! -type d | grep -w so | pax -rw -pp ${PREFIX}
+
+ins-lib-ia32:
+ find icc11/lib/ia32 ! -type d | grep -vw so | pax -rw -pp ${PREFIX}
+
+ins-lib-intel64:
+ find icc11/lib ! -type d | grep -vw so | pax -rw -pp ${PREFIX}
+
+ins-bin-ia32:
+ find icc11/bin/ia32 ! -type d | pax -rw -pp ${PREFIX}
+
+ins-bin-intel64:
+ find icc11/bin ! -type d | pax -rw -pp ${PREFIX}
+
+ins-inc-ia32:
+ find icc11/include/ia32 ! -type d ! -name *.orig | pax -rw -pp ${PREFIX}
+
+ins-inc-intel64:
+ find icc11/include ! -type d ! -name *.orig | pax -rw -pp ${PREFIX}
+
+ins-bsd-ia32: libicc11bsd-ia32.a
+ install -m 644 libicc11bsd-ia32.a ${PREFIX}/icc11/lib/ia32/libicc11bsd.a
+
+ins-bsd-intel64: libicc11bsd-intel64.a
+ install -m 644 libicc11bsd-ia32.a ${PREFIX}/icc11/lib/ia32/libicc11bsd.a
+ install -m 644 libicc11bsd-intel64.a ${PREFIX}/icc11/lib/intel64/libicc11bsd.a
+
+ins-bsd: as ld
+ install -m 755 -d ${PREFIX}/icc11/libexec
+ install -m 755 as ${PREFIX}/icc11/libexec
+ install -m 755 ld ${PREFIX}/icc11/libexec
diff --git a/lang/icc11/files/README.bsd b/lang/icc11/files/README.bsd
new file mode 100644
index 00000000000..54893726b55
--- /dev/null
+++ b/lang/icc11/files/README.bsd
@@ -0,0 +1,18 @@
+Disclaimer: this document is not a part of Intel distribution.
+
+Intel C++ compiler does not run natively on BSD systems and some
+options will never be supported. Most options that require linking
+with Linux libraries fall into this category. For instance,
+
+ -shared-intel
+ -openmp
+ -mkl=[lib]
+ -opt-malloc-options=n, n > 0
+
+are not supported.
+
+However, runtime CPU detection and profile guided optimization seem
+to work even though correspondent intel libraries depend on a couple
+of glibc functions.
+
+Global optimization (-ipo) works for some packages.
diff --git a/lang/icc11/files/README.pkgsrc b/lang/icc11/files/README.pkgsrc
new file mode 100644
index 00000000000..73552ddd355
--- /dev/null
+++ b/lang/icc11/files/README.pkgsrc
@@ -0,0 +1,49 @@
+Disclaimer: this document is not a part of Intel distribution.
+
+How to use pkgsrc with the Intel C++ Compiler
+=============================================
+
+License
+-------
+
+The compiler will search for a license file in a directory specified
+by ${INTEL_LICENSE_FILE} variable if it's set, then in
+@ICC_PREFIX@/licenses, ${HOME}/intel/licenses and /opt/intel/licenses
+directories.
+
+There is one caveat, though. Pkgsrc creates a fake home directory
+so ${HOME}/intel/licenses is not a good choice for building
+packages.
+
+Bootstrap
+---------
+
+Some options below are probably redundant but these commands work
+for me:
+
+$ cat > /tmp/mk-fragment <<EOF
+PKGSRC_COMPILER=icc
+ICCBASE=@ICC_PREFIX@
+NOGCCERROR=yes
+EOF
+
+$ env PKGSRC_COMPILER=icc \
+> ICCBASE=@ICC_PREFIX@ \
+> NOGCCERROR=yes \
+> CC=@ICC_PREFIX@/bin/icc \
+> CPP='@ICC_PREFIX@/bin/icc -E' \
+> CXX=@ICC_PREFIX@/bin/icpc \
+> ./bootstrap \
+> --compiler=icc \
+> --mk-fragment=/tmp/mk-fragment \
+> ...
+
+Building Packages
+-----------------
+
+Add these lines to your mk.conf file:
+
+PKGSRC_COMPILER=icc
+ICCBASE=@ICC_PREFIX@
+NOGCCERROR=yes
+
diff --git a/lang/icc11/files/as.c b/lang/icc11/files/as.c
new file mode 100644
index 00000000000..8921f04ea6e
--- /dev/null
+++ b/lang/icc11/files/as.c
@@ -0,0 +1,35 @@
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/syslimits.h>
+#include <unistd.h>
+
+#include "util.h"
+
+int main(int argc, char* argv[])
+{
+ int i;
+ char *s;
+ char emul[PATH_MAX];
+
+ for(i = 1; i < argc; i++) {
+ if(strncmp(argv[i], "/tmp/i", 6) == 0) {
+ strlcpy(emul, EMULDIR, sizeof(emul));
+ strlcpy(emul + EMULDIR_LEN, argv[i], sizeof(emul) - EMULDIR_LEN);
+ move_tmpicc(emul);
+ }
+ }
+
+ if((s = getenv("ICC11_REALAS")) == NULL)
+ s = "as";
+ argv[0] = s;
+
+ execvp(s, argv);
+
+ s = strerror(errno);
+ write(STDERR_FILENO, argv[0], strlen(argv[0]));
+ write(STDERR_FILENO, ": ", 3);
+ write(STDERR_FILENO, s, strlen(s));
+ write(STDERR_FILENO, "\n", 1);
+ return EXIT_FAILURE;
+}
diff --git a/lang/icc11/files/icc b/lang/icc11/files/icc
new file mode 100644
index 00000000000..8903bf5fa0e
--- /dev/null
+++ b/lang/icc11/files/icc
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+LANG=C
+LC_MESSAGES=C
+export LANG LC_MESSAGES
+
+ICC11_REALAS="@BINUTILS_PREFIX@/bin/as"
+
+icc_arch=@ICC_ARCH@
+
+for opt in "$@"
+do
+ case "${opt}"
+ in
+ -m32) icc_arch=ia32 ;;
+ -m64) icc_arch=intel64 ;;
+ -dryrun) dryrun=1 ;;
+ -Qlocation,as,*)
+ ICC11_REALAS="${opt#-Qlocation,as,}/as"
+ ;;
+ -Qlocation,ld,*)
+ ICC11_REALLD="${opt#-Qlocation,ld,}/ld"
+ export ICC11_REALLD
+ ;;
+ -shared-intel|-openmp|-mkl=*|-opt-malloc-options=[1-9])
+ echo "${opt} is not supported on $(uname)." 1>&2
+ exit 1
+ ;;
+ esac
+done
+
+export ICC11_REALAS
+
+INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE:+${INTEL_LICENSE_FILE}:}@ICC_PREFIX@/licenses:/opt/intel/licenses:${HOME}/intel/licenses"
+export INTEL_LICENSE_FILE
+
+PATH="@ICC_PREFIX@/bin/${icc_arch}:@GCC_PREFIX@/bin:${PATH:-/bin:/usr/bin}"
+export PATH
+
+if [ -z "${dryrun}" ]
+then
+ exec ${0##*/} -Ulinux -U__linux__ -U__linux -U__gnu_linux__ -D__NetBSD__ "$@" \
+ "-Qlocation,as,@ICC_PREFIX@/libexec" \
+ "-Qlocation,ld,@ICC_PREFIX@/libexec"
+else
+ ${0##*/} -Ulinux -U__linux__ -U__linux -U__gnu_linux__ -D__NetBSD__ "$@" \
+ "-Qlocation,as,@ICC_PREFIX@/libexec" \
+ "-Qlocation,ld,@ICC_PREFIX@/libexec" 3>&1 1>&2 2>&3 3>&- | \
+ sed -e 's|^\( *\)/lib[64]*/ld-linux[x864-]*\.so\.2\([ \]*\)$|\1/usr/libexec/ld.elf_so\2|' \
+ -e 's|^\( *\)/usr/lib[64]*/crt1.o\([ \]*\)$|\1/usr/lib/crt0.o\2|' \
+ -e 's|^\( *\)-ldl\([ \]*\)$|\1-licc11bsd\2|' 3>&1 1>&2 2>&3 3>&-
+fi
diff --git a/lang/icc11/files/icc11bsd.c b/lang/icc11/files/icc11bsd.c
new file mode 100644
index 00000000000..5946ec18b6b
--- /dev/null
+++ b/lang/icc11/files/icc11bsd.c
@@ -0,0 +1,22 @@
+#include <assert.h>
+#include <elf.h>
+#include <stddef.h>
+#include <stdio.h>
+
+FILE* my_stderr = stderr;
+
+struct dl_phdr_info {
+ Elf32_Addr dlpi_addr;
+ const char *dlpi_name;
+ const Elf32_Phdr *dlpi_phdr;
+ Elf32_Half dlpi_phnum;
+};
+
+
+int dl_iterate_phdr(
+ int (*callback)(struct dl_phdr_info *info, size_t size, void *data),
+ void *data)
+{
+ assert(0 && "dl_iterate_phdr is not implemented");
+ return 1;
+}
diff --git a/lang/icc11/files/ld.c b/lang/icc11/files/ld.c
new file mode 100644
index 00000000000..b1c454cf412
--- /dev/null
+++ b/lang/icc11/files/ld.c
@@ -0,0 +1,45 @@
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/syslimits.h>
+#include <unistd.h>
+
+#include "util.h"
+
+int main(int argc, char* argv[])
+{
+ int i;
+ char *s;
+ char emul[PATH_MAX];
+
+ for(i = 1; i < argc; i++) {
+ if(strcmp(argv[i], "-ldl") == 0)
+ argv[i] = "-licc11bsd";
+ else if(strcmp(argv[i], "/usr/lib/crt1.o") == 0)
+ argv[i] = "/usr/lib/crt0.o";
+ else if(strcmp(argv[i], "/usr/lib64/crt1.o") == 0)
+ argv[i] = "/usr/lib/crt0.o";
+ else if(strcmp(argv[i], "/lib/ld-linux.so.2") == 0)
+ argv[i] = "/usr/libexec/ld.elf_so";
+ else if(strcmp(argv[i], "/lib64/ld-linux-x86-64.so.2") == 0)
+ argv[i] = "/usr/libexec/ld.elf_so";
+ else if(strncmp(argv[i], "/tmp/i", 6) == 0) {
+ strlcpy(emul, EMULDIR, sizeof(emul));
+ strlcpy(emul + EMULDIR_LEN, argv[i], sizeof(emul) - EMULDIR_LEN);
+ move_tmpicc(emul);
+ }
+ }
+
+ if((s = getenv("ICC11_REALLD")) == NULL)
+ s = "ld";
+ argv[0] = s;
+
+ execvp(s, argv);
+
+ s = strerror(errno);
+ write(STDERR_FILENO, argv[0], strlen(argv[0]));
+ write(STDERR_FILENO, ": ", 3);
+ write(STDERR_FILENO, s, strlen(s));
+ write(STDERR_FILENO, "\n", 1);
+ return EXIT_FAILURE;
+}
diff --git a/lang/icc11/files/linux/icc b/lang/icc11/files/linux/icc
new file mode 100644
index 00000000000..47d98dd6291
--- /dev/null
+++ b/lang/icc11/files/linux/icc
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+LANG=C
+LC_MESSAGES=C
+export LANG LC_MESSAGES
+
+icc_arch=@ICC_ARCH@
+
+for opt in "$@"
+do
+ case "${opt}"
+ in
+ -m32) icc_arch=ia32 ;;
+ -m64) icc_arch=intel64 ;;
+ esac
+done
+
+INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE:+${INTEL_LICENSE_FILE}:}@ICC_PREFIX@/licenses:/opt/intel/licenses:${HOME}/intel/licenses"
+export INTEL_LICENSE_FILE
+
+PATH="@ICC_PREFIX@/bin/${icc_arch}:@GCC_PREFIX@/bin:${PATH:-/bin:/usr/bin}"
+export PATH
+
+exec ${0##*/} "-Qlocation,as,@BINUTILS_PREFIX@/bin" "$@"
diff --git a/lang/icc11/files/util.c b/lang/icc11/files/util.c
new file mode 100644
index 00000000000..3db6684b577
--- /dev/null
+++ b/lang/icc11/files/util.c
@@ -0,0 +1,43 @@
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "util.h"
+
+// Relaxed error checking/reporting is fine because exec'd
+// program will report a missing file if the function fails.
+void move_tmpicc(const char* emul)
+{
+ char buf[1024];
+ struct stat st;
+ int bytes, src, dst;
+ const char* real = emul + EMULDIR_LEN;
+ const char* tail = real + (sizeof("/tmp/i") - 1);
+
+ if(strncmp(tail, "cc", 2) != 0 && strncmp(tail, "po_icc", 6) != 0)
+ return;
+
+ if(stat(real, &st) == 0)
+ return;
+
+ if(stat(emul, &st) < 0 || !(st.st_mode & S_IFREG))
+ return;
+
+ src = open(emul, O_RDONLY, 0644);
+ dst = open(real, O_WRONLY|O_CREAT|O_EXCL, st.st_mode);
+
+ while((bytes = read(src, buf, sizeof(buf))) > 0) {
+ if(write(dst, buf, bytes) != bytes) {
+ bytes = -1;
+ break;
+ }
+ }
+
+ if(src >= 0)
+ close(src);
+ if(dst >= 0 && close(dst) < 0)
+ bytes = -1;
+ if(bytes < 0 || unlink(emul) < 0)
+ unlink(real);
+}
diff --git a/lang/icc11/files/util.h b/lang/icc11/files/util.h
new file mode 100644
index 00000000000..e0e06a403aa
--- /dev/null
+++ b/lang/icc11/files/util.h
@@ -0,0 +1,3 @@
+#define EMULDIR "@OPSYS_EMULDIR@"
+#define EMULDIR_LEN (sizeof(EMULDIR) - 1)
+void move_tmpicc(const char* emul);
diff --git a/lang/icc11/files/xiar b/lang/icc11/files/xiar
new file mode 100644
index 00000000000..91abbc88ed3
--- /dev/null
+++ b/lang/icc11/files/xiar
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+LANG=C
+LC_MESSAGES=C
+export LANG LC_MESSAGES
+
+INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE:+${INTEL_LICENSE_FILE}:}@ICC_PREFIX@/licenses:/opt/intel/licenses:${HOME}/intel/licenses"
+export INTEL_LICENSE_FILE
+
+PATH="@ICC_PREFIX@/bin/@ICC_ARCH@:@GCC_PREFIX@/bin:${PATH:-/bin:/usr/bin}"
+export PATH
+
+exec ${0##*/} "$@"