[LLVMbugs] [Bug 214] NEW: hard-wired assumption that shared-library extension is ".so"

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Jan 21 10:22:09 PST 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=214

           Summary: hard-wired assumption that shared-library extension is
                    ".so"
           Product: Build scripts
           Version: cvs
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Makefiles
        AssignedTo: criswell at uiuc.edu
        ReportedBy: mkahl at apple.com


On MacOSX shared libraries end in ".dylib".  Some parts of the LLVM build system (configure, mklib) 
seem to know this, but not all (Makefile.rules).

As a result, "make install" always fails (in install-dynamic-library).  I have attached a patch below.  
(Undoubtedly this is not the best patch, but it is a satisfactory workaround.)

There may also be other places where ".so" is hard-wired (e.g. gccld/Linker.cpp).


[hatter:~/Work/llvm/llvm] % cvs diff
Index: Makefile.rules
===============================================================
====
RCS file: /var/cvs/llvm/llvm/Makefile.rules,v
retrieving revision 1.169
diff -B -u -b -r1.169 Makefile.rules
--- Makefile.rules      16 Jan 2004 21:31:20 -0000      1.169
+++ Makefile.rules      20 Jan 2004 23:22:58 -0000
@@ -107,9 +107,13 @@
 #      used by this Makefile, and cancel useless implicit rules.   This
 #      will hopefully speed up compilation a little bit.

###########################################################################
+so := so
+ifeq ($(OS),Darwin)
+so := dylib
+endif
 .SUFFIXES:
 .SUFFIXES: .c .cpp .h .hpp .y .l
-.SUFFIXES: .lo .o .a .so .bc .td
+.SUFFIXES: .lo .o .a .$(so) .bc .td
 .SUFFIXES: .ps .dot .d
 
 #
@@ -459,10 +463,10 @@
 # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
 LIBRARYNAME := $(strip $(LIBRARYNAME))
 
-LIBNAME_O    := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so
-LIBNAME_P    := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so
-LIBNAME_G    := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so
-LIBNAME_CUR  := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
+LIBNAME_O    := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).$(so)
+LIBNAME_P    := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).$(so)
+LIBNAME_G    := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).$(so)
+LIBNAME_CUR  := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).$(so)
 LIBNAME_AO   := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
 LIBNAME_AP   := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
 LIBNAME_AG   := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
@@ -544,7 +548,7 @@
 
 install-dynamic-library: $(LIBNAME_CUR)
        $(MKDIR) $(libdir)
-       $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_CUR) $(libdir)/lib$(LIBRARYNAME).so
+       $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_CUR) $(libdir)/
lib$(LIBRARYNAME).$(so)
 
 #
 # Rules for building static archive libraries.
@@ -813,7 +817,7 @@
        $(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release
        $(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
        $(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/BytecodeObj
-       $(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
+       $(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *.$(so) *~ *.flc
        $(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT)
 

###########################################################################



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list