7159254 Userland adjustments to ease Studio 12.3 transition
authorRich Burridge <rich.burridge@oracle.com>
Wed, 11 Apr 2012 13:51:22 -0700
changeset 766 58402b94c13b
parent 765 934861104a36
child 767 f4589126221b
7159254 Userland adjustments to ease Studio 12.3 transition
components/ilmbase/Makefile
components/openexr/Makefile
make-rules/shared-macros.mk
--- a/components/ilmbase/Makefile	Tue Apr 10 04:03:43 2012 -0700
+++ b/components/ilmbase/Makefile	Wed Apr 11 13:51:22 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../make-rules/shared-macros.mk
 
@@ -36,19 +36,19 @@
 
 PATCH_LEVEL = 0
 
-# configure seems to add -nolibs, so we add that back to the C++ runtime and
-# stdlib
-CXXFLAGS += $(studio_CXXLIB_CSTD)
 # there seems to be no other way to enable large files support
 CXXFLAGS += $(CPP_LARGEFILES)
 # it seems that --with-pic doesn't get PIC flags to the C++ compiler
 CXXFLAGS += $(CC_PIC)
-# libtools seems to be forcing -nolibs, so we have to add back libc and libm
-LDFLAGS += -lc -lm
+# libtools seems to be forcing -nolibs, so we have to add back libc, libm,
+# libCstd and libCrun. The last two are needed because with Studio 12.2
+# (and beyond), there is a bug in the CC driver that is not correctly using
+# the '-library=Cstd,Crun' we are passing to it.
+LIBS += -lc -lm -lCstd -lCrun
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
+CONFIGURE_ENV += LIBS="$(LIBS)"
 CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS  +=           --disable-static
--- a/components/openexr/Makefile	Tue Apr 10 04:03:43 2012 -0700
+++ b/components/openexr/Makefile	Wed Apr 11 13:51:22 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../make-rules/shared-macros.mk
 
@@ -36,18 +36,19 @@
 
 PATCH_LEVEL = 0
 
-# configure seems to add -nolibs, so we add that back the C++ runtime and stdlib
-CXXFLAGS += $(studio_CXXLIB_CSTD)
 # there seems to be no other way to enable large files support
 CXXFLAGS += $(CPP_LARGEFILES)
 # it seems that --with-pic doesn't get PIC flags to the C++ compiler
 CXXFLAGS += $(CC_PIC)
-# libtools seems to be forcing -nolibs, so we have to add back libc and libm
-LDFLAGS += -lc -lm
+# libtools seems to be forcing -nolibs, so we have to add back libc, libm,
+# libCstd and libCrun. The last two are needed because with Studio 12.2
+# (and beyond), there is a bug in the CC driver that is not correctly using
+# the '-library=Cstd,Crun' we are passing to it.
+LIBS += -lc -lm -lCstd -lCrun
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
+CONFIGURE_ENV += LIBS="$(LIBS)"
 CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS  +=           --disable-static
@@ -64,4 +65,3 @@
 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
 
 include ../../make-rules/depend.mk
-
--- a/make-rules/shared-macros.mk	Tue Apr 10 04:03:43 2012 -0700
+++ b/make-rules/shared-macros.mk	Wed Apr 11 13:51:22 2012 -0700
@@ -554,6 +554,9 @@
 
 LD_Z_TEXT =		-z direct
 
+# make sure that -lc is always present when building shared objects.
+LD_DEF_LIBS +=		-lc
+
 # make sure all symbols are defined.
 LD_Z_DEFS =		-z defs
 
@@ -587,7 +590,7 @@
 LD_MAP_PAGEALIGN =	-M /usr/lib/ld/map.pagealign
 
 # Linker options to add when only building libraries
-LD_OPTIONS_SO +=	$(LD_Z_TEXT) $(LD_Z_DEFS)
+LD_OPTIONS_SO +=	$(LD_Z_TEXT) $(LD_Z_DEFS) $(LD_DEF_LIBS)
 
 # Default linker options that everyone should get.  Do not add additional
 # libraries to this macro, as it will apply to everything linked during the