diff options
author | Alexander Leidinger <netchild@FreeBSD.org> | 2004-01-11 15:32:07 +0000 |
---|---|---|
committer | Alexander Leidinger <netchild@FreeBSD.org> | 2004-01-11 15:32:07 +0000 |
commit | 5b75a54ddfee188423807a395d9c9f903e633cb7 (patch) | |
tree | 3917f713be239795252d5b9047627e89e21ea114 /lang/icc/files/ld.c | |
parent | Update for the upcomming icc7 and icc (v8). (diff) |
Update to 8.0.055.p057.
As Intel uses it's own directory for ifc and icc, we don't conflict with
ifc anymore.
Because of ABI changes, you have to recompile C++ programs (don't forget
stlport-icc).
Note that this port is a _work in progress_:
- Icc allows to use an already installed libstdc++ from gcc, this doesn't
work yet on FreeBSD. Libstdc++ on 4.x is too old, so it's unlikely we
can add support for it. The headers of libstdc++ shipping with FreeBSD
5.2-CURRENT use GCCisms not (yet) supported by icc, the hardcoded search
path for them also doesn't fit for FreeBSD 5.2-CURRENT.
- We've incorporated parts (cxa) of the FreeBSD >= 502101 libc on < 502101
systems. It's tested on 4.x, but not on FreeBSD < 502101.
- Not all (new) options (including GCC compatibility) are thoroughly
tested.
When encountering problems please report to me first instead of directly
contacting Intel.
Ackknowledgements:
- Bradley T Hughes <bhughes@trolltech.com> for PR 59552, it resulted in
a modification of our libc (C++ DSO Object Destruction API) we
incorporate in the port on < 502101 systems.
- Marius Strobl <marius@alchemy.franken.de> for his help with the port
(e.g. ld.c, cxa).
Notes
Notes:
svn path=/head/; revision=97928
Diffstat (limited to 'lang/icc/files/ld.c')
-rw-r--r-- | lang/icc/files/ld.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/lang/icc/files/ld.c b/lang/icc/files/ld.c index a55671768e79..66420cebfeae 100644 --- a/lang/icc/files/ld.c +++ b/lang/icc/files/ld.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #define LDW_GPROF (1<<2) #define LDW_PIC (1<<3) #define LDW_THR (1<<4) +#define LDW_LGCC (1<<5) struct arglist { size_t argc; @@ -76,7 +77,7 @@ main(int argc, char *argv[], char *envp[]) { size_t i; u_int flags; - const char *libc, *libthr, *prefix; + const char *libc, *libthr, *icc_localbase; struct arglist al = { 0, NULL }; flags = 0; @@ -84,8 +85,8 @@ main(int argc, char *argv[], char *envp[]) if (argc == 1) errx(1, "no input files"); - if ((prefix = getenv("PREFIX")) == NULL) - errx(1, "can't get PREFIX"); + if ((icc_localbase = getenv("ICC_LOCALBASE")) == NULL) + errx(1, "can't get ICC_LOCALBASE"); #ifdef DEBUG printf("input: "); @@ -140,6 +141,11 @@ main(int argc, char *argv[], char *envp[]) flags |= LDW_GPROF; continue; } + + if (ARGCMP(i, "-lgcc")) { + flags |= LDW_LGCC; + continue; + } } /* @@ -192,8 +198,8 @@ main(int argc, char *argv[], char *envp[]) continue; } - /* Don't add obsolete flag "-Qy". */ - if (ARGCMP(i, "-Qy")) + /* Don't add obsolete flag "-Qy", don't add libgcc_s. */ + if (ARGCMP(i, "-Qy") || ARGCMP(i, "-lgcc_s")) continue; /* @@ -202,7 +208,7 @@ main(int argc, char *argv[], char *envp[]) * in both, the static and the dynamic, versions. */ if (ARGCMP(i, "-lcprts")) { - if (flags & LDW_CPP) { + if (flags & LDW_CPP && !(flags & LDW_LGCC)) { addarg(&al, flags & LDW_DYN ? "-Bdynamic" : "-Bstatic"); addarg(&al, "-lstlport_icc"); @@ -245,9 +251,9 @@ 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) { + if (flags & LDW_CPP && !(flags & LDW_LGCC)) { char *p; - asprintf(&p, "-L%s/lib", prefix); + asprintf(&p, "-L%s/lib", icc_localbase); if (p == NULL) err(1, NULL); addarg(&al, p); @@ -256,24 +262,27 @@ main(int argc, char *argv[], char *envp[]) } /* - * Force libcxa and libunwind to static linkage, since the - * dynamic versions have glibc dependencies. + * Force libcxa, libcxaguard and libunwind to static linkage, + * since the dynamic versions have glibc dependencies. * Don't add superfluous -Bdynamic. */ if (ARGCMP(i, "-Bdynamic") && i < argc - 1) { if (ARGCMP(i + 1, "-lcxa") || + ARGCMP(i + 1, "-lcxaguard") || ARGCMP(i + 1, "-lunwind")) { addarg(&al, "-Bstatic"); continue; } - if (ARGCMP(i + 1, "-lcprts")) + 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, "-lunwind"))) + (ARGCMP(i + 1, "-lcprts") || ARGCMP(i + 1, "-lgcc_s") || + ARGCMP(i + 1, "-lunwind"))) continue; /* @@ -282,9 +291,9 @@ main(int argc, char *argv[], char *envp[]) */ if (!strncmp(argv[i], "-l", 2) && al.argc > 0 && strncmp(al.argv[al.argc - 1], "-B", 2)) { - if (ARGCMP(i, "-lcxa") || ARGCMP(i, "-limf") || - ARGCMP(i, "-lirc") || ARGCMP(i, "-lircmt") || - ARGCMP(i, "-lunwind")) + if (ARGCMP(i, "-lcxa") || ARGCMP(i, "-lcxaguard") || + ARGCMP(i, "-limf") || ARGCMP(i, "-lirc") || + ARGCMP(i, "-lircmt") || ARGCMP(i, "-lunwind")) addarg(&al, "-Bstatic"); else addarg(&al, |