FreeBSD Kernel mit Intel Compiler compilen

CFLAGS=-O CC=icc make depend && CFLAGS=-O CC=icc make

damit wollte ich den Kernel bauen, leider bricht er ab mit

iccbin: Command line warning: ignoring option '-W'; no argument required
iccbin: Command line warning: ignoring unknown option '-fformat-extensions'
iccbin: Command line warning: ignoring option '-mp'; no argument required
*Initialization*:1: warning: `__PTRDIFF_TYPE__' redefined
*Initialization*:1: warning: `__SIZE_TYPE__' redefined
*Initialization*:1: warning: `__WCHAR_TYPE__' redefined
*Initialization*:1: warning: `__USER_LABEL_PREFIX__' redefined
*Initialization*:1: warning: `__REGISTER_PREFIX__' redefined
/tmp/iccbinT9RbQ7s: Assembler messages:
/tmp/iccbinT9RbQ7s:1874: Error: bignum invalid

aber was solls *grummel*
 
Schreib doch mal A. Leidinger an. Er hat den Kernel doch schon mit dem icc gebaut. Evtl. kann er weiterhelfen.
 
Welche Version von linux_base wird generell zum einwandfreien Laufen von icc benötigt (FreeBSD 5.2.1)?
Linux_base-8 führt zu folgendem Fehler:

/usr/local/intel_cc_80/bin/icc foo.c
iccbin: internal error: error generating temporary file name (shared/driver/hostutil.c, line 294)
 
Gestartet als root kann der icc ein File unterhalb von /tmp nicht finden:

# icc foo.c
/usr/local/intel_cc_80/bin/ldwrapper/ld: cannot open /tmp/iccbineHD7Jc.o: No such file or directory

Was gilt es hier zu beachten?
 
@j_t
mit der Linux-Emulation auf Basis von Gentoo hatte ich den ICC 7.1.006 funktionstüchtig installiert, d.h. die Pfade stimmten und Hallo Welt konnte auch übersetzt werden.
Jetzt ist die Version 8.0.055 im aktuellen eBuild. Wenn es interessiert würde ich die Vorgehensweise um FreeBSD jedes Linux als Emulation unterzuwuchten genauer beschreiben.
 
Zuletzt bearbeitet von einem Moderator:
@OM_A: DIe Linux-Emu als solche funktioniert bei mir klasse, lediglich der icc will noch nicht so richtig. Deine Tipps sind also sehr willkommen.
 
http://www.bsdforen.de/forums/showthread.php?s=&threadid=1768&highlight=emerge
Nach diesem Beitrag hatte ich mit dem ICC in der Linuxemulation experimentiert. Der Bootstrapvorgang brach damals beim Compilieren der glibc ab. Daraufhin habe ich:
1. /compat/linux/dev gesichert
2. in /etc/sysctl.conf angefügt: kern.fallback_elf_brand=3
3. in /compat den Inhalt des Verzeichnisses linux gelöscht
4. in /compat/linux eine gentoo-stage2 entpackt
5. /compat/linux/dev gelöscht
6. das im Schritt 1 gesicherte Verzeichnis dev nach /compat/linux kopiert
7. resolv.conf von FreeBSD nach /compat/linux/etc kopiert
8. /compat/linux/etc/make.conf bearbeitet (ich füge meine Datei unten an, wichtig ist USE-Flag setzen und Downloadmirror angeben)
9. chroot /compat/linux /bin/bash
10. emerge sync
11. emerge system (dauert ne Weile)
12. emerge icc

Eine normale Gentoo-Installation mit tar -cvzpf ein- und in /compat/linux mit tar -xvzpf wieder ausgepackt funktionierte auch.
Mit der gleichen Methode habe ich ein Debian GNU/Linux testing zum Laufen gebracht. Wenn man debianconf entsprechend konfiguriert funktioniert dann auch apt, ohne sich beim Konfigurationsdialog nach der Installation eines Pakets aufzuhängen.

Hier nun meine für PIII geänderte Gentoo make.conf:
# Copyright 2000-2002 Daniel Robbins, Gentoo Technologies, Inc.
# Contains local system settings for Portage system
# Please review 'man make.conf' for more information.

# Build-time functionality
# ========================
#
# The USE variable is used to enable optional build-time functionality. For
# example, quite a few packages have optional X, gtk or GNOME functionality
# that can only be enabled or disabled at compile-time. Gentoo Linux has a
# very extensive set of USE variables described in our USE variable HOWTO at
# http://www.gentoo.org/doc/use-howto.html
#
# The available list of use flags with descriptions is in your portage tree.
# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <--
#
# Example:
#USE="X gtk gnome -alsa"
#USE="X apache2 gtk KDE -gnome"
USE="-X"
# Host Setting
# ============
#
# If you are using a Pentium Pro or greater processor, leave this line as-is;
# otherwise, change to i586, i486 or i386 as appropriate. All modern systems
# (even Athlons) should use "i686-pc-linux-gnu"
#
CHOST="i686-pc-linux-gnu"

# Host and optimization settings
# ==============================
#
# For optimal performance, enable a CFLAGS setting appropriate for your CPU
#
# -mcpu=<cpu-type> means optimize code for the particular type of CPU without
# breaking compatibility with other CPUs.
#
# -march=<cpu-type> means to take full advantage of the ABI and instructions
# for the particular CPU; this will break compatibility with older CPUs (for
# example, -march=athlon-xp code will not run on a regular Athlon, and
# -march=i686 code will not run on a Pentium Classic.
#
# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp, athlon-4,
# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686
# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron), pentium3,
# and pentium4. Note that Gentoo Linux 1.4 and higher include at least gcc-3.2.
#
# CPU types supported in gcc-2.95*: k6, i386, i486, i586 (Pentium), i686
# (Pentium Pro), pentium, pentiumpro Gentoo Linux 1.2 and below use gcc-2.95*
#
# Decent examples:
#
#CFLAGS="-mcpu=athlon-xp -O3 -pipe"
#CFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe"
CFLAGS="-O3 -march=pentium3 -funroll-loops -pipe"

# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings. If you don't set CFLAGS above, then comment this line out.
#CXXFLAGS="${CFLAGS}"
#CXXFLAGS="-O2 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe"
CXXFLAGS="-O2 -march=pentium3 -funroll-loops -pipe"

# Advanced Masking
# ================
#
# Gentoo is using a new masking system to allow for easier stability testing
# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based
# on the platform they are set for. A special form has been added that
# indicates packages and revisions that are expected to work, but have not yet
# been approved for the stable set. '~arch' is a superset of 'arch' which
# includes the unstable, in testing, packages. Users of the 'x86' architecture
# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages.
# '~ppc', '~sparc', '~sparc64' are the unstable KEYWORDS for their respective
# platforms. DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
#ACCEPT_KEYWORDS="~x86"

# Portage Directories
# ===================
#
# Each of these settings controls an aspect of portage's storage and file
# system usage. If you change any of these, be sure it is available when
# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" ***
#
# PORTAGE_TMPDIR is the location portage will use for compilations and
# temporary storage of data. This can get VERY large depending upon
# the application being installed.
#PORTAGE_TMPDIR="/var/tmp"
#
# PORTDIR is the location of the portage tree. This is the repository
# for all profile information as well as all ebuilds. This directory
# itself can reach 200M. WE DO NOT RECOMMEND that you change this.
#PORTDIR="/usr/portage"
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. The source code is maintained here unless you delete
# it. The entire repository of tarballs for gentoo is 9G. This is
# considerably more than any user will ever download. 2-3G is
# a large DISTDIR.
#DISTDIR="${PORTDIR}/distfiles"
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# upto several hundred megs, or even a few gigs.
#PKGDIR="${PORTDIR}/packages"
#
# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
# concern that they will be deleted by rsync updates. Default is not
# defined.
#PORTDIR_OVERLAY="/usr/local/portage"

# Fetching files
# ==============
#
# If you need to set a proxy for wget or lukemftp, add the appropriate "export
# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if
# all users on your system should use them.
#
# Portage uses wget by default. Here are some settings for some alternate
# downloaders -- note that you need to merge these programs first before they
# will be available.
#
# Lukemftp (BSD ftp):
#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
#
# Prozilla (turbo downloader)
#FETCHCOMMAND='/usr/bin/proz --no-getch -s ${URI} -P ${DISTDIR}'

# Advanced Features
# =================
#
# MAKEOPTS provides extra options that may be passed to 'make' when a
# program is compiled. Presently the only use is for specifying
# the number of parallel makes (-j) to perform. The suggested number
# for parallel makes is CPUs+1.
MAKEOPTS="-j2"
#
# AUTOCLEAN enables portage to automatically clean out older or overlapping
# packages from the system after every successful merge. This is the
# same as running 'emerge -c' after every merge. Set with: "yes" or "no".
#AUTOCLEAN="yes"
#
# FEATURES are settings that affect the functionality of portage. Most of
# these settings are for developer use, but some are available to non-
# developers as well. 'buildpkg' is an always-on setting for the emerge
# flag of the same name. It causes binary packages to be created of all
# packages that are merged.
#FEATURES="sandbox ccache buildpkg"
#
# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
#RSYNC_RETRIES="3"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
 
cd /usr/obj
chflags -R -noschg * && rm -rf*
cd /usr/src/sys/compile/MYKERNEL
make depend && make

dies garantiert dass kein Error auftritt.

CFLAGS=-O CC=icc make depend && CFLAGS=-O CC=icc make

im Anschluss daran (ohne clean) gibt er auch keine Fehler aus.
Ohne die Vorarbeit und Patches ist es jedoch nicht möglich den Kernel fehlerfrei zu bauen. Ich teste weiter.
*edit*
Error: suffix or operands invalid for `shl'
Error: bignum invalid

Wie es scheint kriege ich icc7 nicht dazu etwas mit dem Kernel anzufangen.
ausserdem muss ich ein passendes patch File finden
http://leidinger.net/FreeBSD/current-patches/compiler_independence.diff
 
Zuletzt bearbeitet:
Huhu

Ich hab mal spasseshalber probiert ob das mittlerweile problemlos funktioniert.
Ich mußte an den Sourcen (zuletzt am 7.1. aktualisiert) nur 2 kleine Änderungen (siehe [1]) vornehmen.
Vorgegangen bin ich dabei nach der "alten" Methode einen FreeBSD-Kernel zu bauen (siehe [2]).

Funktioniert soweit. Einzig der Xserver (xorg bei mir) crasht wenn ich NVidias proprietären Treiber verwenden will.

Wenn ich Lust hab versuch ich die Tage auch mal die ganze Welt mit dem icc zu bauen.

Gruß, matze

[1] http://lists.freebsd.org/pipermail/freebsd-bugs/2004-December/010575.html
[2] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html
 
mit dem icc 8.1 soll der kernel jetzt auch booten. allerdings habe ihc nocht keine zeit gehabt das zu testen
 
ouTi schrieb:
mit dem icc 8.1 soll der kernel jetzt auch booten. allerdings habe ihc nocht keine zeit gehabt das zu testen
Sag ich ja. Funktioniert ganz toll!

% uname -a
FreeBSD lodoss.reinhold.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Thu Jan 13 20:38:20 CET 2005 root@lodoss.reinhold.local:/usr/src/sys/i386/compile/LODOSS i386

% icc -v
Version 8.1

% ls -l /boot/kernel.old/kernel
-r-xr-xr-x 1 root wheel 4374131 Jan 7 15:47 /boot/kernel.old/kernel

% ls -l /boot/kernel/kernel
-r-xr-xr-x 1 root wheel 4243473 Jan 13 20:38 /boot/kernel/kernel
Die beiden Kernel da sind aus (bis auf die beiden aenderungen am ndis-Treiber) dem identischen Quellcode gebaut. Ich bin hier gerade mit dem icc-Kompilat unterwegs.

Gruß, matze
 
Hi !

Wollte jetzt auch mal versuchen mein System mit dem ICC zu bauen...leider wird bei mkdep schon aufgehört...
CC='/usr/local/intel_cc_80/bin/icc' mkdep -f .depend -a -I/usr/obj/usr/src/i386/legacy/usr/include -I/usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/lib -I/usr/src/gnu/usr.bin/gperf /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/bool-array.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/gen-perf.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/hash-table.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/iterator.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/key-list.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/list-node.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/main.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/new.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/options.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/read-line.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/trace.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/vectors.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/version.cc /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/lib/hash.cc
mkdep: compile failed
*** Error code 1

Stop in /usr/src/gnu/usr.bin/gperf.
*** Error code 1

Liegt das noch immer an der Compiler Version ? Ich benutze im Moment 8.1.030 mit einem FreeBSD 5.4 vom 11.Mai.

In meiner make.conf steht:
CC=/usr/local/intel_cc_80/bin/icc
CXX=/usr/local/intel_cc_80/bin/icc

Kann mir jemand einen Tip geben, in welcher Richtung ich suchen muss ?
 
Ich habs heute auch mal probiert ;)

Funtktioniert es? Ja, es funktioniert.
Ist ein Performancegewinn spürbar? Naja, ich merk nix. Subjektiv hat sich nichts an der Geschwindigkeit getan, Zahlen/Benchmarks mögen da eine andere Sprache sprechen, aber das ist Wurst. Wie es unter Last aussieht, weiss ich allerdings auch nicht.
Gibt es Probleme? Ja, mit dem Treiber von Nvidia friert die Kiste ein.
Lohnt es sich? Muss jeder für sich entscheiden, ich habe bisher keine Vorteile feststellen können ;)

Gruß
 
===> icc-8.1.035 is only for i386, and you are running amd64.

*brummel*

immer wird mer als Minderheitenbär von sowas ausgeschlossen ;'(
 
Zurück
Oben