Bug 105267

Summary: strange library name generated when using managed make to build shared libs on Mac
Product: [Tools] CDT Reporter: Chris Wiebe <cwiebe>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: ASSIGNED --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 Keywords: bugday, helpwanted
Version: 3.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Whiteboard:

Description Chris Wiebe CLA 2005-07-26 23:25:15 EDT
I'm trying to set up a managed build tool chain which generates a shared library on Mac OS.  The 
problem I'm seeing is that the library output name is non-sensical, eg:

libUSER_OBJS.dylib: $(OBJS) $(USER_OBJS)
	@echo 'Invoking: MacOS X C++ Linker'
	@echo g++ -dynamiclib -o libUSER_OBJS.dylib $(OBJS) $(USER_OBJS) $(LIBS)
	@g++ -dynamiclib -o libUSER_OBJS.dylib $(OBJS) $(USER_OBJS) $(LIBS)
	@echo 'Finished building: $@'
	@echo ' '

The problem seems to be with the Mac OS CPP linker tool (cdt.managedbuild.tool.macosx.cpp.linker) 
definition for the output type.

         <outputType
			outputs=""
            buildVariable="EXECUTABLES"
            nameProvider="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuLinkOutputNameProvider"
            id="cdt.managedbuild.tool.macosx.cpp.linker.output">
         </outputType>

I stepped into the GnuLinkOutputNameProvider code and it seems that the shared library is not 
detected.  Specifically this line:

		if (hasAncestor(tool, "cdt.managedbuild.tool.gnu.cpp.linker")) {

is failing since according to the tool definition the mac os linker is not actually subclassed off of the 
gnu linker.

Without understanding what exactly the code is doing, my guess is this was probably just a simple 
oversight that slipped through the cracks.  Should there be a MacOSLinkOutputNameProvider for the 
mac os linker?
Comment 1 Mikhail Sennikovsky CLA 2006-04-25 08:46:59 EDT
Hi Chris,

Unfortunately I don't have a Mac machine to test and reproduce your issue, so I initially want to test Mac-type MBS project types on my PC box and see if makefiles are generated correctly there.
For now I could not reproduce the issue. Could you attach a sample project that exposes the incorrect lib name generation so that I could reproduce and fix it?

Thanks,
Mikhail
Comment 2 Chris Recoskie CLA 2009-05-11 14:41:26 EDT
Shouldn't be hard to fix, but Mac hasn't been a priority for most of the committers, so this has languished for quite a while.  Might be a good candidate for bugday.