Matt Waston <mwatson@apple.com> taught me what common symbols are NORMANDY_BASE
authorwtc
Thu, 07 May 1998 19:19:25 +0000
changeset 102 d63f71892375b3109f882f1b0c4d23d1e916f1ae
parent 101 f8f3682d20994b50493fa792810f767f309df7b3
child 103 32bd26e2f3ba70d4dc8b705b3a6a239aa941cc65
child 105 d8f82654a5b85842acd09adc9c13490569f98cc0
push idunknown
push userunknown
push dateunknown
Matt Waston <mwatson@apple.com> taught me what common symbols are and to compile with -fno-common.
config/Rhapsody.mk
--- a/config/Rhapsody.mk
+++ b/config/Rhapsody.mk
@@ -26,17 +26,27 @@ CCC			= cc++
 RANLIB			= ranlib
 
 OS_REL_CFLAGS		= -Dppc
 CPU_ARCH		= ppc
 
 #OS_REL_CFLAGS		= -mno-486 -Di386
 #CPU_ARCH		= x86
 
-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
+# "Commons" are tentative definitions in a global scope, like this:
+#     int x;
+# The meaning of a common is ambiguous.  It may be a true definition:
+#     int x = 0;
+# or it may be a declaration of a symbol defined in another file:
+#     extern int x;
+# Use the -fno-common option to force all commons to become true
+# definitions so that the linker can catch multiply-defined symbols.
+# Also, common symbols are not allowed with Rhapsody dynamic libraries.
+
+OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -fno-common -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
 
 DEFINES			+= -D_PR_LOCAL_THREADS_ONLY -D_PR_NEED_FAKE_POLL
 
 ARCH			= rhapsody
 
 #DSO_CFLAGS		= -fPIC
 #DSO_LDOPTS		= -Bshareable
 #DSO_LDFLAGS		=