Bug 105267 - strange library name generated when using managed make to build shared libs on Mac
Summary: strange library name generated when using managed make to build shared libs o...
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 3.0   Edit
Hardware: Macintosh All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2005-07-26 23:25 EDT by Chris Wiebe CLA
Modified: 2020-09-04 15:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.