[llvm-commits] CVS: llvm/Makefile.common

John Criswell criswell at cs.uiuc.edu
Thu Jul 10 17:27:01 PDT 2003


Changes in directory llvm:

Makefile.common updated: 1.96 -> 1.96.2.1

---
Log message:

Modified the rules for building shared objects such that they are built
directly with GCC.
Dynamic objects built with libtool do not call the constructors of global
objects like they should, causing them to be unusable with programs like opt.



---
Diffs of the changes:

Index: llvm/Makefile.common
diff -u llvm/Makefile.common:1.96 llvm/Makefile.common:1.96.2.1
--- llvm/Makefile.common:1.96	Tue Jul  1 09:52:28 2003
+++ llvm/Makefile.common	Thu Jul 10 17:26:17 2003
@@ -395,6 +395,11 @@
 ObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(Objs))
 ObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(Objs))
 
+RealObjs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(notdir $(basename $(Source))))))
+RealObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(RealObjs))
+RealObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(RealObjs))
+RealObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RealObjs))
+
 #---------------------------------------------------------
 # Handle the DIRS and PARALLEL_DIRS options
 #---------------------------------------------------------
@@ -489,20 +494,17 @@
 #
 # Rules for building dynamically linked libraries.
 #
-$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
+$(LIBNAME_O): $(RealObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
 	@echo ======= Linking $(LIBRARYNAME) dynamic release library =======
-	$(VERB) $(Link) -o $*.la $(ObjectsO) $(LibSubDirs) $(LibLinkOpts);
-	$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
+	$(VERB) $(CXX) -G -o $@ $(RealObjectsO) $(LibSubDirs) $(LibLinkOpts);
 
 $(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
 	@echo ======= Linking $(LIBRARYNAME) dynamic profile library =======
-	$(VERB) $(Link) -o $*.la $(ObjectsP) $(LibSubDirs) $(LibLinkOpts);
-	$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
+	$(VERB) $(CXX) -G -o $@ $(RealObjectsP) $(LibSubDirs) $(LibLinkOpts);
 
 $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
 	@echo ======= Linking $(LIBRARYNAME) dynamic debug library =======
-	$(VERB) $(Link) -o $*.la $(ObjectsG) $(LibSubDirs) $(LibLinkOpts);
-	$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT);
+	$(VERB) $(CXX) -G -o $@ $(RealObjectsG) $(LibSubDirs) $(LibLinkOpts);
 
 #
 # Rules for building static archive libraries.





More information about the llvm-commits mailing list