Index: etc/config/icc.config =================================================================== --- etc/config/icc.config (revision 507945) +++ etc/config/icc.config (working copy) @@ -15,6 +15,10 @@ endif CCVER := $(shell $(CXX) -V foo.c 2>&1 | sed -n "s/.*Version *\([0-9.]*\).*/\1/p") + +CXX_MAJOR := $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/") +CXX_MINOR := $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/") + CPPFLAGS = -I$(TOPDIR)/include/ansi CXXFLAGS = -Xc -no_cpprt @@ -29,7 +33,12 @@ LD = $(CXX) -no_cpprt $(ICCDIR)/crtxi.o LDFLAGS = LDSOFLAGS = -shared + +ifeq ($(shell [ $(CXX_MAJOR) -ge 9 -o $(CXX_MAJOR) -eq 9 -a $(CXX_MINOR) -ge 1 ] LDLIBS = -Bstatic -lcxa -lunwind -Bdynamic $(ICCDIR)/crtxn.o +else +LDLIBS = -Bstatic -lcxa -lunwind -Bdynamic $(ICCDIR)/crtend.o +endif # The flag(s) to use to embed a library search path into generated executables. RPATH = -Wl,-R